From 6521b0db74241ac9d3c72763f2b75898ee45592c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 08:34:49 -0400 Subject: [PATCH 001/134] Re-enable tsan YAML tests on Linux and Mac. (#28990) --- .github/workflows/tests.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2571c6410d4432..15057ec27b2b4d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -198,8 +198,6 @@ jobs: " - name: Run Tests using the python parser sending commands to chip-tool - # https://github.com/project-chip/connectedhomeip/issues/27673 - if: matrix.build_variant != 'no-ble-tsan-clang' run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ @@ -274,8 +272,7 @@ jobs: strategy: matrix: - build_variant: [no-ble-asan-clang] - # Since no-ble-tsan-clang doesn't run any tests, this is just wasted CI time for now + build_variant: [no-ble-asan-clang, no-ble-tsan-clang] chip_tool: [""] env: BUILD_VARIANT: ${{matrix.build_variant}} @@ -322,8 +319,6 @@ jobs: " - name: Run Tests using the python parser sending commands to chip-tool - # https://github.com/project-chip/connectedhomeip/issues/27673 - if: matrix.build_variant != 'no-ble-tsan-clang' run: | ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ From d083577a7d6fbd9a1829f28497b0c5d934edd478 Mon Sep 17 00:00:00 2001 From: joonhaengHeo <85541460+joonhaengHeo@users.noreply.github.com> Date: Tue, 5 Sep 2023 21:50:40 +0900 Subject: [PATCH 002/134] Fix Android exception jni type (#29066) --- .../java/src/chip/appserver/ChipAppServerException.java | 4 ++-- src/lib/support/JniReferences.cpp | 4 ++-- .../java/chip/platform/AndroidChipPlatformException.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/server/java/src/chip/appserver/ChipAppServerException.java b/src/app/server/java/src/chip/appserver/ChipAppServerException.java index 08e11d15fce99a..7a036eccc34973 100644 --- a/src/app/server/java/src/chip/appserver/ChipAppServerException.java +++ b/src/app/server/java/src/chip/appserver/ChipAppServerException.java @@ -3,11 +3,11 @@ public class ChipAppServerException extends RuntimeException { private static final long serialVersionUID = 1L; - public int errorCode; + public long errorCode; public ChipAppServerException() {} - public ChipAppServerException(int errorCode, String message) { + public ChipAppServerException(long errorCode, String message) { super(message != null ? message : String.format("Error Code %d", errorCode)); this.errorCode = errorCode; } diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index 870ec3fc2d1d56..6ad7e26d215409 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -198,12 +198,12 @@ void JniReferences::ReportError(JNIEnv * env, CHIP_ERROR cbErr, const char * fun void JniReferences::ThrowError(JNIEnv * env, jclass exceptionCls, CHIP_ERROR errToThrow) { env->ExceptionClear(); - jmethodID constructor = env->GetMethodID(exceptionCls, "", "(ILjava/lang/String;)V"); + jmethodID constructor = env->GetMethodID(exceptionCls, "", "(JLjava/lang/String;)V"); VerifyOrReturn(constructor != NULL); jstring jerrStr = env->NewStringUTF(ErrorStr(errToThrow)); - jthrowable outEx = (jthrowable) env->NewObject(exceptionCls, constructor, static_cast(errToThrow.AsInteger()), jerrStr); + jthrowable outEx = (jthrowable) env->NewObject(exceptionCls, constructor, static_cast(errToThrow.AsInteger()), jerrStr); VerifyOrReturn(!env->ExceptionCheck()); env->Throw(outEx); } diff --git a/src/platform/android/java/chip/platform/AndroidChipPlatformException.java b/src/platform/android/java/chip/platform/AndroidChipPlatformException.java index 0a0251730b9bee..9333e6149c6e7b 100644 --- a/src/platform/android/java/chip/platform/AndroidChipPlatformException.java +++ b/src/platform/android/java/chip/platform/AndroidChipPlatformException.java @@ -21,11 +21,11 @@ public class AndroidChipPlatformException extends Exception { private static final long serialVersionUID = 1L; - public int errorCode; + public long errorCode; public AndroidChipPlatformException() {} - public AndroidChipPlatformException(int errorCode, String message) { + public AndroidChipPlatformException(long errorCode, String message) { super(message != null ? message : String.format("Error Code %d", errorCode)); this.errorCode = errorCode; } From 4ccf87d2884bf030fdba3aff137367ee2363fd2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 12:53:25 +0000 Subject: [PATCH 003/134] Bump third_party/imgui/repo from `f617fe7` to `3816d47` (#29051) Bumps [third_party/imgui/repo](https://github.com/ocornut/imgui) from `f617fe7` to `3816d47`. - [Release notes](https://github.com/ocornut/imgui/releases) - [Commits](https://github.com/ocornut/imgui/compare/f617fe7890f78bc300e7a068a1c2acc9e9ce1e97...3816d478df0e7e292545fc7017b3d907c2dfd7a2) --- updated-dependencies: - dependency-name: third_party/imgui/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/imgui/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/imgui/repo b/third_party/imgui/repo index f617fe7890f78b..3816d478df0e7e 160000 --- a/third_party/imgui/repo +++ b/third_party/imgui/repo @@ -1 +1 @@ -Subproject commit f617fe7890f78bc300e7a068a1c2acc9e9ce1e97 +Subproject commit 3816d478df0e7e292545fc7017b3d907c2dfd7a2 From c07d91cec3a7b38f5dd11d6d24d419f7de51090a Mon Sep 17 00:00:00 2001 From: mideayanghui <106149377+mideayanghui@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:55:02 +0800 Subject: [PATCH 004/134] optimize zap for chef refrigerator (#29044) --- ...eraturecontrolledcabinet_ffdb696680.matter | 75 ------------------- ...emperaturecontrolledcabinet_ffdb696680.zap | 5 +- 2 files changed, 3 insertions(+), 77 deletions(-) diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index f0584c5561216e..23069ca02f6a43 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -79,75 +79,6 @@ server cluster Identify = 3 { command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } -/** Attributes and commands for group configuration and manipulation. */ -server cluster Groups = 4 { - bitmap Feature : BITMAP32 { - kGroupNames = 0x1; - } - - bitmap NameSupportBitmap : BITMAP8 { - kGroupNames = 0x80; - } - - readonly attribute NameSupportBitmap nameSupport = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AddGroupRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - request struct ViewGroupRequest { - group_id groupID = 0; - } - - request struct GetGroupMembershipRequest { - group_id groupList[] = 0; - } - - request struct RemoveGroupRequest { - group_id groupID = 0; - } - - request struct AddGroupIfIdentifyingRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - response struct AddGroupResponse = 0 { - ENUM8 status = 0; - group_id groupID = 1; - } - - response struct ViewGroupResponse = 1 { - ENUM8 status = 0; - group_id groupID = 1; - CHAR_STRING groupName = 2; - } - - response struct GetGroupMembershipResponse = 2 { - nullable INT8U capacity = 0; - group_id groupList[] = 1; - } - - response struct RemoveGroupResponse = 3 { - ENUM8 status = 0; - group_id groupID = 1; - } - - fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : BITMAP32 { @@ -1066,12 +997,6 @@ endpoint 0 { ram attribute clusterRevision default = 4; } - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index b7af38a37391f0..c41e00c3ca48d6 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -259,7 +259,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -12727,5 +12727,6 @@ "endpointId": 3, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file From 35791b38d72f384d68696e85a462e397f6f3c621 Mon Sep 17 00:00:00 2001 From: mideayanghui <106149377+mideayanghui@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:55:22 +0800 Subject: [PATCH 005/134] optimize zap for chef laundry washer (#29043) --- .../rootnode_laundrywasher_fb10d238c8.matter | 75 ------------------- .../rootnode_laundrywasher_fb10d238c8.zap | 5 +- 2 files changed, 3 insertions(+), 77 deletions(-) diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 691df7134838f0..1683218696d69e 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -79,75 +79,6 @@ server cluster Identify = 3 { command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } -/** Attributes and commands for group configuration and manipulation. */ -server cluster Groups = 4 { - bitmap Feature : BITMAP32 { - kGroupNames = 0x1; - } - - bitmap NameSupportBitmap : BITMAP8 { - kGroupNames = 0x80; - } - - readonly attribute NameSupportBitmap nameSupport = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AddGroupRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - request struct ViewGroupRequest { - group_id groupID = 0; - } - - request struct GetGroupMembershipRequest { - group_id groupList[] = 0; - } - - request struct RemoveGroupRequest { - group_id groupID = 0; - } - - request struct AddGroupIfIdentifyingRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - response struct AddGroupResponse = 0 { - ENUM8 status = 0; - group_id groupID = 1; - } - - response struct ViewGroupResponse = 1 { - ENUM8 status = 0; - group_id groupID = 1; - CHAR_STRING groupName = 2; - } - - response struct GetGroupMembershipResponse = 2 { - nullable INT8U capacity = 0; - group_id groupList[] = 1; - } - - response struct RemoveGroupResponse = 3 { - ENUM8 status = 0; - group_id groupID = 1; - } - - fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : BITMAP32 { @@ -1099,12 +1030,6 @@ endpoint 0 { ram attribute clusterRevision default = 4; } - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 4f2b6a4014c1a2..185729bcbfc1e3 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -259,7 +259,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -11081,5 +11081,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file From 80565696d6b9570cc73fb8bdb2e59e7209af3443 Mon Sep 17 00:00:00 2001 From: mideayanghui <106149377+mideayanghui@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:55:32 +0800 Subject: [PATCH 006/134] [fix] optimize zap for rootnode_dishwasher (#29042) * optimize zap for rootnode_dishwasher * fix CI error * Revert "fix CI error" This reverts commit 93a05fa19cb159badcce6bdcc23c2586e0ecc902. --- .../rootnode_dishwasher_cc105034fe.matter | 109 ------------------ .../rootnode_dishwasher_cc105034fe.zap | 9 +- 2 files changed, 5 insertions(+), 113 deletions(-) diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 5374c1f6f53af2..9b34dea09793a6 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -79,75 +79,6 @@ server cluster Identify = 3 { command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } -/** Attributes and commands for group configuration and manipulation. */ -server cluster Groups = 4 { - bitmap Feature : BITMAP32 { - kGroupNames = 0x1; - } - - bitmap NameSupportBitmap : BITMAP8 { - kGroupNames = 0x80; - } - - readonly attribute NameSupportBitmap nameSupport = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct AddGroupRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - request struct ViewGroupRequest { - group_id groupID = 0; - } - - request struct GetGroupMembershipRequest { - group_id groupList[] = 0; - } - - request struct RemoveGroupRequest { - group_id groupID = 0; - } - - request struct AddGroupIfIdentifyingRequest { - group_id groupID = 0; - CHAR_STRING groupName = 1; - } - - response struct AddGroupResponse = 0 { - ENUM8 status = 0; - group_id groupID = 1; - } - - response struct ViewGroupResponse = 1 { - ENUM8 status = 0; - group_id groupID = 1; - CHAR_STRING groupName = 2; - } - - response struct GetGroupMembershipResponse = 2 { - nullable INT8U capacity = 0; - group_id groupList[] = 1; - } - - response struct RemoveGroupResponse = 3 { - ENUM8 status = 0; - group_id groupID = 1; - } - - fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; - fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; - fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; - fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; - fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; - fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ server cluster Descriptor = 29 { bitmap Feature : BITMAP32 { @@ -178,25 +109,6 @@ server cluster Descriptor = 29 { readonly attribute int16u clusterRevision = 65533; } -/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */ -server cluster Binding = 30 { - fabric_scoped struct TargetStruct { - optional node_id node = 1; - optional group_id group = 2; - optional endpoint_no endpoint = 3; - optional cluster_id cluster = 4; - fabric_idx fabricIndex = 254; - } - - attribute TargetStruct binding[] = 0; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** The Access Control Cluster exposes a data model view of a Node's Access Control List (ACL), which codifies the rules used to manage and enforce Access Control for the Node's endpoints and their associated @@ -1120,12 +1032,6 @@ endpoint 0 { ram attribute clusterRevision default = 4; } - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -1331,12 +1237,6 @@ endpoint 1 { ram attribute clusterRevision default = 4; } - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -1349,15 +1249,6 @@ endpoint 1 { callback attribute clusterRevision default = 1; } - server cluster Binding { - callback attribute binding; - callback attribute generatedCommandList; - callback attribute acceptedCommandList; - callback attribute attributeList; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster OperationalState { emits event OperationalError; emits event OperationCompletion; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index 6f88ca3d61b5f0..bdd388535f5020 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -259,7 +259,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -6553,7 +6553,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -7863,7 +7863,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "Binding", @@ -10833,5 +10833,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file From 959ae4e89a5493c683e6ce82c9d3d8533c549ca6 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 5 Sep 2023 05:59:14 -0700 Subject: [PATCH 007/134] Add ManualCode unit tests for OnboardingPayloadParser (#29036) --- .../onboardingpayload/OnboardingPayload.kt | 16 ++++ .../chip/onboardingpayload/ManualCodeTest.kt | 75 +++++++++++++++++++ 2 files changed, 91 insertions(+) diff --git a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt index 1d6f8ab40a8aec..4d7cd01ff4a4d6 100644 --- a/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt +++ b/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt @@ -158,6 +158,22 @@ class OnboardingPayload( setupPinCode == other.setupPinCode } + override fun toString(): String { + return "OnboardingPayload(" + + "version=$version, " + + "vendorId=$vendorId, " + + "productId=$productId, " + + "commissioningFlow=$commissioningFlow, " + + "discoveryCapabilities=$discoveryCapabilities, " + + "discriminator=$discriminator, " + + "hasShortDiscriminator=$hasShortDiscriminator, " + + "setupPinCode=$setupPinCode, " + + "optionalQRCodeInfo=$optionalQRCodeInfo, " + + "optionalVendorData=$optionalVendorData, " + + "optionalExtensionData=$optionalExtensionData" + + ")" + } + fun addOptionalQRCodeInfo(info: OptionalQRCodeInfo) { optionalQRCodeInfo[info.tag] = info } diff --git a/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt b/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt index 06dca307bbfeb7..51fb0bfc0c51ac 100644 --- a/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt +++ b/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt @@ -683,4 +683,79 @@ class ManualCodeTest { productId = payload.productId ) } + + /* + * Test Parse Short Manual PairingCode to Expected Payload + */ + @Test + fun testParseShortManualPairingCodeToExpectedPayload() { + // Payload: MT:W0GU2OTB00KA0648G00 + // Setup Pin Code: 20202021 + // Setup Discriminator: 15 + + val parser = OnboardingPayloadParser() + assertThat(parser.parseManualPairingCode("34970112332")) + .isEqualTo( + OnboardingPayload( + discriminator = 15, + setupPinCode = 20202021, + version = 0, + vendorId = 0, + productId = 0, + hasShortDiscriminator = true, + commissioningFlow = CommissioningFlow.STANDARD.value, + discoveryCapabilities = mutableSetOf(), + ) + ) + } + + /* + * Test Parse Long Manual PairingCode to Expected Payload + */ + @Test + fun testParseLongManualPairingCodeToExpectedPayload() { + // Payload: MT:W0GU2OTB00KA0648G00 + // Vendor Id: 9050 (0x235A) + // Product Id: 17729 (0x4541) + // Setup Pin Code: 20202021 + // Setup Discriminator: 15 + + val parser = OnboardingPayloadParser() + assertThat(parser.parseManualPairingCode("749701123309050177298")) + .isEqualTo( + OnboardingPayload( + discriminator = 15, + setupPinCode = 20202021, + version = 0, + vendorId = 0x235A, + productId = 0x4541, + hasShortDiscriminator = true, + commissioningFlow = CommissioningFlow.CUSTOM.value, + discoveryCapabilities = mutableSetOf(), + ) + ) + } + + /* + * Test Generate Manual PairingCode to Expected Payload + */ + @Test + fun testGenerateManualPairingCodetoExpectedPayload() { + val parser = OnboardingPayloadParser() + assertThat( + parser.getManualPairingCodeFromPayload( + OnboardingPayload( + discriminator = 15, + setupPinCode = 20202021, + version = 0, + vendorId = 0x235A, + productId = 0x4541, + hasShortDiscriminator = true, + commissioningFlow = CommissioningFlow.CUSTOM.value, + discoveryCapabilities = mutableSetOf(), + ) + ) + ) + .isEqualTo("749701123309050177298") + } } From c8361b5bbae092c5de3fa457094197dd87b396d2 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Tue, 5 Sep 2023 21:10:09 +0800 Subject: [PATCH 008/134] ESP32: Update esp-idf to v5.1.1 release (#28980) * ESP32: Update esp-idf to v5.1.1 release * Restyled by prettier-markdown --------- Co-authored-by: Restyled.io --- docs/guides/esp32/setup_idf_chip.md | 12 ++++++------ examples/all-clusters-app/esp32/partitions.csv | 1 - examples/all-clusters-app/esp32/sdkconfig.defaults | 3 +++ .../all-clusters-minimal-app/esp32/partitions.csv | 1 - .../esp32/sdkconfig.defaults | 3 +++ examples/bridge-app/esp32/sdkconfig.defaults | 3 +++ examples/chef/esp32/sdkconfig.defaults | 3 +++ examples/light-switch-app/esp32/sdkconfig.defaults | 3 +++ examples/lighting-app/esp32/partitions_h2.csv | 9 --------- examples/lighting-app/esp32/sdkconfig.defaults | 3 +++ .../lighting-app/esp32/sdkconfig.defaults.esp32h2 | 2 +- examples/lock-app/esp32/sdkconfig.defaults | 3 +++ examples/ota-provider-app/esp32/sdkconfig.defaults | 3 +++ examples/ota-requestor-app/esp32/sdkconfig.defaults | 3 +++ examples/pigweed-app/esp32/sdkconfig.defaults | 3 +++ .../esp32/sdkconfig.defaults | 3 +++ integrations/docker/images/base/chip-build/version | 2 +- .../images/stage-2/chip-build-esp32/Dockerfile | 2 +- 18 files changed, 42 insertions(+), 20 deletions(-) delete mode 100644 examples/lighting-app/esp32/partitions_h2.csv diff --git a/docs/guides/esp32/setup_idf_chip.md b/docs/guides/esp32/setup_idf_chip.md index 66f6931192cca3..900bfc170b5dea 100644 --- a/docs/guides/esp32/setup_idf_chip.md +++ b/docs/guides/esp32/setup_idf_chip.md @@ -16,22 +16,22 @@ step. - [Linux](https://docs.espressif.com/projects/esp-idf/en/v5.1/esp32/get-started/linux-macos-setup.html#for-linux-users) - [macOS](https://docs.espressif.com/projects/esp-idf/en/v5.1/esp32/get-started/linux-macos-setup.html#for-macos-users) -### Get IDF v5.1 +### Get IDF v5.1.1 -- Clone ESP-IDF - [v5.1 release](https://github.com/espressif/esp-idf/releases/tag/v5.1) +- Clone ESP-IDF [v5.1.1 + release](https://github.com/espressif/esp-idf/releases/tag/v5.1.1 ``` - git clone -b v5.1 --recursive --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git + git clone -b v5.1.1 --recursive --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git cd esp-idf ./install.sh ``` -- To update an existing esp-idf toolchain to v5.1: +- To update an existing esp-idf toolchain to v5.1.1: ``` cd path/to/esp-idf - git fetch --depth 1 origin v5.1 + git fetch --depth 1 origin v5.1.1 git reset --hard FETCH_HEAD git submodule update --depth 1 --recursive --init diff --git a/examples/all-clusters-app/esp32/partitions.csv b/examples/all-clusters-app/esp32/partitions.csv index 47172e25774ebb..530cbadc617136 100644 --- a/examples/all-clusters-app/esp32/partitions.csv +++ b/examples/all-clusters-app/esp32/partitions.csv @@ -5,4 +5,3 @@ otadata, data, ota, , 0x2000, phy_init, data, phy, , 0x1000, ota_0, app, ota_0, , 1900K, ota_1, app, ota_1, , 1900K, -ot_storage, data, 0x3a, , 0x2000, diff --git a/examples/all-clusters-app/esp32/sdkconfig.defaults b/examples/all-clusters-app/esp32/sdkconfig.defaults index c3b10929d4120d..08fcf94d8ca928 100644 --- a/examples/all-clusters-app/esp32/sdkconfig.defaults +++ b/examples/all-clusters-app/esp32/sdkconfig.defaults @@ -69,3 +69,6 @@ CONFIG_RMT_SUPPRESS_DEPRECATE_WARN=y # Move functions from IRAM to flash CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/all-clusters-minimal-app/esp32/partitions.csv b/examples/all-clusters-minimal-app/esp32/partitions.csv index 47172e25774ebb..530cbadc617136 100644 --- a/examples/all-clusters-minimal-app/esp32/partitions.csv +++ b/examples/all-clusters-minimal-app/esp32/partitions.csv @@ -5,4 +5,3 @@ otadata, data, ota, , 0x2000, phy_init, data, phy, , 0x1000, ota_0, app, ota_0, , 1900K, ota_1, app, ota_1, , 1900K, -ot_storage, data, 0x3a, , 0x2000, diff --git a/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults b/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults index fda02fbf7c9bae..c551c966de34ec 100644 --- a/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults +++ b/examples/all-clusters-minimal-app/esp32/sdkconfig.defaults @@ -69,3 +69,6 @@ CONFIG_MBEDTLS_HKDF_C=y # Move functions from IRAM to flash CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/bridge-app/esp32/sdkconfig.defaults b/examples/bridge-app/esp32/sdkconfig.defaults index bc364e144359d3..c92a558df8491b 100644 --- a/examples/bridge-app/esp32/sdkconfig.defaults +++ b/examples/bridge-app/esp32/sdkconfig.defaults @@ -48,3 +48,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/chef/esp32/sdkconfig.defaults b/examples/chef/esp32/sdkconfig.defaults index bd714ab0202833..327e0d2538f022 100644 --- a/examples/chef/esp32/sdkconfig.defaults +++ b/examples/chef/esp32/sdkconfig.defaults @@ -62,3 +62,6 @@ CONFIG_MBEDTLS_HKDF_C=y # IRAM optimizations CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/light-switch-app/esp32/sdkconfig.defaults b/examples/light-switch-app/esp32/sdkconfig.defaults index e392501a531a67..d0e507742a2f64 100644 --- a/examples/light-switch-app/esp32/sdkconfig.defaults +++ b/examples/light-switch-app/esp32/sdkconfig.defaults @@ -55,3 +55,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/lighting-app/esp32/partitions_h2.csv b/examples/lighting-app/esp32/partitions_h2.csv deleted file mode 100644 index 16a8b0f7453040..00000000000000 --- a/examples/lighting-app/esp32/partitions_h2.csv +++ /dev/null @@ -1,9 +0,0 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap -nvs, data, nvs, , 0xC000, -otadata, data, ota, , 0x2000, -phy_init, data, phy, , 0x1000, -ota_0, app, ota_0, , 1500K, -ota_1, app, ota_1, , 1500K, -fctry, data, nvs, , 0x6000, -ot_storage,data, fat, , 0x6000, diff --git a/examples/lighting-app/esp32/sdkconfig.defaults b/examples/lighting-app/esp32/sdkconfig.defaults index f87a164ae41dd2..a8833c13a1a23b 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults +++ b/examples/lighting-app/esp32/sdkconfig.defaults @@ -61,3 +61,6 @@ CONFIG_MBEDTLS_HKDF_C=y # Disable Read Client CONFIG_DISABLE_READ_CLIENT=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 b/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 index d5f98fc81d2393..11d5991c353b20 100644 --- a/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 +++ b/examples/lighting-app/esp32/sdkconfig.defaults.esp32h2 @@ -38,7 +38,7 @@ CONFIG_LWIP_IPV6_AUTOCONFIG=n # Use a custom partition table CONFIG_PARTITION_TABLE_CUSTOM=y -CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_h2.csv" +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" # LwIP config for OpenThread CONFIG_LWIP_IPV6_NUM_ADDRESSES=8 diff --git a/examples/lock-app/esp32/sdkconfig.defaults b/examples/lock-app/esp32/sdkconfig.defaults index 29b42045b60791..4755d2e29635a8 100644 --- a/examples/lock-app/esp32/sdkconfig.defaults +++ b/examples/lock-app/esp32/sdkconfig.defaults @@ -52,3 +52,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/ota-provider-app/esp32/sdkconfig.defaults b/examples/ota-provider-app/esp32/sdkconfig.defaults index 9c1ccf088c9592..6a06f08a0d51fb 100644 --- a/examples/ota-provider-app/esp32/sdkconfig.defaults +++ b/examples/ota-provider-app/esp32/sdkconfig.defaults @@ -67,3 +67,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/ota-requestor-app/esp32/sdkconfig.defaults b/examples/ota-requestor-app/esp32/sdkconfig.defaults index b994220206e218..b4629c26d79412 100644 --- a/examples/ota-requestor-app/esp32/sdkconfig.defaults +++ b/examples/ota-requestor-app/esp32/sdkconfig.defaults @@ -68,3 +68,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/pigweed-app/esp32/sdkconfig.defaults b/examples/pigweed-app/esp32/sdkconfig.defaults index 8a5033a3f6f3b1..6090ca73d6c3f7 100644 --- a/examples/pigweed-app/esp32/sdkconfig.defaults +++ b/examples/pigweed-app/esp32/sdkconfig.defaults @@ -45,3 +45,6 @@ CONFIG_DEVICE_PRODUCT_ID=0x800B CONFIG_MBEDTLS_HKDF_C=y CONFIG_DIAG_USE_EXTERNAL_LOG_WRAP=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/examples/temperature-measurement-app/esp32/sdkconfig.defaults b/examples/temperature-measurement-app/esp32/sdkconfig.defaults index 33c86a9673b901..81070fbfddb449 100644 --- a/examples/temperature-measurement-app/esp32/sdkconfig.defaults +++ b/examples/temperature-measurement-app/esp32/sdkconfig.defaults @@ -93,3 +93,6 @@ CONFIG_ESP_WIFI_SOFTAP_SUPPORT=n # Enable HKDF in mbedtls CONFIG_MBEDTLS_HKDF_C=y + +# Increase LwIP IPv6 address number +CONFIG_LWIP_IPV6_NUM_ADDRESSES=6 diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index bd451da8a19808..23c2b67d803b65 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -10 : [Telink] Update Docker image (Zephyr update) +11 : [ESP32] Update IDF to release v5.1.1 diff --git a/integrations/docker/images/stage-2/chip-build-esp32/Dockerfile b/integrations/docker/images/stage-2/chip-build-esp32/Dockerfile index 65f4eaf4a5a572..a5f01eb0c340eb 100644 --- a/integrations/docker/images/stage-2/chip-build-esp32/Dockerfile +++ b/integrations/docker/images/stage-2/chip-build-esp32/Dockerfile @@ -11,7 +11,7 @@ RUN set -x \ && : # last line RUN set -x \ - && git clone --recursive -b v5.1 --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git /tmp/esp-idf \ + && git clone --recursive -b v5.1.1 --depth 1 --shallow-submodule https://github.com/espressif/esp-idf.git /tmp/esp-idf \ && : # last line FROM ghcr.io/project-chip/chip-build:${VERSION} From 09ed308d122eae991e9e0df79313e2c7553b9972 Mon Sep 17 00:00:00 2001 From: Wang Qixiang <43193572+wqx6@users.noreply.github.com> Date: Tue, 5 Sep 2023 22:06:30 +0800 Subject: [PATCH 009/134] ESP32: Enable BLE Deinit for ESP32H2 after successful commissioning (#28865) --- .../esp32/common/CommonDeviceCallbacks.cpp | 56 +----------------- .../platform/esp32/common/Esp32AppServer.cpp | 58 +++++++++++++++++++ .../platform/esp32/common/Esp32AppServer.h | 1 + src/platform/ESP32/OpenthreadLauncher.c | 15 ++++- src/platform/ESP32/OpenthreadLauncher.h | 2 +- src/platform/ESP32/nimble/BLEManagerImpl.cpp | 15 ----- 6 files changed, 75 insertions(+), 72 deletions(-) diff --git a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp index eddb61524c0a74..0830c49a478cc3 100644 --- a/examples/platform/esp32/common/CommonDeviceCallbacks.cpp +++ b/examples/platform/esp32/common/CommonDeviceCallbacks.cpp @@ -16,18 +16,7 @@ * limitations under the License. */ #include "CommonDeviceCallbacks.h" - -#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -#if CONFIG_BT_ENABLED -#include "esp_bt.h" -#if CONFIG_BT_NIMBLE_ENABLED -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) -#include "esp_nimble_hci.h" -#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) -#include "nimble/nimble_port.h" -#endif // CONFIG_BT_NIMBLE_ENABLED -#endif // CONFIG_BT_ENABLED -#endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include "Esp32AppServer.h" #include "esp_err.h" #include "esp_heap_caps.h" @@ -62,48 +51,7 @@ void CommonDeviceCallbacks::DeviceEventCallback(const ChipDeviceEvent * event, i case DeviceEventType::kCHIPoBLEConnectionClosed: ESP_LOGI(TAG, "CHIPoBLE disconnected"); - -#if CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING - if (chip::Server::GetInstance().GetFabricTable().FabricCount() > 0) - { - esp_err_t err = ESP_OK; - -#if CONFIG_BT_NIMBLE_ENABLED - if (!ble_hs_is_enabled()) - { - ESP_LOGI(TAG, "BLE already deinited"); - break; - } - if (nimble_port_stop() != 0) - { - ESP_LOGE(TAG, "nimble_port_stop() failed"); - break; - } - vTaskDelay(100); - nimble_port_deinit(); - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) - err = esp_nimble_hci_and_controller_deinit(); -#endif -#endif /* CONFIG_BT_NIMBLE_ENABLED */ - -#if CONFIG_IDF_TARGET_ESP32 - err |= esp_bt_mem_release(ESP_BT_MODE_BTDM); -#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 - err |= esp_bt_mem_release(ESP_BT_MODE_BLE); -#endif - - if (err != ESP_OK) - { - ESP_LOGE(TAG, "BLE deinit failed"); - } - else - { - ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed"); - } - } -#endif /* CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */ - + Esp32AppServer::DeInitBLEIfCommissioned(); break; case DeviceEventType::kDnssdInitialized: diff --git a/examples/platform/esp32/common/Esp32AppServer.cpp b/examples/platform/esp32/common/Esp32AppServer.cpp index db787d09867b68..8baafcb458a2d7 100644 --- a/examples/platform/esp32/common/Esp32AppServer.cpp +++ b/examples/platform/esp32/common/Esp32AppServer.cpp @@ -27,6 +27,19 @@ #if CONFIG_ENABLE_ICD_SERVER #include #endif + +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#if CONFIG_BT_ENABLED +#include "esp_bt.h" +#if CONFIG_BT_NIMBLE_ENABLED +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) +#include "esp_nimble_hci.h" +#endif // ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) +#include "nimble/nimble_port.h" +#endif // CONFIG_BT_NIMBLE_ENABLED +#endif // CONFIG_BT_ENABLED +#endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + #include using namespace chip; @@ -100,6 +113,50 @@ static size_t hex_string_to_binary(const char * hex_string, uint8_t * buf, size_ } #endif // CONFIG_TEST_EVENT_TRIGGER_ENABLED +void Esp32AppServer::DeInitBLEIfCommissioned(void) +{ +#if CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING + if (chip::Server::GetInstance().GetFabricTable().FabricCount() > 0) + { + esp_err_t err = ESP_OK; + +#if CONFIG_BT_NIMBLE_ENABLED + if (!ble_hs_is_enabled()) + { + ESP_LOGI(TAG, "BLE already deinited"); + return; + } + if (nimble_port_stop() != 0) + { + ESP_LOGE(TAG, "nimble_port_stop() failed"); + return; + } + vTaskDelay(100); + nimble_port_deinit(); + +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) + err = esp_nimble_hci_and_controller_deinit(); +#endif +#endif /* CONFIG_BT_NIMBLE_ENABLED */ + +#if CONFIG_IDF_TARGET_ESP32 + err |= esp_bt_mem_release(ESP_BT_MODE_BTDM); +#elif CONFIG_IDF_TARGET_ESP32C2 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32H2 + err |= esp_bt_mem_release(ESP_BT_MODE_BLE); +#endif + + if (err != ESP_OK) + { + ESP_LOGE(TAG, "BLE deinit failed"); + } + else + { + ESP_LOGI(TAG, "BLE deinit successful and memory reclaimed"); + } + } +#endif /* CONFIG_BT_ENABLED && CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */ +} + void Esp32AppServer::Init(AppDelegate * sAppDelegate) { // Init ZCL Data Model and CHIP App Server @@ -136,4 +193,5 @@ void Esp32AppServer::Init(AppDelegate * sAppDelegate) chip::app::DnssdServer::Instance().StartServer(); } #endif + DeInitBLEIfCommissioned(); } diff --git a/examples/platform/esp32/common/Esp32AppServer.h b/examples/platform/esp32/common/Esp32AppServer.h index 7b1598cca5a57e..b09aa1fef972f0 100644 --- a/examples/platform/esp32/common/Esp32AppServer.h +++ b/examples/platform/esp32/common/Esp32AppServer.h @@ -22,5 +22,6 @@ #include namespace Esp32AppServer { +void DeInitBLEIfCommissioned(void); void Init(AppDelegate * context = nullptr); } // namespace Esp32AppServer diff --git a/src/platform/ESP32/OpenthreadLauncher.c b/src/platform/ESP32/OpenthreadLauncher.c index 7183767016bb89..4eaa674e4d8c48 100644 --- a/src/platform/ESP32/OpenthreadLauncher.c +++ b/src/platform/ESP32/OpenthreadLauncher.c @@ -55,9 +55,18 @@ static void ot_task_worker(void * context) vTaskDelete(NULL); } -void set_openthread_platform_config(esp_openthread_platform_config_t * config) +esp_err_t set_openthread_platform_config(esp_openthread_platform_config_t * config) { - s_platform_config = config; + if (!s_platform_config) + { + s_platform_config = (esp_openthread_platform_config_t *) malloc(sizeof(esp_openthread_platform_config_t)); + if (!s_platform_config) + { + return ESP_ERR_NO_MEM; + } + } + memcpy(s_platform_config, config, sizeof(esp_openthread_platform_config_t)); + return ESP_OK; } esp_err_t openthread_init_stack(void) @@ -77,6 +86,8 @@ esp_err_t openthread_init_stack(void) ESP_ERROR_CHECK(esp_openthread_init(s_platform_config)); // Initialize the esp_netif bindings openthread_netif = init_openthread_netif(s_platform_config); + free(s_platform_config); + s_platform_config = NULL; return ESP_OK; } diff --git a/src/platform/ESP32/OpenthreadLauncher.h b/src/platform/ESP32/OpenthreadLauncher.h index 6817a4dc5afb80..a7f4ef02747eb2 100644 --- a/src/platform/ESP32/OpenthreadLauncher.h +++ b/src/platform/ESP32/OpenthreadLauncher.h @@ -24,7 +24,7 @@ extern "C" { #endif -void set_openthread_platform_config(esp_openthread_platform_config_t * config); +esp_err_t set_openthread_platform_config(esp_openthread_platform_config_t * config); esp_err_t openthread_init_stack(void); esp_err_t openthread_launch_task(void); diff --git a/src/platform/ESP32/nimble/BLEManagerImpl.cpp b/src/platform/ESP32/nimble/BLEManagerImpl.cpp index 6a9a047ab84db1..d62e5530823af0 100644 --- a/src/platform/ESP32/nimble/BLEManagerImpl.cpp +++ b/src/platform/ESP32/nimble/BLEManagerImpl.cpp @@ -211,21 +211,6 @@ void HandleIncomingBleConnection(BLEEndPoint * bleEP) CHIP_ERROR BLEManagerImpl::_Init() { -#if CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - if (ConnectivityMgr().IsThreadProvisioned()) - { - ESP_LOGI(TAG, "Thread credentials already provisioned, not initializing BLE"); -#else - if (ConnectivityMgr().IsWiFiStationProvisioned()) - { - ESP_LOGI(TAG, "WiFi station already provisioned, not initializing BLE"); -#endif /* CHIP_DEVICE_CONFIG_ENABLE_THREAD */ - esp_bt_mem_release(ESP_BT_MODE_BTDM); - return CHIP_NO_ERROR; - } -#endif /* CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING */ - CHIP_ERROR err; // Initialize the Chip BleLayer. From c68cc7907aa5c8d2e348bf5c4503a7633893956c Mon Sep 17 00:00:00 2001 From: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:34:34 +0530 Subject: [PATCH 010/134] Setting the flag correctly in the callback (#29047) --- examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c index 22032e33f4a928..8f738e36159dc6 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c @@ -162,6 +162,7 @@ int32_t wfx_rsi_disconnect() sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t result_length, void * arg) { + wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING); temp_reset = (wfx_wifi_scan_ext_t *) malloc(sizeof(wfx_wifi_scan_ext_t)); memset(temp_reset, 0, sizeof(wfx_wifi_scan_ext_t)); if (CHECK_IF_EVENT_FAILED(event)) @@ -169,7 +170,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t SILABS_LOG("F: Join Event received with %u bytes payload\n", result_length); callback_status = *(sl_status_t *) result; wfx_rsi.join_retries += 1; - wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED); + wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTED); wfx_retry_interval_handler(is_wifi_disconnection_event, wfx_rsi.join_retries++); if (is_wifi_disconnection_event || wfx_rsi.join_retries <= WFX_RSI_CONFIG_MAX_JOIN) { From e543e10f9407759e79045ae8dcb27ca34ee48c58 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Tue, 5 Sep 2023 08:05:26 -0700 Subject: [PATCH 011/134] Add unit tests for OnboardingPayloadParser (#29030) --- .../chip/onboardingpayload/QRCodeTest.kt | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt b/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt index 1f854758f18951..afbfdd0e3e477d 100644 --- a/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt +++ b/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt @@ -315,6 +315,60 @@ class QRCodeTest { assertEquals("ABC", QRCodeOnboardingPayloadParser.extractPayload("%MT:ABC")) } + /* + * Test Parse QrCode to Expected Payload + */ + @Test + fun testParseQrCodeToExpectedPayload() { + // Payload: MT:W0GU2OTB00KA0648G00 + // Vendor Id: 9050 (0x235A) + // Product Id: 20043 (0x4E4B) + // Setup Pin Code: 20202021 + // Setup Discriminator: 3840 (0xF00) + + val parser = OnboardingPayloadParser() + assertThat(parser.parseQrCode("MT:W0GU2OTB00KA0648G00")) + .isEqualTo( + OnboardingPayload( + discriminator = 0xF00, + setupPinCode = 20202021, + version = 0, + vendorId = 0x235A, + productId = 0x4E4B, + commissioningFlow = CommissioningFlow.STANDARD.value, + discoveryCapabilities = mutableSetOf(DiscoveryCapability.BLE), + ) + ) + } + + /* + * Test Generate QrCode from Expected Value + */ + @Test + fun testGenerateQrCodeFromExpectedValue() { + // Payload: MT:W0GU2OTB00KA0648G00 + // Vendor Id: 9050 (0x235A) + // Product Id: 20043 (0x4E4B) + // Setup Pin Code: 20202021 + // Setup Discriminator: 3840 (0xF00) + + val parser = OnboardingPayloadParser() + assertThat( + parser.getQrCodeFromPayload( + OnboardingPayload( + discriminator = 0xF00, + setupPinCode = 20202021, + version = 0, + vendorId = 0x235A, + productId = 0x4E4B, + commissioningFlow = CommissioningFlow.STANDARD.value, + discoveryCapabilities = mutableSetOf(DiscoveryCapability.BLE), + ) + ) + ) + .isEqualTo("MT:W0GU2OTB00KA0648G00") + } + companion object { const val kDefaultPayloadQRCode: String = "MT:M5L90MP500K64J00000" } From 72cf01097f938b7d68609d1a6e6aae9fdfe950c6 Mon Sep 17 00:00:00 2001 From: nekleo <96453741+nekleo@users.noreply.github.com> Date: Tue, 5 Sep 2023 08:07:43 -0700 Subject: [PATCH 012/134] [Chef] Add pump device type with optional clusters enabled (#28995) * Add pump device type with optional clusters enabled to chef * Regenerated matter file --- .../devices/rootnode_pump_5f904818cc.matter | 1319 +++ .../chef/devices/rootnode_pump_5f904818cc.zap | 8307 +++++++++++++++++ 2 files changed, 9626 insertions(+) create mode 100644 examples/chef/devices/rootnode_pump_5f904818cc.matter create mode 100644 examples/chef/devices/rootnode_pump_5f904818cc.zap diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter new file mode 100644 index 00000000000000..ab82d2f670c300 --- /dev/null +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -0,0 +1,1319 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; +} + +struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; +} + +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : ENUM8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : ENUM8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : ENUM8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + INT16U identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** Attributes and commands for switching devices between 'On' and 'Off' states. */ +server cluster OnOff = 6 { + enum OnOffDelayedAllOffEffectVariant : ENUM8 { + kFadeToOffIn0p8Seconds = 0; + kNoFade = 1; + k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2; + } + + enum OnOffDyingLightEffectVariant : ENUM8 { + k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0; + } + + enum OnOffEffectIdentifier : ENUM8 { + kDelayedAllOff = 0; + kDyingLight = 1; + } + + enum OnOffStartUpOnOff : ENUM8 { + kOff = 0; + kOn = 1; + kTogglePreviousOnOff = 2; + } + + bitmap Feature : BITMAP32 { + kLighting = 0x1; + kDeadFront = 0x2; + } + + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; + } + + readonly nosubscribe attribute boolean onOff = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command Off(): DefaultSuccess = 0; + command On(): DefaultSuccess = 1; + command Toggle(): DefaultSuccess = 2; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : BITMAP32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute CLUSTER_ID serverList[] = 1; + readonly attribute CLUSTER_ID clientList[] = 2; + readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : ENUM8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : ENUM8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : ENUM8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : ENUM8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + INT32U softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +server cluster LocalizationConfiguration = 43 { + attribute char_string<35> activeLocale = 0; + readonly attribute CHAR_STRING supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +server cluster TimeFormatLocalization = 44 { + enum CalendarTypeEnum : ENUM8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + } + + enum HourFormatEnum : ENUM8 { + k12hr = 0; + k24hr = 1; + } + + bitmap Feature : BITMAP32 { + kCalendarFormat = 0x1; + } + + attribute HourFormatEnum hourFormat = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for the units in which values are conveyed in communication to a + user. As such, Nodes that visually or audibly convey measurable values to the user need a + mechanism by which they can be configured to use a user’s preferred unit. */ +server cluster UnitLocalization = 45 { + enum TempUnitEnum : ENUM8 { + kFahrenheit = 0; + kCelsius = 1; + kKelvin = 2; + } + + bitmap Feature : BITMAP32 { + kTemperatureUnit = 0x1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : ENUM8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : ENUM8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + INT16U expiryLengthSeconds = 0; + INT64U breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + CHAR_STRING countryCode = 1; + INT64U breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : ENUM8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : ENUM8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : BITMAP32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap WiFiSecurityBitmap : BITMAP8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable OCTET_STRING<32> ssid = 0; + optional INT64U breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + OCTET_STRING<32> ssid = 0; + OCTET_STRING<64> credentials = 1; + optional INT64U breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + OCTET_STRING<254> operationalDataset = 0; + optional INT64U breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING<512> debugText = 1; + optional INT8U networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : ENUM8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : ENUM8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : ENUM8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : ENUM8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : ENUM8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + OCTET_STRING<16> enableKey = 0; + INT64U eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : ENUM8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : ENUM8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + OCTET_STRING PAKEPasscodeVerifier = 1; + INT16U discriminator = 2; + INT32U iterations = 3; + OCTET_STRING salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : ENUM8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : ENUM8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute OCTET_STRING trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + OCTET_STRING attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + OCTET_STRING CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + OCTET_STRING IPKValue = 2; + Int64u caseAdminSubject = 3; + VENDOR_ID adminVendorId = 4; + } + + request struct UpdateNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + CHAR_STRING<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + OCTET_STRING rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : ENUM8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : BITMAP32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + INT16U groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + INT16U groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + INT16U groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** An interface for configuring and controlling pumps. */ +server cluster PumpConfigurationAndControl = 512 { + enum ControlModeEnum : ENUM8 { + kConstantSpeed = 0; + kConstantPressure = 1; + kProportionalPressure = 2; + kConstantFlow = 3; + kConstantTemperature = 5; + kAutomatic = 7; + } + + enum OperationModeEnum : ENUM8 { + kNormal = 0; + kMinimum = 1; + kMaximum = 2; + kLocal = 3; + } + + bitmap Feature : BITMAP32 { + kConstantPressure = 0x1; + kCompensatedPressure = 0x2; + kConstantFlow = 0x4; + kConstantSpeed = 0x8; + kConstantTemperature = 0x10; + kAutomatic = 0x20; + kLocalOperation = 0x40; + } + + bitmap PumpStatusBitmap : BITMAP16 { + kDeviceFault = 0x1; + kSupplyfault = 0x2; + kSpeedLow = 0x4; + kSpeedHigh = 0x8; + kLocalOverride = 0x10; + kRunning = 0x20; + kRemotePressure = 0x40; + kRemoteFlow = 0x80; + kRemoteTemperature = 0x100; + } + + info event SupplyVoltageLow = 0 { + } + + info event SupplyVoltageHigh = 1 { + } + + info event PowerMissingPhase = 2 { + } + + info event SystemPressureLow = 3 { + } + + info event SystemPressureHigh = 4 { + } + + critical event DryRunning = 5 { + } + + info event MotorTemperatureHigh = 6 { + } + + critical event PumpMotorFatalFailure = 7 { + } + + info event ElectronicTemperatureHigh = 8 { + } + + critical event PumpBlocked = 9 { + } + + info event SensorFailure = 10 { + } + + info event ElectronicNonFatalFailure = 11 { + } + + critical event ElectronicFatalFailure = 12 { + } + + info event GeneralFault = 13 { + } + + info event Leakage = 14 { + } + + info event AirDetection = 15 { + } + + info event TurbineOperation = 16 { + } + + readonly attribute nullable int16s maxPressure = 0; + readonly attribute nullable int16u maxSpeed = 1; + readonly attribute nullable int16u maxFlow = 2; + readonly attribute nullable int16s minConstTemp = 11; + readonly attribute nullable int16s maxConstTemp = 12; + readonly attribute PumpStatusBitmap pumpStatus = 16; + readonly attribute OperationModeEnum effectiveOperationMode = 17; + readonly attribute ControlModeEnum effectiveControlMode = 18; + readonly nosubscribe attribute nullable int16s capacity = 19; + readonly attribute nullable int16u speed = 20; + attribute access(write: manage) OperationModeEnum operationMode = 32; + attribute access(write: manage) ControlModeEnum controlMode = 33; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for configuring the measurement of temperature, and reporting temperature measurements. */ +server cluster TemperatureMeasurement = 1026 { + readonly attribute nullable int16s measuredValue = 0; + readonly attribute nullable int16s minMeasuredValue = 1; + readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for configuring the measurement of pressure, and reporting pressure measurements. */ +server cluster PressureMeasurement = 1027 { + bitmap Feature : BITMAP32 { + kExtended = 0x1; + } + + readonly attribute nullable int16s measuredValue = 0; + readonly attribute nullable int16s minMeasuredValue = 1; + readonly attribute nullable int16s maxMeasuredValue = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for configuring the measurement of flow, and reporting flow measurements. */ +server cluster FlowMeasurement = 1028 { + readonly attribute nullable int16u measuredValue = 0; + readonly attribute nullable int16u minMeasuredValue = 1; + readonly attribute nullable int16u maxMeasuredValue = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 2; + } + + server cluster AccessControl { + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + callback attribute dataModelRevision default = 17; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute capabilityMinima; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster LocalizationConfiguration { + ram attribute activeLocale; + callback attribute supportedLocales; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UnitLocalization { + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralDiagnostics { + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute testEventTriggersEnabled default = false; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_pump = 771, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + } + + server cluster OnOff { + ram attribute onOff default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 5; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster PumpConfigurationAndControl { + ram attribute maxPressure default = 32767; + ram attribute maxSpeed default = 65534; + ram attribute maxFlow default = 65534; + ram attribute minConstTemp default = 0; + ram attribute maxConstTemp default = 10000; + ram attribute pumpStatus default = 5; + ram attribute effectiveOperationMode default = 0; + ram attribute effectiveControlMode default = 5; + ram attribute capacity; + ram attribute speed default = 1000; + ram attribute operationMode default = 0; + ram attribute controlMode default = 5; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + } + + server cluster TemperatureMeasurement { + ram attribute measuredValue default = 6000; + ram attribute minMeasuredValue default = -27315; + ram attribute maxMeasuredValue default = 32767; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster PressureMeasurement { + ram attribute measuredValue default = 4500; + ram attribute minMeasuredValue default = -32767; + ram attribute maxMeasuredValue default = 32767; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster FlowMeasurement { + ram attribute measuredValue default = 50; + ram attribute minMeasuredValue default = 0; + ram attribute maxMeasuredValue default = 65534; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} + + diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap new file mode 100644 index 00000000000000..bd00cd5534b9fa --- /dev/null +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -0,0 +1,8307 @@ +{ + "featureLevel": 97, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "id": 2, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "id": 2, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceTypeRefs": [ + 2 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "switch type", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "switch actions", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "17", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ProductAppearance", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "ProductAppearanceStruct", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OTAUpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RetrieveLogsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "PHYRate", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PHYRateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FullDuplex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketRxCount", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketTxCount", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCount", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CollisionCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CarrierDetect", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TimeSinceReset", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NumberOfPositions", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPosition", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "id": 14, + "code": 771, + "profileId": 2457, + "label": "MA-pump", + "name": "MA-pump" + }, + "deviceTypes": [ + { + "id": 14, + "code": 771, + "profileId": 2457, + "label": "MA-pump", + "name": "MA-pump" + } + ], + "deviceTypeRefs": [ + 14 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 771 + ], + "deviceTypeName": "MA-pump", + "deviceTypeCode": 771, + "deviceTypeProfileId": 2457, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GlobalSceneControl", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTime", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffWaitTime", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpOnOff", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "OnOffStartUpOnOff", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Pump Configuration and Control", + "code": 512, + "mfgCode": null, + "define": "PUMP_CONFIGURATION_AND_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Pump Configuration and Control", + "code": 512, + "mfgCode": null, + "define": "PUMP_CONFIGURATION_AND_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MaxPressure", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "32767", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxSpeed", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "65534", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxFlow", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "65534", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinConstPressure", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxConstPressure", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinCompPressure", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxCompPressure", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinConstSpeed", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxConstSpeed", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinConstFlow", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxConstFlow", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinConstTemp", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxConstTemp", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "10000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PumpStatus", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "PumpStatusBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EffectiveOperationMode", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "OperationModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EffectiveControlMode", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "ControlModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Capacity", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Speed", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LifetimeRunningHours", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Power", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int24u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LifetimeEnergyConsumed", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationMode", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "OperationModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ControlMode", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "ControlModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMPERATURE_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMPERATURE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "-27315", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "32767", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Pressure Measurement", + "code": 1027, + "mfgCode": null, + "define": "PRESSURE_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Pressure Measurement", + "code": 1027, + "mfgCode": null, + "define": "PRESSURE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4500", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "-32767", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "32767", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScaledValue", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinScaledValue", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxScaledValue", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScaledTolerance", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Scale", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Flow Measurement", + "code": 1028, + "mfgCode": null, + "define": "FLOW_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Flow Measurement", + "code": 1028, + "mfgCode": null, + "define": "FLOW_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "50", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "65534", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 2457, + "endpointId": 1, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file From 2e9c162e8048b839fd9780840b0d1a9d4e541959 Mon Sep 17 00:00:00 2001 From: joonhaengHeo <85541460+joonhaengHeo@users.noreply.github.com> Date: Wed, 6 Sep 2023 01:11:02 +0900 Subject: [PATCH 013/134] Fix Android Commissioning Crash (#29063) --- src/lib/support/JniReferences.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index 6ad7e26d215409..36f6b98e7e8a6a 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -84,12 +84,13 @@ CHIP_ERROR JniReferences::GetClassRef(JNIEnv * env, const char * clsType, jclass if (strcmp(clsType, "java/util/Optional") == 0) { cls = env->FindClass("j$/util/Optional"); + env->ExceptionClear(); } if (cls == nullptr) { - env->ExceptionClear(); cls = env->FindClass(clsType); + env->ExceptionClear(); } if (cls == nullptr) From e81a7fe57eedeb7527cdd3095fc202c018ecd5ea Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 5 Sep 2023 18:49:00 +0200 Subject: [PATCH 014/134] [Tizen] Exclude *.map file from test runner ISO (#29072) --- src/test_driver/tizen/chip_tests/BUILD.gn | 1 + third_party/tizen/tizen_sdk.gni | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/test_driver/tizen/chip_tests/BUILD.gn b/src/test_driver/tizen/chip_tests/BUILD.gn index 829371df7cc620..01b0e5e70246be 100644 --- a/src/test_driver/tizen/chip_tests/BUILD.gn +++ b/src/test_driver/tizen/chip_tests/BUILD.gn @@ -30,6 +30,7 @@ tizen_qemu_mkisofs("chip-tests-runner") { # rebuild of the ISO image, so the test will be run with old # binaries. assets_non_tracked = [ rebase_path("${root_build_dir}/tests") ] + assets_non_tracked_exclude_globs = [ "*.map" ] } tizen_qemu_run("chip-tests") { diff --git a/third_party/tizen/tizen_sdk.gni b/third_party/tizen/tizen_sdk.gni index 3c8704a8491a13..ebbc8dadd077d0 100644 --- a/third_party/tizen/tizen_sdk.gni +++ b/third_party/tizen/tizen_sdk.gni @@ -190,10 +190,26 @@ template("tizen_qemu_mkisofs") { "-input-charset=default", "-VCHIP", # Volume ID = CHIP "-JRU", # Joliet + Rock Ridge with untranslated filenames + ] + + # Exclude files from the ISO image which might otherwise be included + # by non-tracked assets in case of adding entire directory. This will + # not exclude files added explicitly. + if (defined(invoker.assets_non_tracked_exclude_globs)) { + foreach(glob, invoker.assets_non_tracked_exclude_globs) { + args += [ + "-m", + glob, + ] + } + } + + args += [ "-o", rebase_path(image_file), rebase_path(invoker.runner), ] + if (defined(invoker.assets)) { args += invoker.assets inputs += invoker.assets From bea333a8a8d962077bf336f607dfa8ada92c3986 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 14:03:09 -0400 Subject: [PATCH 015/134] Update Darwin availability annotations. (#29038) --- .../CHIP/templates/availability.yaml | 37 +++++++++++++++---- .../MTRAttributeTLVValueDecoder.mm | 4 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 32 ++++++++-------- .../CHIP/zap-generated/MTRCallbackBridge.h | 11 ++++-- .../CHIP/zap-generated/MTRClusterConstants.h | 4 +- .../CHIP/zap-generated/MTRClusters.h | 4 +- .../CHIP/zap-generated/MTRStructsObjc.h | 10 ++--- .../zap-generated/cluster/Commands.h | 12 ++++++ 8 files changed, 78 insertions(+), 36 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index b838c64d8d0d15..22376a7ff87412 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7615,18 +7615,36 @@ - TimeFailure - MissingTrustedTimeSource -- release: "Future" - versions: "future" +- release: "Fall 2023 #2" + versions: + ios: "17.1" + macos: "14.1" + watchos: "10.1" + tvos: "17.1" introduced: + bitmaps: + TimeFormatLocalization: + - Feature + bitmap values: + OnOff: + Feature: + - DeadFront + TimeFormatLocalization: + Feature: + - CalendarFormat + provisional: attributes: + # New things, not quite finalized. PowerSource: - EndpointList Descriptor: - TagList structs: + # New things, not quite finalized. Descriptor: - SemanticTagStruct struct fields: + # New things, not quite finalized. Descriptor: SemanticTagStruct: - mfgCode @@ -7634,20 +7652,22 @@ - tag - label bitmaps: + # CacheAndSync is provisional in the spec. GroupKeyManagement: - Feature + # New things, not quite finalized. Descriptor: - Feature bitmap values: - OnOff: + # New things, not quite finalized. + Descriptor: Feature: - - DeadFront + - TagList + # CacheAndSync is provisional in the spec. GroupKeyManagement: Feature: - CacheAndSync - Descriptor: - Feature: - - TagList + # Scenes are generally provisional for now. Scenes: Feature: - Explicit @@ -7662,3 +7682,6 @@ - ProxyConfiguration - ProxyDiscovery - ProxyValid + +- release: "Future" + versions: "future" diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 14d0fb2f4bb436..d6490491f078a3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -1778,6 +1778,7 @@ static id _Nullable DecodeAttributeValueForDescriptorCluster( } return value; } +#if MTR_ENABLE_PROVISIONAL case Attributes::TagList::Id: { using TypeInfo = Attributes::TagList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -1825,6 +1826,7 @@ static id _Nullable DecodeAttributeValueForDescriptorCluster( } return value; } +#endif // MTR_ENABLE_PROVISIONAL case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -4604,6 +4606,7 @@ static id _Nullable DecodeAttributeValueForPowerSourceCluster( } return value; } +#if MTR_ENABLE_PROVISIONAL case Attributes::EndpointList::Id: { using TypeInfo = Attributes::EndpointList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -4630,6 +4633,7 @@ static id _Nullable DecodeAttributeValueForPowerSourceCluster( } return value; } +#endif // MTR_ENABLE_PROVISIONAL case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 8f95cdc8da0b9c..64750300422587 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -1754,16 +1754,16 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)readAttributeTagListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeTagListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeTagListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -3974,16 +3974,16 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)readAttributeEndpointListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeEndpointListWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeEndpointListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion - MTR_NEWLY_AVAILABLE; + MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); @@ -25105,9 +25105,9 @@ typedef NS_OPTIONS(uint8_t, MTRGroupsNameSupportBitmap) { typedef NS_OPTIONS(uint32_t, MTRScenesFeature) { MTRScenesFeatureSceneNames API_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x1, - MTRScenesFeatureExplicit MTR_NEWLY_AVAILABLE = 0x2, - MTRScenesFeatureTableSize MTR_NEWLY_AVAILABLE = 0x4, - MTRScenesFeatureFabricScenes MTR_NEWLY_AVAILABLE = 0x8, + MTRScenesFeatureExplicit MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRScenesFeatureTableSize MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRScenesFeatureFabricScenes MTR_PROVISIONALLY_AVAILABLE = 0x8, } API_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); typedef NS_OPTIONS(uint8_t, MTRScenesCopyMode) { @@ -25141,7 +25141,7 @@ typedef NS_ENUM(uint8_t, MTROnOffStartUpOnOff) { typedef NS_OPTIONS(uint32_t, MTROnOffFeature) { MTROnOffFeatureLighting API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x1, - MTROnOffFeatureDeadFront MTR_NEWLY_AVAILABLE = 0x2, + MTROnOffFeatureDeadFront API_AVAILABLE(ios(17.1), macos(14.1), watchos(10.1), tvos(17.1)) = 0x2, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint8_t, MTROnOffControl) { @@ -25170,8 +25170,8 @@ typedef NS_OPTIONS(uint8_t, MTRLevelControlOptions) { } API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); typedef NS_OPTIONS(uint32_t, MTRDescriptorFeature) { - MTRDescriptorFeatureTagList MTR_NEWLY_AVAILABLE = 0x1, -} MTR_NEWLY_AVAILABLE; + MTRDescriptorFeatureTagList MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRAccessControlEntryAuthMode) { MTRAccessControlEntryAuthModePASE API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x01, @@ -25520,8 +25520,8 @@ typedef NS_ENUM(uint8_t, MTRTimeFormatLocalizationHourFormat) { } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint32_t, MTRTimeFormatLocalizationFeature) { - MTRTimeFormatLocalizationFeatureCalendarFormat MTR_NEWLY_AVAILABLE = 0x1, -} MTR_NEWLY_AVAILABLE; + MTRTimeFormatLocalizationFeatureCalendarFormat API_AVAILABLE(ios(17.1), macos(14.1), watchos(10.1), tvos(17.1)) = 0x1, +} API_AVAILABLE(ios(17.1), macos(14.1), watchos(10.1), tvos(17.1)); typedef NS_ENUM(uint8_t, MTRUnitLocalizationTempUnit) { MTRUnitLocalizationTempUnitFahrenheit API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x00, @@ -26444,8 +26444,8 @@ typedef NS_ENUM(uint8_t, MTRGroupKeyManagementGroupKeySecurityPolicy) { } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint32_t, MTRGroupKeyManagementFeature) { - MTRGroupKeyManagementFeatureCacheAndSync MTR_NEWLY_AVAILABLE = 0x1, -} MTR_NEWLY_AVAILABLE; + MTRGroupKeyManagementFeatureCacheAndSync MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; typedef NS_OPTIONS(uint32_t, MTRICDManagementFeature) { MTRICDManagementFeatureCheckInProtocolSupport MTR_PROVISIONALLY_AVAILABLE = 0x1, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 0cc7f3684f1c80..44679818f4d78b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -3904,7 +3904,8 @@ class MTRDescriptorPartsListListAttributeCallbackSubscriptionBridge : public MTR MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRDescriptorTagListListAttributeCallbackBridge : public MTRCallbackBridge +class MTR_PROVISIONALLY_AVAILABLE MTRDescriptorTagListListAttributeCallbackBridge + : public MTRCallbackBridge { public: MTRDescriptorTagListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : @@ -3919,7 +3920,8 @@ class MTRDescriptorTagListListAttributeCallbackBridge : public MTRCallbackBridge value); }; -class MTRDescriptorTagListListAttributeCallbackSubscriptionBridge : public MTRDescriptorTagListListAttributeCallbackBridge +class MTR_PROVISIONALLY_AVAILABLE MTRDescriptorTagListListAttributeCallbackSubscriptionBridge + : public MTRDescriptorTagListListAttributeCallbackBridge { public: MTRDescriptorTagListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, @@ -5849,7 +5851,8 @@ class MTRPowerSourceActiveBatChargeFaultsListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; -class MTRPowerSourceEndpointListListAttributeCallbackBridge : public MTRCallbackBridge +class MTR_PROVISIONALLY_AVAILABLE MTRPowerSourceEndpointListListAttributeCallbackBridge + : public MTRCallbackBridge { public: MTRPowerSourceEndpointListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : @@ -5861,7 +5864,7 @@ class MTRPowerSourceEndpointListListAttributeCallbackBridge : public MTRCallback static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); }; -class MTRPowerSourceEndpointListListAttributeCallbackSubscriptionBridge +class MTR_PROVISIONALLY_AVAILABLE MTRPowerSourceEndpointListListAttributeCallbackSubscriptionBridge : public MTRPowerSourceEndpointListListAttributeCallbackBridge { public: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 7f0f5a82834061..6f7d4d529419c2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -915,7 +915,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { = 0x00000002, MTRAttributeIDTypeClusterDescriptorAttributePartsListID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000003, - MTRAttributeIDTypeClusterDescriptorAttributeTagListID MTR_NEWLY_AVAILABLE = 0x00000004, + MTRAttributeIDTypeClusterDescriptorAttributeTagListID MTR_PROVISIONALLY_AVAILABLE = 0x00000004, MTRAttributeIDTypeClusterDescriptorAttributeGeneratedCommandListID API_AVAILABLE( ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, @@ -1791,7 +1791,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterPowerSourceAttributeActiveBatChargeFaultsID API_AVAILABLE( ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000001E, - MTRAttributeIDTypeClusterPowerSourceAttributeEndpointListID MTR_NEWLY_AVAILABLE = 0x0000001F, + MTRAttributeIDTypeClusterPowerSourceAttributeEndpointListID MTR_PROVISIONALLY_AVAILABLE = 0x0000001F, MTRAttributeIDTypeClusterPowerSourceAttributeGeneratedCommandListID API_AVAILABLE( ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 77495c0ef94bfe..14355f269b5f41 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -749,7 +749,7 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary *)readAttributePartsListWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (NSDictionary *)readAttributeTagListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; +- (NSDictionary *)readAttributeTagListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -1511,7 +1511,7 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary *)readAttributeActiveBatChargeFaultsWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (NSDictionary *)readAttributeEndpointListWithParams:(MTRReadParams * _Nullable)params MTR_NEWLY_AVAILABLE; +- (NSDictionary *)readAttributeEndpointListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index cb5ffe460ba0af..9742181dc8153b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -50,12 +50,12 @@ MTR_DEPRECATED( "Please use MTRDescriptorClusterDeviceTypeStruct", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end -MTR_NEWLY_AVAILABLE +MTR_PROVISIONALLY_AVAILABLE @interface MTRDescriptorClusterSemanticTagStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nullable mfgCode MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull namespaceID MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSNumber * _Nonnull tag MTR_NEWLY_AVAILABLE; -@property (nonatomic, copy) NSString * _Nullable label MTR_NEWLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable mfgCode MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull namespaceID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull tag MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nullable label MTR_PROVISIONALLY_AVAILABLE; @end API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index d80f332a2f2526..83b5c849f16e53 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -10096,6 +10096,8 @@ class SubscribeAttributeDescriptorPartsList : public SubscribeAttribute { } }; +#if MTR_ENABLE_PROVISIONAL + /* * Attribute TagList */ @@ -10174,6 +10176,8 @@ class SubscribeAttributeDescriptorTagList : public SubscribeAttribute { } }; +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute GeneratedCommandList */ @@ -22772,6 +22776,8 @@ class SubscribeAttributePowerSourceActiveBatChargeFaults : public SubscribeAttri } }; +#if MTR_ENABLE_PROVISIONAL + /* * Attribute EndpointList */ @@ -22850,6 +22856,8 @@ class SubscribeAttributePowerSourceEndpointList : public SubscribeAttribute { } }; +#endif // MTR_ENABLE_PROVISIONAL + /* * Attribute GeneratedCommandList */ @@ -147946,8 +147954,10 @@ void registerClusterDescriptor(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // make_unique(), // @@ -148446,8 +148456,10 @@ void registerClusterPowerSource(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // make_unique(), // From 14cbb3235bbae9a847a6b86703c3663bc21e0b6d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 14:04:23 -0400 Subject: [PATCH 016/134] Add a config define for Darwin per-controller storage. (#29037) It's not quite ready yet; make sure we don't accidentally ship it. --- .github/workflows/darwin.yaml | 2 ++ src/darwin/Framework/CHIP/MTRDefines.h | 10 +++++++- .../Framework/CHIP/MTRDeviceController.h | 2 ++ .../CHIP/MTRDeviceControllerDataStore.h | 4 +++ .../CHIP/MTRDeviceControllerFactory.h | 10 ++++++++ .../CHIP/MTRDeviceControllerFactory.mm | 3 +++ .../MTRDeviceControllerStartupParameters.h | 16 +++++++++++- ...eviceControllerStartupParameters_Wrapper.h | 25 +++++++++++++++++++ .../CHIP/MTRDeviceControllerStartupParams.mm | 4 +++ ...TRDeviceControllerStartupParams_Internal.h | 4 +++ .../CHIP/MTRDeviceControllerStorageDelegate.h | 16 +++++++++++- ...RDeviceControllerStorageDelegate_Wrapper.h | 25 +++++++++++++++++++ .../CHIP/MTRDeviceController_Internal.h | 11 ++++++++ src/darwin/Framework/CHIP/Matter.h | 4 +++ .../CHIPTests/MTRControllerAdvertisingTests.m | 4 +++ .../CHIPTests/MTRPerControllerStorageTests.m | 4 +++ .../TestHelpers/MTRTestPerControllerStorage.h | 4 +++ .../TestHelpers/MTRTestPerControllerStorage.m | 4 +++ 18 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index 1eddaec04a8667..99306feef42225 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -116,6 +116,8 @@ jobs: # -enableUndefinedBehaviorSanitizer instruments the code in Matter.framework, # but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_UBSAN=YES TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO > >(tee /tmp/darwin/framework-tests/darwin-tests-asan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-err.log >&2) + # And the same thing, but with MTR_PER_CONTROLLER_STORAGE_ENABLED turned on. + TEST_RUNNER_ASAN_OPTIONS=__CURRENT_VALUE__:detect_stack_use_after_return=1 xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_UBSAN=YES CHIP_IS_BLE=NO GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_PER_CONTROLLER_STORAGE_ENABLED=1' > >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-asan-provisional-err.log >&2) # -enableThreadSanitizer instruments the code in Matter.framework, # but to instrument the code in the underlying libCHIP we need to pass CHIP_IS_TSAN=YES xcodebuild test -target "Matter" -scheme "Matter Framework Tests" -sdk macosx -enableThreadSanitizer YES OTHER_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' CHIP_IS_TSAN=YES CHIP_IS_BLE=NO > >(tee /tmp/darwin/framework-tests/darwin-tests-tsan.log) 2> >(tee /tmp/darwin/framework-tests/darwin-tests-tsan-err.log >&2) diff --git a/src/darwin/Framework/CHIP/MTRDefines.h b/src/darwin/Framework/CHIP/MTRDefines.h index dab6250019e325..206ae4d856fcc5 100644 --- a/src/darwin/Framework/CHIP/MTRDefines.h +++ b/src/darwin/Framework/CHIP/MTRDefines.h @@ -53,12 +53,20 @@ #define MTR_NEWLY_AVAILABLE #endif -#if defined(MTR_ENABLE_PROVISIONAL) && MTR_ENABLE_PROVISIONAL +#if !defined(MTR_ENABLE_PROVISIONAL) +#define MTR_ENABLE_PROVISIONAL 0 +#endif + +#if MTR_ENABLE_PROVISIONAL #define MTR_PROVISIONALLY_AVAILABLE MTR_NEWLY_AVAILABLE #else #define MTR_PROVISIONALLY_AVAILABLE NS_UNAVAILABLE MTR_HIDDEN #endif +#ifndef MTR_PER_CONTROLLER_STORAGE_ENABLED +#define MTR_PER_CONTROLLER_STORAGE_ENABLED 0 +#endif + #pragma mark - Types typedef NSData * MTRTLVBytes; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index 670e12bbd0caaf..d8636796707946 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -47,10 +47,12 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS */ @property (readonly, nonatomic, getter=isRunning) BOOL running; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED /** * The ID assigned to this controller at creation time. */ @property (readonly, nonatomic) NSUUID * uniqueIdentifier MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED /** * Return the Node ID assigned to the controller. Will return nil if the diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h index 8d10c7af3e810b..3abab9ea48adcc 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h @@ -17,7 +17,11 @@ #import #import #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +#import "MTRDeviceControllerStorageDelegate_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h index 6471db8b005ccb..5cb4b7c7fd188f 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h @@ -22,7 +22,12 @@ #import #import +#import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +@class MTRDeviceControllerStartupParameters; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED NS_ASSUME_NONNULL_BEGIN @@ -93,12 +98,15 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) */ - (instancetype)initWithStorage:(id)storage; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED /* * Initialize the device controller factory without storage. In this mode, * device controllers will need to have per-controller storage provided to allow * storing controller-specific information. */ - (instancetype)init MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + @end API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @@ -180,6 +188,7 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControllerStartupParams *)startupParams error:(NSError * __autoreleasing *)error; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED /** * Create an MTRDeviceController. Returns nil on failure. * @@ -191,6 +200,7 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) */ - (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupParameters *)startupParameters error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED @end diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 195fb61f5c7b6a..31b261ad74b79a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -34,6 +34,9 @@ #import "MTRPersistentStorageDelegateBridge.h" #import "MTRSessionResumptionStorageBridge.h" #import "NSDataSpanConversion.h" +#if !MTR_PER_CONTROLLER_STORAGE_ENABLED +#import "MTRDeviceControllerStartupParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h index 0fca31906c2e3b..7b69f0f3d96531 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h @@ -15,13 +15,22 @@ */ #import - #import + +#if defined(MTR_INTERNAL_INCLUDE) && defined(MTR_INCLUDED_FROM_UMBRELLA_HEADER) +#error Internal includes should not happen from the umbrella header +#endif + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) + #import #import NS_ASSUME_NONNULL_BEGIN +#if !MTR_PER_CONTROLLER_STORAGE_ENABLED +MTR_HIDDEN +#endif MTR_NEWLY_AVAILABLE @interface MTRDeviceControllerStartupParameters : NSObject @@ -68,6 +77,9 @@ MTR_NEWLY_AVAILABLE @end +#if !MTR_PER_CONTROLLER_STORAGE_ENABLED +MTR_HIDDEN +#endif MTR_NEWLY_AVAILABLE @interface MTRDeviceControllerExternalCertificateStartupParameters : MTRDeviceControllerStartupParameters @@ -119,3 +131,5 @@ MTR_NEWLY_AVAILABLE @end NS_ASSUME_NONNULL_END + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h new file mode 100644 index 00000000000000..537958dabf37fb --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#error Should be including Matter/MTRDeviceControllerStartupParameters.h +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + +#define MTR_INTERNAL_INCLUDE +#import +#undef MTR_INTERNAL_INCLUDE diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index 7bbcea96183035..3da8a906c0886d 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -23,7 +23,11 @@ #import "MTRP256KeypairBridge.h" #import "NSDataSpanConversion.h" +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +#import "MTRDeviceControllerStorageDelegate_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h index 734197ef72d2d6..9d52067d510982 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h @@ -20,7 +20,11 @@ #import #import #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +#import "MTRDeviceControllerStartupParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h index 1fee9c65ae460c..2a322eb07f799a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h @@ -15,8 +15,15 @@ */ #import +#import #import +#if defined(MTR_INTERNAL_INCLUDE) && defined(MTR_INCLUDED_FROM_UMBRELLA_HEADER) +#error Internal includes should not happen from the umbrella header +#endif + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) + NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSUInteger, MTRStorageSecurityLevel) { @@ -105,6 +112,13 @@ MTR_NEWLY_AVAILABLE @end // TODO: FIXME: Is this a sane place to put this API? -MTR_EXTERN MTR_NEWLY_AVAILABLE NSSet * MTRDeviceControllerStorageClasses(void); +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +MTR_EXTERN +#else +MTR_HIDDEN +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED +MTR_NEWLY_AVAILABLE NSSet * MTRDeviceControllerStorageClasses(void); NS_ASSUME_NONNULL_END + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h new file mode 100644 index 00000000000000..774fff9f48a179 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#error Should be including Matter/MTRDeviceControllerStorageDelegate.h +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + +#define MTR_INTERNAL_INCLUDE +#import +#undef MTR_INTERNAL_INCLUDE diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 6ff5843f622513..2f86a4edb88fec 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -32,7 +32,11 @@ #import "MTRDeviceControllerDataStore.h" #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import +#else +#import "MTRDeviceControllerStorageDelegate_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import @class MTRDeviceControllerStartupParamsInternal; @@ -51,6 +55,13 @@ NS_ASSUME_NONNULL_BEGIN @interface MTRDeviceController () +#if !MTR_PER_CONTROLLER_STORAGE_ENABLED +/** + * The ID assigned to this controller at creation time. + */ +@property (readonly, nonatomic) NSUUID * uniqueIdentifier MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + #pragma mark - MTRDeviceControllerFactory methods /** diff --git a/src/darwin/Framework/CHIP/Matter.h b/src/darwin/Framework/CHIP/Matter.h index 26c74cd80487d2..63c067f48d084d 100644 --- a/src/darwin/Framework/CHIP/Matter.h +++ b/src/darwin/Framework/CHIP/Matter.h @@ -17,6 +17,8 @@ #import +#define MTR_INCLUDED_FROM_UMBRELLA_HEADER + #import #import #import @@ -57,3 +59,5 @@ #import #import #import + +#undef MTR_INCLUDED_FROM_UMBRELLA_HEADER diff --git a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m index 1276e0ce845bca..549d66ec3826a5 100644 --- a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m +++ b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m @@ -24,6 +24,8 @@ #import "MTRTestKeys.h" #import "MTRTestPerControllerStorage.h" +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + static const uint16_t kTestVendorId = 0xFFF1u; static const uint16_t kTimeoutInSeconds = 3; @@ -295,3 +297,5 @@ - (void)test001_CheckAdvertisingAsExpected } @end + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index 894eb5f3893464..f81cc23af4e44e 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -25,6 +25,8 @@ #import "MTRTestPerControllerStorage.h" #import "MTRTestResetCommissioneeHelper.h" +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00"; @@ -1055,3 +1057,5 @@ - (void)test007_TestMultipleControllers } @end + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h index b3052a9929a1af..427d537e07b485 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h @@ -17,6 +17,8 @@ #import #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + NS_ASSUME_NONNULL_BEGIN @interface MTRTestPerControllerStorage : NSObject @@ -41,3 +43,5 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m index 1898bd14832cf9..1a453d5eaec281 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m @@ -18,6 +18,8 @@ #import "MTRTestPerControllerStorage.h" +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + @interface MTRTestPerControllerStorage () @property (nonatomic, readonly) NSMutableDictionary * storage; @end @@ -83,3 +85,5 @@ - (BOOL)controller:(MTRDeviceController *)controller } @end + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED From 8a898ef58beb7ab3a5697a43d397d4c5470391d5 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 17:36:19 -0400 Subject: [PATCH 017/134] Make MTRDecodeAttributeValue support global attributes in custom clusters. (#29022) For global attributes we know the schema even if the cluster is custom. --- .../MTRAttributeTLVValueDecoder-src.zapt | 44 + .../MTRAttributeTLVValueDecoder.mm | 24472 ++++------------ .../CHIPTests/MTRDataValueParserTests.m | 55 + 3 files changed, 6316 insertions(+), 18255 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt b/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt index ec2c1f7d3b70f7..2b70a99a06701d 100644 --- a/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRAttributeTLVValueDecoder-src.zapt @@ -12,10 +12,48 @@ #include #include #include +#include using namespace chip; using namespace chip::app; +static id _Nullable DecodeGlobalAttributeValue(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Globals; + switch (aAttributeId) { + {{#zcl_attributes_server removeKeys='isOptional'}} + {{#unless clusterRef}} + {{#if (isSupported "" globalAttribute=(asUpperCamelCase name preserveAcronyms=true))}} + {{#if (isProvisional "" globalAttribute=(asUpperCamelCase name preserveAcronyms=true))}} + #if MTR_ENABLE_PROVISIONAL + {{/if}} + case Attributes::{{asUpperCamelCase name}}::Id: { + using TypeInfo = Attributes::{{asUpperCamelCase name}}::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nil; + } + {{asObjectiveCType type ""}} value; + {{>decode_value target="value" source="cppValue" cluster="" errorCode="*aError = err; return nil;" depth=0}} + return value; + } + {{#if (isProvisional "" globalAttribute=(asUpperCamelCase name preserveAcronyms=true))}} + #endif // MTR_ENABLE_PROVISIONAL + {{/if}} + {{/if}} + {{/unless}} + {{/zcl_attributes_server}} + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} + {{#zcl_clusters}} {{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} static id _Nullable DecodeAttributeValueFor{{asUpperCamelCase name preserveAcronyms=true}}Cluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) @@ -23,6 +61,7 @@ static id _Nullable DecodeAttributeValueFor{{asUpperCamelCase name preserveAcron using namespace Clusters::{{asUpperCamelCase name}}; switch (aAttributeId) { {{#zcl_attributes_server removeKeys='isOptional'}} + {{#if clusterRef}} {{#if (isSupported (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} {{#if (isProvisional (asUpperCamelCase ../name preserveAcronyms=true) attribute=(asUpperCamelCase name preserveAcronyms=true))}} #if MTR_ENABLE_PROVISIONAL @@ -43,6 +82,7 @@ static id _Nullable DecodeAttributeValueFor{{asUpperCamelCase name preserveAcron #endif // MTR_ENABLE_PROVISIONAL {{/if}} {{/if}} + {{/if}} {{/zcl_attributes_server}} default: { break; @@ -57,6 +97,10 @@ static id _Nullable DecodeAttributeValueFor{{asUpperCamelCase name preserveAcron id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & aReader, CHIP_ERROR * aError) { + if (IsGlobalAttribute(aPath.mAttributeId)) { + return DecodeGlobalAttributeValue(aPath.mAttributeId, aReader, aError); + } + switch (aPath.mClusterId) { {{#zcl_clusters}} {{#if (isSupported (asUpperCamelCase name preserveAcronyms=true))}} diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index d6490491f078a3..8df1187874fd12 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -26,37 +26,16 @@ #include #include #include +#include #include using namespace chip; using namespace chip::app; -static id _Nullable DecodeAttributeValueForIdentifyCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeGlobalAttributeValue(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Identify; + using namespace Clusters::Globals; switch (aAttributeId) { - case Attributes::IdentifyTime::Id: { - using TypeInfo = Attributes::IdentifyTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::IdentifyType::Id: { - using TypeInfo = Attributes::IdentifyType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } case Attributes::GeneratedCommandList::Id: { using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; TypeInfo::DecodableType cppValue; @@ -193,147 +172,54 @@ static id _Nullable DecodeAttributeValueForIdentifyCluster(AttributeId aAttribut *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForGroupsCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) + +static id _Nullable DecodeAttributeValueForIdentifyCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Groups; + using namespace Clusters::Identify; switch (aAttributeId) { - case Attributes::NameSupport::Id: { - using TypeInfo = Attributes::NameSupport::TypeInfo; + case Attributes::IdentifyTime::Id: { + using TypeInfo = Attributes::IdentifyTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::IdentifyType::Id: { + using TypeInfo = Attributes::IdentifyType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; + default: { + break; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForGroupsCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Groups; + switch (aAttributeId) { + case Attributes::NameSupport::Id: { + using TypeInfo = Attributes::NameSupport::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } default: { @@ -444,132 +330,110 @@ static id _Nullable DecodeAttributeValueForScenesCluster(AttributeId aAttributeI return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOnOffCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OnOff; + switch (aAttributeId) { + case Attributes::OnOff::Id: { + using TypeInfo = Attributes::OnOff::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::GlobalSceneControl::Id: { + using TypeInfo = Attributes::GlobalSceneControl::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::OnTime::Id: { + using TypeInfo = Attributes::OnTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::OffWaitTime::Id: { + using TypeInfo = Attributes::OffWaitTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::StartUpOnOff::Id: { + using TypeInfo = Attributes::StartUpOnOff::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OnOffSwitchConfiguration; + switch (aAttributeId) { + case Attributes::SwitchType::Id: { + using TypeInfo = Attributes::SwitchType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::SwitchActions::Id: { + using TypeInfo = Attributes::SwitchActions::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } default: { @@ -580,45 +444,61 @@ static id _Nullable DecodeAttributeValueForScenesCluster(AttributeId aAttributeI *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForOnOffCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForLevelControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::OnOff; + using namespace Clusters::LevelControl; switch (aAttributeId) { - case Attributes::OnOff::Id: { - using TypeInfo = Attributes::OnOff::TypeInfo; + case Attributes::CurrentLevel::Id: { + using TypeInfo = Attributes::CurrentLevel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } + case Attributes::RemainingTime::Id: { + using TypeInfo = Attributes::RemainingTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::GlobalSceneControl::Id: { - using TypeInfo = Attributes::GlobalSceneControl::TypeInfo; + case Attributes::MinLevel::Id: { + using TypeInfo = Attributes::MinLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::OnTime::Id: { - using TypeInfo = Attributes::OnTime::TypeInfo; + case Attributes::MaxLevel::Id: { + using TypeInfo = Attributes::MaxLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::OffWaitTime::Id: { - using TypeInfo = Attributes::OffWaitTime::TypeInfo; + case Attributes::CurrentFrequency::Id: { + using TypeInfo = Attributes::CurrentFrequency::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -628,147 +508,123 @@ static id _Nullable DecodeAttributeValueForOnOffCluster(AttributeId aAttributeId value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::StartUpOnOff::Id: { - using TypeInfo = Attributes::StartUpOnOff::TypeInfo; + case Attributes::MinFrequency::Id: { + using TypeInfo = Attributes::MinFrequency::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::MaxFrequency::Id: { + using TypeInfo = Attributes::MaxFrequency::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::Options::Id: { + using TypeInfo = Attributes::Options::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::OnOffTransitionTime::Id: { + using TypeInfo = Attributes::OnOffTransitionTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::OnLevel::Id: { + using TypeInfo = Attributes::OnLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::OnTransitionTime::Id: { + using TypeInfo = Attributes::OnTransitionTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::OffTransitionTime::Id: { + using TypeInfo = Attributes::OffTransitionTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::DefaultMoveRate::Id: { + using TypeInfo = Attributes::DefaultMoveRate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::StartUpCurrentLevel::Id: { + using TypeInfo = Attributes::StartUpCurrentLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } default: { @@ -779,24 +635,94 @@ static id _Nullable DecodeAttributeValueForOnOffCluster(AttributeId aAttributeId *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( +static id _Nullable DecodeAttributeValueForBinaryInputBasicCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::OnOffSwitchConfiguration; + using namespace Clusters::BinaryInputBasic; switch (aAttributeId) { - case Attributes::SwitchType::Id: { - using TypeInfo = Attributes::SwitchType::TypeInfo; + case Attributes::ActiveText::Id: { + using TypeInfo = Attributes::ActiveText::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::Description::Id: { + using TypeInfo = Attributes::Description::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::InactiveText::Id: { + using TypeInfo = Attributes::InactiveText::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::OutOfService::Id: { + using TypeInfo = Attributes::OutOfService::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::Polarity::Id: { + using TypeInfo = Attributes::Polarity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::SwitchActions::Id: { - using TypeInfo = Attributes::SwitchActions::TypeInfo; + case Attributes::PresentValue::Id: { + using TypeInfo = Attributes::PresentValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::Reliability::Id: { + using TypeInfo = Attributes::Reliability::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -806,8 +732,56 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::StatusFlags::Id: { + using TypeInfo = Attributes::StatusFlags::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::ApplicationType::Id: { + using TypeInfo = Attributes::ApplicationType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPulseWidthModulationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PulseWidthModulation; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForDescriptorCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Descriptor; + switch (aAttributeId) { + case Attributes::DeviceTypeList::Id: { + using TypeInfo = Attributes::DeviceTypeList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -819,8 +793,10 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRDescriptorClusterDeviceTypeStruct * newElement_0; + newElement_0 = [MTRDescriptorClusterDeviceTypeStruct new]; + newElement_0.deviceType = [NSNumber numberWithUnsignedInt:entry_0.deviceType]; + newElement_0.revision = [NSNumber numberWithUnsignedShort:entry_0.revision]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -832,8 +808,8 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ServerList::Id: { + using TypeInfo = Attributes::ServerList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -858,9 +834,8 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::ClientList::Id: { + using TypeInfo = Attributes::ClientList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -885,9 +860,8 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PartsList::Id: { + using TypeInfo = Attributes::PartsList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -900,7 +874,7 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -912,28 +886,55 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::TagList::Id: { + using TypeInfo = Attributes::TagList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRDescriptorClusterSemanticTagStruct * newElement_0; + newElement_0 = [MTRDescriptorClusterSemanticTagStruct new]; + if (entry_0.mfgCode.IsNull()) { + newElement_0.mfgCode = nil; + } else { + newElement_0.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0.mfgCode.Value())]; + } + newElement_0.namespaceID = [NSNumber numberWithUnsignedChar:entry_0.namespaceID]; + newElement_0.tag = [NSNumber numberWithUnsignedChar:entry_0.tag]; + if (entry_0.label.HasValue()) { + if (entry_0.label.Value().IsNull()) { + newElement_0.label = nil; + } else { + newElement_0.label = AsString(entry_0.label.Value().Value()); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } + } else { + newElement_0.label = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -942,10952 +943,57 @@ static id _Nullable DecodeAttributeValueForOnOffSwitchConfigurationCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForLevelControlCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForBindingCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::LevelControl; + using namespace Clusters::Binding; switch (aAttributeId) { - case Attributes::CurrentLevel::Id: { - using TypeInfo = Attributes::CurrentLevel::TypeInfo; + case Attributes::Binding::Id: { + using TypeInfo = Attributes::Binding::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRBindingClusterTargetStruct * newElement_0; + newElement_0 = [MTRBindingClusterTargetStruct new]; + if (entry_0.node.HasValue()) { + newElement_0.node = [NSNumber numberWithUnsignedLongLong:entry_0.node.Value()]; + } else { + newElement_0.node = nil; + } + if (entry_0.group.HasValue()) { + newElement_0.group = [NSNumber numberWithUnsignedShort:entry_0.group.Value()]; + } else { + newElement_0.group = nil; + } + if (entry_0.endpoint.HasValue()) { + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint.Value()]; + } else { + newElement_0.endpoint = nil; + } + if (entry_0.cluster.HasValue()) { + newElement_0.cluster = [NSNumber numberWithUnsignedInt:entry_0.cluster.Value()]; + } else { + newElement_0.cluster = nil; + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::RemainingTime::Id: { - using TypeInfo = Attributes::RemainingTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::MinLevel::Id: { - using TypeInfo = Attributes::MinLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::MaxLevel::Id: { - using TypeInfo = Attributes::MaxLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::CurrentFrequency::Id: { - using TypeInfo = Attributes::CurrentFrequency::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::MinFrequency::Id: { - using TypeInfo = Attributes::MinFrequency::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::MaxFrequency::Id: { - using TypeInfo = Attributes::MaxFrequency::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Options::Id: { - using TypeInfo = Attributes::Options::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; - } - case Attributes::OnOffTransitionTime::Id: { - using TypeInfo = Attributes::OnOffTransitionTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::OnLevel::Id: { - using TypeInfo = Attributes::OnLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::OnTransitionTime::Id: { - using TypeInfo = Attributes::OnTransitionTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::OffTransitionTime::Id: { - using TypeInfo = Attributes::OffTransitionTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::DefaultMoveRate::Id: { - using TypeInfo = Attributes::DefaultMoveRate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::StartUpCurrentLevel::Id: { - using TypeInfo = Attributes::StartUpCurrentLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBinaryInputBasicCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BinaryInputBasic; - switch (aAttributeId) { - case Attributes::ActiveText::Id: { - using TypeInfo = Attributes::ActiveText::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::InactiveText::Id: { - using TypeInfo = Attributes::InactiveText::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::OutOfService::Id: { - using TypeInfo = Attributes::OutOfService::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::Polarity::Id: { - using TypeInfo = Attributes::Polarity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::PresentValue::Id: { - using TypeInfo = Attributes::PresentValue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::Reliability::Id: { - using TypeInfo = Attributes::Reliability::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::StatusFlags::Id: { - using TypeInfo = Attributes::StatusFlags::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::ApplicationType::Id: { - using TypeInfo = Attributes::ApplicationType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForPulseWidthModulationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::PulseWidthModulation; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForDescriptorCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Descriptor; - switch (aAttributeId) { - case Attributes::DeviceTypeList::Id: { - using TypeInfo = Attributes::DeviceTypeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRDescriptorClusterDeviceTypeStruct * newElement_0; - newElement_0 = [MTRDescriptorClusterDeviceTypeStruct new]; - newElement_0.deviceType = [NSNumber numberWithUnsignedInt:entry_0.deviceType]; - newElement_0.revision = [NSNumber numberWithUnsignedShort:entry_0.revision]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ServerList::Id: { - using TypeInfo = Attributes::ServerList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ClientList::Id: { - using TypeInfo = Attributes::ClientList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::PartsList::Id: { - using TypeInfo = Attributes::PartsList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::TagList::Id: { - using TypeInfo = Attributes::TagList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRDescriptorClusterSemanticTagStruct * newElement_0; - newElement_0 = [MTRDescriptorClusterSemanticTagStruct new]; - if (entry_0.mfgCode.IsNull()) { - newElement_0.mfgCode = nil; - } else { - newElement_0.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0.mfgCode.Value())]; - } - newElement_0.namespaceID = [NSNumber numberWithUnsignedChar:entry_0.namespaceID]; - newElement_0.tag = [NSNumber numberWithUnsignedChar:entry_0.tag]; - if (entry_0.label.HasValue()) { - if (entry_0.label.Value().IsNull()) { - newElement_0.label = nil; - } else { - newElement_0.label = AsString(entry_0.label.Value().Value()); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } - } else { - newElement_0.label = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBindingCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Binding; - switch (aAttributeId) { - case Attributes::Binding::Id: { - using TypeInfo = Attributes::Binding::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRBindingClusterTargetStruct * newElement_0; - newElement_0 = [MTRBindingClusterTargetStruct new]; - if (entry_0.node.HasValue()) { - newElement_0.node = [NSNumber numberWithUnsignedLongLong:entry_0.node.Value()]; - } else { - newElement_0.node = nil; - } - if (entry_0.group.HasValue()) { - newElement_0.group = [NSNumber numberWithUnsignedShort:entry_0.group.Value()]; - } else { - newElement_0.group = nil; - } - if (entry_0.endpoint.HasValue()) { - newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint.Value()]; - } else { - newElement_0.endpoint = nil; - } - if (entry_0.cluster.HasValue()) { - newElement_0.cluster = [NSNumber numberWithUnsignedInt:entry_0.cluster.Value()]; - } else { - newElement_0.cluster = nil; - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForAccessControlCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::AccessControl; - switch (aAttributeId) { - case Attributes::Acl::Id: { - using TypeInfo = Attributes::Acl::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRAccessControlClusterAccessControlEntryStruct * newElement_0; - newElement_0 = [MTRAccessControlClusterAccessControlEntryStruct new]; - newElement_0.privilege = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.privilege)]; - newElement_0.authMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.authMode)]; - if (entry_0.subjects.IsNull()) { - newElement_0.subjects = nil; - } else { - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - auto iter_3 = entry_0.subjects.Value().begin(); - while (iter_3.Next()) { - auto & entry_3 = iter_3.GetValue(); - NSNumber * newElement_3; - newElement_3 = [NSNumber numberWithUnsignedLongLong:entry_3]; - [array_3 addObject:newElement_3]; - } - CHIP_ERROR err = iter_3.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.subjects = array_3; - } - } - if (entry_0.targets.IsNull()) { - newElement_0.targets = nil; - } else { - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - auto iter_3 = entry_0.targets.Value().begin(); - while (iter_3.Next()) { - auto & entry_3 = iter_3.GetValue(); - MTRAccessControlClusterAccessControlTargetStruct * newElement_3; - newElement_3 = [MTRAccessControlClusterAccessControlTargetStruct new]; - if (entry_3.cluster.IsNull()) { - newElement_3.cluster = nil; - } else { - newElement_3.cluster = [NSNumber numberWithUnsignedInt:entry_3.cluster.Value()]; - } - if (entry_3.endpoint.IsNull()) { - newElement_3.endpoint = nil; - } else { - newElement_3.endpoint = [NSNumber numberWithUnsignedShort:entry_3.endpoint.Value()]; - } - if (entry_3.deviceType.IsNull()) { - newElement_3.deviceType = nil; - } else { - newElement_3.deviceType = [NSNumber numberWithUnsignedInt:entry_3.deviceType.Value()]; - } - [array_3 addObject:newElement_3]; - } - CHIP_ERROR err = iter_3.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.targets = array_3; - } - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::Extension::Id: { - using TypeInfo = Attributes::Extension::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRAccessControlClusterAccessControlExtensionStruct * newElement_0; - newElement_0 = [MTRAccessControlClusterAccessControlExtensionStruct new]; - newElement_0.data = AsData(entry_0.data); - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::SubjectsPerAccessControlEntry::Id: { - using TypeInfo = Attributes::SubjectsPerAccessControlEntry::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::TargetsPerAccessControlEntry::Id: { - using TypeInfo = Attributes::TargetsPerAccessControlEntry::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::AccessControlEntriesPerFabric::Id: { - using TypeInfo = Attributes::AccessControlEntriesPerFabric::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForActionsCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Actions; - switch (aAttributeId) { - case Attributes::ActionList::Id: { - using TypeInfo = Attributes::ActionList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRActionsClusterActionStruct * newElement_0; - newElement_0 = [MTRActionsClusterActionStruct new]; - newElement_0.actionID = [NSNumber numberWithUnsignedShort:entry_0.actionID]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; - newElement_0.endpointListID = [NSNumber numberWithUnsignedShort:entry_0.endpointListID]; - newElement_0.supportedCommands = [NSNumber numberWithUnsignedShort:entry_0.supportedCommands.Raw()]; - newElement_0.state = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.state)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::EndpointLists::Id: { - using TypeInfo = Attributes::EndpointLists::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRActionsClusterEndpointListStruct * newElement_0; - newElement_0 = [MTRActionsClusterEndpointListStruct new]; - newElement_0.endpointListID = [NSNumber numberWithUnsignedShort:entry_0.endpointListID]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; - { // Scope for our temporary variables - 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]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.endpoints = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::SetupURL::Id: { - using TypeInfo = Attributes::SetupURL::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBasicInformationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BasicInformation; - switch (aAttributeId) { - case Attributes::DataModelRevision::Id: { - using TypeInfo = Attributes::DataModelRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ProductName::Id: { - using TypeInfo = Attributes::ProductName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductID::Id: { - using TypeInfo = Attributes::ProductID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::NodeLabel::Id: { - using TypeInfo = Attributes::NodeLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::Location::Id: { - using TypeInfo = Attributes::Location::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::HardwareVersion::Id: { - using TypeInfo = Attributes::HardwareVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::HardwareVersionString::Id: { - using TypeInfo = Attributes::HardwareVersionString::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SoftwareVersion::Id: { - using TypeInfo = Attributes::SoftwareVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::SoftwareVersionString::Id: { - using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ManufacturingDate::Id: { - using TypeInfo = Attributes::ManufacturingDate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::PartNumber::Id: { - using TypeInfo = Attributes::PartNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductURL::Id: { - using TypeInfo = Attributes::ProductURL::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductLabel::Id: { - using TypeInfo = Attributes::ProductLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SerialNumber::Id: { - using TypeInfo = Attributes::SerialNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::LocalConfigDisabled::Id: { - using TypeInfo = Attributes::LocalConfigDisabled::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::Reachable::Id: { - using TypeInfo = Attributes::Reachable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::UniqueID::Id: { - using TypeInfo = Attributes::UniqueID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::CapabilityMinima::Id: { - using TypeInfo = Attributes::CapabilityMinima::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRBasicInformationClusterCapabilityMinimaStruct * _Nonnull value; - value = [MTRBasicInformationClusterCapabilityMinimaStruct new]; - value.caseSessionsPerFabric = [NSNumber numberWithUnsignedShort:cppValue.caseSessionsPerFabric]; - value.subscriptionsPerFabric = [NSNumber numberWithUnsignedShort:cppValue.subscriptionsPerFabric]; - return value; - } - case Attributes::ProductAppearance::Id: { - using TypeInfo = Attributes::ProductAppearance::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRBasicInformationClusterProductAppearanceStruct * _Nonnull value; - value = [MTRBasicInformationClusterProductAppearanceStruct new]; - value.finish = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.finish)]; - if (cppValue.primaryColor.IsNull()) { - value.primaryColor = nil; - } else { - value.primaryColor = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.primaryColor.Value())]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOTASoftwareUpdateProviderCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OtaSoftwareUpdateProvider; - switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOTASoftwareUpdateRequestorCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OtaSoftwareUpdateRequestor; - switch (aAttributeId) { - case Attributes::DefaultOTAProviders::Id: { - using TypeInfo = Attributes::DefaultOTAProviders::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTROTASoftwareUpdateRequestorClusterProviderLocation * newElement_0; - newElement_0 = [MTROTASoftwareUpdateRequestorClusterProviderLocation new]; - newElement_0.providerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.providerNodeID]; - newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::UpdatePossible::Id: { - using TypeInfo = Attributes::UpdatePossible::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::UpdateState::Id: { - using TypeInfo = Attributes::UpdateState::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::UpdateStateProgress::Id: { - using TypeInfo = Attributes::UpdateStateProgress::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForLocalizationConfigurationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::LocalizationConfiguration; - switch (aAttributeId) { - case Attributes::ActiveLocale::Id: { - using TypeInfo = Attributes::ActiveLocale::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SupportedLocales::Id: { - using TypeInfo = Attributes::SupportedLocales::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSString * newElement_0; - newElement_0 = AsString(entry_0); - if (newElement_0 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForTimeFormatLocalizationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::TimeFormatLocalization; - switch (aAttributeId) { - case Attributes::HourFormat::Id: { - using TypeInfo = Attributes::HourFormat::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ActiveCalendarType::Id: { - using TypeInfo = Attributes::ActiveCalendarType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::SupportedCalendarTypes::Id: { - using TypeInfo = Attributes::SupportedCalendarTypes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForUnitLocalizationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::UnitLocalization; - switch (aAttributeId) { - case Attributes::TemperatureUnit::Id: { - using TypeInfo = Attributes::TemperatureUnit::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForPowerSourceConfigurationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::PowerSourceConfiguration; - switch (aAttributeId) { - case Attributes::Sources::Id: { - using TypeInfo = Attributes::Sources::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForPowerSourceCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::PowerSource; - switch (aAttributeId) { - case Attributes::Status::Id: { - using TypeInfo = Attributes::Status::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::Order::Id: { - using TypeInfo = Attributes::Order::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::WiredAssessedInputVoltage::Id: { - using TypeInfo = Attributes::WiredAssessedInputVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::WiredAssessedInputFrequency::Id: { - using TypeInfo = Attributes::WiredAssessedInputFrequency::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::WiredCurrentType::Id: { - using TypeInfo = Attributes::WiredCurrentType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::WiredAssessedCurrent::Id: { - using TypeInfo = Attributes::WiredAssessedCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::WiredNominalVoltage::Id: { - using TypeInfo = Attributes::WiredNominalVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::WiredMaximumCurrent::Id: { - using TypeInfo = Attributes::WiredMaximumCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::WiredPresent::Id: { - using TypeInfo = Attributes::WiredPresent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::ActiveWiredFaults::Id: { - using TypeInfo = Attributes::ActiveWiredFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::BatVoltage::Id: { - using TypeInfo = Attributes::BatVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::BatPercentRemaining::Id: { - using TypeInfo = Attributes::BatPercentRemaining::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::BatTimeRemaining::Id: { - using TypeInfo = Attributes::BatTimeRemaining::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::BatChargeLevel::Id: { - using TypeInfo = Attributes::BatChargeLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatReplacementNeeded::Id: { - using TypeInfo = Attributes::BatReplacementNeeded::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::BatReplaceability::Id: { - using TypeInfo = Attributes::BatReplaceability::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatPresent::Id: { - using TypeInfo = Attributes::BatPresent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::ActiveBatFaults::Id: { - using TypeInfo = Attributes::ActiveBatFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::BatReplacementDescription::Id: { - using TypeInfo = Attributes::BatReplacementDescription::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::BatCommonDesignation::Id: { - using TypeInfo = Attributes::BatCommonDesignation::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatANSIDesignation::Id: { - using TypeInfo = Attributes::BatANSIDesignation::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::BatIECDesignation::Id: { - using TypeInfo = Attributes::BatIECDesignation::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::BatApprovedChemistry::Id: { - using TypeInfo = Attributes::BatApprovedChemistry::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatCapacity::Id: { - using TypeInfo = Attributes::BatCapacity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::BatQuantity::Id: { - using TypeInfo = Attributes::BatQuantity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::BatChargeState::Id: { - using TypeInfo = Attributes::BatChargeState::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::BatTimeToFullCharge::Id: { - using TypeInfo = Attributes::BatTimeToFullCharge::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::BatFunctionalWhileCharging::Id: { - using TypeInfo = Attributes::BatFunctionalWhileCharging::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::BatChargingCurrent::Id: { - using TypeInfo = Attributes::BatChargingCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::ActiveBatChargeFaults::Id: { - using TypeInfo = Attributes::ActiveBatChargeFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EndpointList::Id: { - using TypeInfo = Attributes::EndpointList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForGeneralCommissioningCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::GeneralCommissioning; - switch (aAttributeId) { - case Attributes::Breadcrumb::Id: { - using TypeInfo = Attributes::Breadcrumb::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::BasicCommissioningInfo::Id: { - using TypeInfo = Attributes::BasicCommissioningInfo::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nonnull value; - value = [MTRGeneralCommissioningClusterBasicCommissioningInfo new]; - value.failSafeExpiryLengthSeconds = [NSNumber numberWithUnsignedShort:cppValue.failSafeExpiryLengthSeconds]; - value.maxCumulativeFailsafeSeconds = [NSNumber numberWithUnsignedShort:cppValue.maxCumulativeFailsafeSeconds]; - return value; - } - case Attributes::RegulatoryConfig::Id: { - using TypeInfo = Attributes::RegulatoryConfig::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::LocationCapability::Id: { - using TypeInfo = Attributes::LocationCapability::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::SupportsConcurrentConnection::Id: { - using TypeInfo = Attributes::SupportsConcurrentConnection::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::NetworkCommissioning; - switch (aAttributeId) { - case Attributes::MaxNetworks::Id: { - using TypeInfo = Attributes::MaxNetworks::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::Networks::Id: { - using TypeInfo = Attributes::Networks::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRNetworkCommissioningClusterNetworkInfoStruct * newElement_0; - newElement_0 = [MTRNetworkCommissioningClusterNetworkInfoStruct new]; - newElement_0.networkID = AsData(entry_0.networkID); - newElement_0.connected = [NSNumber numberWithBool:entry_0.connected]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ScanMaxTimeSeconds::Id: { - using TypeInfo = Attributes::ScanMaxTimeSeconds::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::ConnectMaxTimeSeconds::Id: { - using TypeInfo = Attributes::ConnectMaxTimeSeconds::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::InterfaceEnabled::Id: { - using TypeInfo = Attributes::InterfaceEnabled::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::LastNetworkingStatus::Id: { - using TypeInfo = Attributes::LastNetworkingStatus::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::LastNetworkID::Id: { - using TypeInfo = Attributes::LastNetworkID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSData * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsData(cppValue.Value()); - } - return value; - } - case Attributes::LastConnectErrorValue::Id: { - using TypeInfo = Attributes::LastConnectErrorValue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithInt:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForDiagnosticLogsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::DiagnosticLogs; - switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForGeneralDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::GeneralDiagnostics; - switch (aAttributeId) { - case Attributes::NetworkInterfaces::Id: { - using TypeInfo = Attributes::NetworkInterfaces::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRGeneralDiagnosticsClusterNetworkInterface * newElement_0; - newElement_0 = [MTRGeneralDiagnosticsClusterNetworkInterface new]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.isOperational = [NSNumber numberWithBool:entry_0.isOperational]; - if (entry_0.offPremiseServicesReachableIPv4.IsNull()) { - newElement_0.offPremiseServicesReachableIPv4 = nil; - } else { - newElement_0.offPremiseServicesReachableIPv4 = - [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv4.Value()]; - } - if (entry_0.offPremiseServicesReachableIPv6.IsNull()) { - newElement_0.offPremiseServicesReachableIPv6 = nil; - } else { - newElement_0.offPremiseServicesReachableIPv6 = - [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv6.Value()]; - } - newElement_0.hardwareAddress = AsData(entry_0.hardwareAddress); - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.IPv4Addresses.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSData * newElement_2; - newElement_2 = AsData(entry_2); - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.iPv4Addresses = array_2; - } - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.IPv6Addresses.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - NSData * newElement_2; - newElement_2 = AsData(entry_2); - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.iPv6Addresses = array_2; - } - newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::RebootCount::Id: { - using TypeInfo = Attributes::RebootCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::UpTime::Id: { - using TypeInfo = Attributes::UpTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::TotalOperationalHours::Id: { - using TypeInfo = Attributes::TotalOperationalHours::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::BootReason::Id: { - using TypeInfo = Attributes::BootReason::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ActiveHardwareFaults::Id: { - using TypeInfo = Attributes::ActiveHardwareFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ActiveRadioFaults::Id: { - using TypeInfo = Attributes::ActiveRadioFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::ActiveNetworkFaults::Id: { - using TypeInfo = Attributes::ActiveNetworkFaults::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::TestEventTriggersEnabled::Id: { - using TypeInfo = Attributes::TestEventTriggersEnabled::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForSoftwareDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::SoftwareDiagnostics; - switch (aAttributeId) { - case Attributes::ThreadMetrics::Id: { - using TypeInfo = Attributes::ThreadMetrics::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRSoftwareDiagnosticsClusterThreadMetricsStruct * newElement_0; - newElement_0 = [MTRSoftwareDiagnosticsClusterThreadMetricsStruct new]; - newElement_0.id = [NSNumber numberWithUnsignedLongLong:entry_0.id]; - if (entry_0.name.HasValue()) { - newElement_0.name = AsString(entry_0.name.Value()); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.name = nil; - } - if (entry_0.stackFreeCurrent.HasValue()) { - newElement_0.stackFreeCurrent = [NSNumber numberWithUnsignedInt:entry_0.stackFreeCurrent.Value()]; - } else { - newElement_0.stackFreeCurrent = nil; - } - if (entry_0.stackFreeMinimum.HasValue()) { - newElement_0.stackFreeMinimum = [NSNumber numberWithUnsignedInt:entry_0.stackFreeMinimum.Value()]; - } else { - newElement_0.stackFreeMinimum = nil; - } - if (entry_0.stackSize.HasValue()) { - newElement_0.stackSize = [NSNumber numberWithUnsignedInt:entry_0.stackSize.Value()]; - } else { - newElement_0.stackSize = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::CurrentHeapFree::Id: { - using TypeInfo = Attributes::CurrentHeapFree::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::CurrentHeapUsed::Id: { - using TypeInfo = Attributes::CurrentHeapUsed::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::CurrentHeapHighWatermark::Id: { - using TypeInfo = Attributes::CurrentHeapHighWatermark::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForThreadNetworkDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::ThreadNetworkDiagnostics; - switch (aAttributeId) { - case Attributes::Channel::Id: { - using TypeInfo = Attributes::Channel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::RoutingRole::Id: { - using TypeInfo = Attributes::RoutingRole::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::NetworkName::Id: { - using TypeInfo = Attributes::NetworkName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsString(cppValue.Value()); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } - return value; - } - case Attributes::PanId::Id: { - using TypeInfo = Attributes::PanId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::ExtendedPanId::Id: { - using TypeInfo = Attributes::ExtendedPanId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::MeshLocalPrefix::Id: { - using TypeInfo = Attributes::MeshLocalPrefix::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSData * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsData(cppValue.Value()); - } - return value; - } - case Attributes::OverrunCount::Id: { - using TypeInfo = Attributes::OverrunCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::NeighborTable::Id: { - using TypeInfo = Attributes::NeighborTable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRThreadNetworkDiagnosticsClusterNeighborTableStruct * newElement_0; - newElement_0 = [MTRThreadNetworkDiagnosticsClusterNeighborTableStruct new]; - newElement_0.extAddress = [NSNumber numberWithUnsignedLongLong:entry_0.extAddress]; - newElement_0.age = [NSNumber numberWithUnsignedInt:entry_0.age]; - newElement_0.rloc16 = [NSNumber numberWithUnsignedShort:entry_0.rloc16]; - newElement_0.linkFrameCounter = [NSNumber numberWithUnsignedInt:entry_0.linkFrameCounter]; - newElement_0.mleFrameCounter = [NSNumber numberWithUnsignedInt:entry_0.mleFrameCounter]; - newElement_0.lqi = [NSNumber numberWithUnsignedChar:entry_0.lqi]; - if (entry_0.averageRssi.IsNull()) { - newElement_0.averageRssi = nil; - } else { - newElement_0.averageRssi = [NSNumber numberWithChar:entry_0.averageRssi.Value()]; - } - if (entry_0.lastRssi.IsNull()) { - newElement_0.lastRssi = nil; - } else { - newElement_0.lastRssi = [NSNumber numberWithChar:entry_0.lastRssi.Value()]; - } - newElement_0.frameErrorRate = [NSNumber numberWithUnsignedChar:entry_0.frameErrorRate]; - newElement_0.messageErrorRate = [NSNumber numberWithUnsignedChar:entry_0.messageErrorRate]; - newElement_0.rxOnWhenIdle = [NSNumber numberWithBool:entry_0.rxOnWhenIdle]; - newElement_0.fullThreadDevice = [NSNumber numberWithBool:entry_0.fullThreadDevice]; - newElement_0.fullNetworkData = [NSNumber numberWithBool:entry_0.fullNetworkData]; - newElement_0.isChild = [NSNumber numberWithBool:entry_0.isChild]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::RouteTable::Id: { - using TypeInfo = Attributes::RouteTable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRThreadNetworkDiagnosticsClusterRouteTableStruct * newElement_0; - newElement_0 = [MTRThreadNetworkDiagnosticsClusterRouteTableStruct new]; - newElement_0.extAddress = [NSNumber numberWithUnsignedLongLong:entry_0.extAddress]; - newElement_0.rloc16 = [NSNumber numberWithUnsignedShort:entry_0.rloc16]; - newElement_0.routerId = [NSNumber numberWithUnsignedChar:entry_0.routerId]; - newElement_0.nextHop = [NSNumber numberWithUnsignedChar:entry_0.nextHop]; - newElement_0.pathCost = [NSNumber numberWithUnsignedChar:entry_0.pathCost]; - newElement_0.lqiIn = [NSNumber numberWithUnsignedChar:entry_0.LQIIn]; - newElement_0.lqiOut = [NSNumber numberWithUnsignedChar:entry_0.LQIOut]; - newElement_0.age = [NSNumber numberWithUnsignedChar:entry_0.age]; - newElement_0.allocated = [NSNumber numberWithBool:entry_0.allocated]; - newElement_0.linkEstablished = [NSNumber numberWithBool:entry_0.linkEstablished]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::PartitionId::Id: { - using TypeInfo = Attributes::PartitionId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::Weighting::Id: { - using TypeInfo = Attributes::Weighting::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::DataVersion::Id: { - using TypeInfo = Attributes::DataVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::StableDataVersion::Id: { - using TypeInfo = Attributes::StableDataVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::LeaderRouterId::Id: { - using TypeInfo = Attributes::LeaderRouterId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::DetachedRoleCount::Id: { - using TypeInfo = Attributes::DetachedRoleCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ChildRoleCount::Id: { - using TypeInfo = Attributes::ChildRoleCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::RouterRoleCount::Id: { - using TypeInfo = Attributes::RouterRoleCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::LeaderRoleCount::Id: { - using TypeInfo = Attributes::LeaderRoleCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::AttachAttemptCount::Id: { - using TypeInfo = Attributes::AttachAttemptCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::PartitionIdChangeCount::Id: { - using TypeInfo = Attributes::PartitionIdChangeCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::BetterPartitionAttachAttemptCount::Id: { - using TypeInfo = Attributes::BetterPartitionAttachAttemptCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ParentChangeCount::Id: { - using TypeInfo = Attributes::ParentChangeCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::TxTotalCount::Id: { - using TypeInfo = Attributes::TxTotalCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxUnicastCount::Id: { - using TypeInfo = Attributes::TxUnicastCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxBroadcastCount::Id: { - using TypeInfo = Attributes::TxBroadcastCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxAckRequestedCount::Id: { - using TypeInfo = Attributes::TxAckRequestedCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxAckedCount::Id: { - using TypeInfo = Attributes::TxAckedCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxNoAckRequestedCount::Id: { - using TypeInfo = Attributes::TxNoAckRequestedCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxDataCount::Id: { - using TypeInfo = Attributes::TxDataCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxDataPollCount::Id: { - using TypeInfo = Attributes::TxDataPollCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxBeaconCount::Id: { - using TypeInfo = Attributes::TxBeaconCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxBeaconRequestCount::Id: { - using TypeInfo = Attributes::TxBeaconRequestCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxOtherCount::Id: { - using TypeInfo = Attributes::TxOtherCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxRetryCount::Id: { - using TypeInfo = Attributes::TxRetryCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxDirectMaxRetryExpiryCount::Id: { - using TypeInfo = Attributes::TxDirectMaxRetryExpiryCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxIndirectMaxRetryExpiryCount::Id: { - using TypeInfo = Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxErrCcaCount::Id: { - using TypeInfo = Attributes::TxErrCcaCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxErrAbortCount::Id: { - using TypeInfo = Attributes::TxErrAbortCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::TxErrBusyChannelCount::Id: { - using TypeInfo = Attributes::TxErrBusyChannelCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxTotalCount::Id: { - using TypeInfo = Attributes::RxTotalCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxUnicastCount::Id: { - using TypeInfo = Attributes::RxUnicastCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxBroadcastCount::Id: { - using TypeInfo = Attributes::RxBroadcastCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxDataCount::Id: { - using TypeInfo = Attributes::RxDataCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxDataPollCount::Id: { - using TypeInfo = Attributes::RxDataPollCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxBeaconCount::Id: { - using TypeInfo = Attributes::RxBeaconCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxBeaconRequestCount::Id: { - using TypeInfo = Attributes::RxBeaconRequestCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxOtherCount::Id: { - using TypeInfo = Attributes::RxOtherCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxAddressFilteredCount::Id: { - using TypeInfo = Attributes::RxAddressFilteredCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxDestAddrFilteredCount::Id: { - using TypeInfo = Attributes::RxDestAddrFilteredCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxDuplicatedCount::Id: { - using TypeInfo = Attributes::RxDuplicatedCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrNoFrameCount::Id: { - using TypeInfo = Attributes::RxErrNoFrameCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrUnknownNeighborCount::Id: { - using TypeInfo = Attributes::RxErrUnknownNeighborCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrInvalidSrcAddrCount::Id: { - using TypeInfo = Attributes::RxErrInvalidSrcAddrCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrSecCount::Id: { - using TypeInfo = Attributes::RxErrSecCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrFcsCount::Id: { - using TypeInfo = Attributes::RxErrFcsCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::RxErrOtherCount::Id: { - using TypeInfo = Attributes::RxErrOtherCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ActiveTimestamp::Id: { - using TypeInfo = Attributes::ActiveTimestamp::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::PendingTimestamp::Id: { - using TypeInfo = Attributes::PendingTimestamp::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::Delay::Id: { - using TypeInfo = Attributes::Delay::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::SecurityPolicy::Id: { - using TypeInfo = Attributes::SecurityPolicy::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRThreadNetworkDiagnosticsClusterSecurityPolicy * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [MTRThreadNetworkDiagnosticsClusterSecurityPolicy new]; - value.rotationTime = [NSNumber numberWithUnsignedShort:cppValue.Value().rotationTime]; - value.flags = [NSNumber numberWithUnsignedShort:cppValue.Value().flags]; - } - return value; - } - case Attributes::ChannelPage0Mask::Id: { - using TypeInfo = Attributes::ChannelPage0Mask::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSData * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsData(cppValue.Value()); - } - return value; - } - case Attributes::OperationalDatasetComponents::Id: { - using TypeInfo = Attributes::OperationalDatasetComponents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents new]; - value.activeTimestampPresent = [NSNumber numberWithBool:cppValue.Value().activeTimestampPresent]; - value.pendingTimestampPresent = [NSNumber numberWithBool:cppValue.Value().pendingTimestampPresent]; - value.masterKeyPresent = [NSNumber numberWithBool:cppValue.Value().masterKeyPresent]; - value.networkNamePresent = [NSNumber numberWithBool:cppValue.Value().networkNamePresent]; - value.extendedPanIdPresent = [NSNumber numberWithBool:cppValue.Value().extendedPanIdPresent]; - value.meshLocalPrefixPresent = [NSNumber numberWithBool:cppValue.Value().meshLocalPrefixPresent]; - value.delayPresent = [NSNumber numberWithBool:cppValue.Value().delayPresent]; - value.panIdPresent = [NSNumber numberWithBool:cppValue.Value().panIdPresent]; - value.channelPresent = [NSNumber numberWithBool:cppValue.Value().channelPresent]; - value.pskcPresent = [NSNumber numberWithBool:cppValue.Value().pskcPresent]; - value.securityPolicyPresent = [NSNumber numberWithBool:cppValue.Value().securityPolicyPresent]; - value.channelMaskPresent = [NSNumber numberWithBool:cppValue.Value().channelMaskPresent]; - } - return value; - } - case Attributes::ActiveNetworkFaultsList::Id: { - using TypeInfo = Attributes::ActiveNetworkFaultsList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForWiFiNetworkDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::WiFiNetworkDiagnostics; - switch (aAttributeId) { - case Attributes::Bssid::Id: { - using TypeInfo = Attributes::Bssid::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSData * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsData(cppValue.Value()); - } - return value; - } - case Attributes::SecurityType::Id: { - using TypeInfo = Attributes::SecurityType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::WiFiVersion::Id: { - using TypeInfo = Attributes::WiFiVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::ChannelNumber::Id: { - using TypeInfo = Attributes::ChannelNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::Rssi::Id: { - using TypeInfo = Attributes::Rssi::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithChar:cppValue.Value()]; - } - return value; - } - case Attributes::BeaconLostCount::Id: { - using TypeInfo = Attributes::BeaconLostCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::BeaconRxCount::Id: { - using TypeInfo = Attributes::BeaconRxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::PacketMulticastRxCount::Id: { - using TypeInfo = Attributes::PacketMulticastRxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::PacketMulticastTxCount::Id: { - using TypeInfo = Attributes::PacketMulticastTxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::PacketUnicastRxCount::Id: { - using TypeInfo = Attributes::PacketUnicastRxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::PacketUnicastTxCount::Id: { - using TypeInfo = Attributes::PacketUnicastTxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::CurrentMaxRate::Id: { - using TypeInfo = Attributes::CurrentMaxRate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::OverrunCount::Id: { - using TypeInfo = Attributes::OverrunCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForEthernetNetworkDiagnosticsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::EthernetNetworkDiagnostics; - switch (aAttributeId) { - case Attributes::PHYRate::Id: { - using TypeInfo = Attributes::PHYRate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } - return value; - } - case Attributes::FullDuplex::Id: { - using TypeInfo = Attributes::FullDuplex::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithBool:cppValue.Value()]; - } - return value; - } - case Attributes::PacketRxCount::Id: { - using TypeInfo = Attributes::PacketRxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::PacketTxCount::Id: { - using TypeInfo = Attributes::PacketTxCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::TxErrCount::Id: { - using TypeInfo = Attributes::TxErrCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::CollisionCount::Id: { - using TypeInfo = Attributes::CollisionCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::OverrunCount::Id: { - using TypeInfo = Attributes::OverrunCount::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::CarrierDetect::Id: { - using TypeInfo = Attributes::CarrierDetect::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithBool:cppValue.Value()]; - } - return value; - } - case Attributes::TimeSinceReset::Id: { - using TypeInfo = Attributes::TimeSinceReset::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForTimeSynchronizationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::TimeSynchronization; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::UTCTime::Id: { - using TypeInfo = Attributes::UTCTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Granularity::Id: { - using TypeInfo = Attributes::Granularity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TimeSource::Id: { - using TypeInfo = Attributes::TimeSource::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TrustedTimeSource::Id: { - using TypeInfo = Attributes::TrustedTimeSource::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRTimeSynchronizationClusterTrustedTimeSourceStruct * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [MTRTimeSynchronizationClusterTrustedTimeSourceStruct new]; - value.fabricIndex = [NSNumber numberWithUnsignedChar:cppValue.Value().fabricIndex]; - value.nodeID = [NSNumber numberWithUnsignedLongLong:cppValue.Value().nodeID]; - value.endpoint = [NSNumber numberWithUnsignedShort:cppValue.Value().endpoint]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DefaultNTP::Id: { - using TypeInfo = Attributes::DefaultNTP::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = AsString(cppValue.Value()); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TimeZone::Id: { - using TypeInfo = Attributes::TimeZone::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRTimeSynchronizationClusterTimeZoneStruct * newElement_0; - newElement_0 = [MTRTimeSynchronizationClusterTimeZoneStruct new]; - newElement_0.offset = [NSNumber numberWithInt:entry_0.offset]; - newElement_0.validAt = [NSNumber numberWithUnsignedLongLong:entry_0.validAt]; - if (entry_0.name.HasValue()) { - newElement_0.name = AsString(entry_0.name.Value()); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.name = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DSTOffset::Id: { - using TypeInfo = Attributes::DSTOffset::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRTimeSynchronizationClusterDSTOffsetStruct * newElement_0; - newElement_0 = [MTRTimeSynchronizationClusterDSTOffsetStruct new]; - newElement_0.offset = [NSNumber numberWithInt:entry_0.offset]; - newElement_0.validStarting = [NSNumber numberWithUnsignedLongLong:entry_0.validStarting]; - if (entry_0.validUntil.IsNull()) { - newElement_0.validUntil = nil; - } else { - newElement_0.validUntil = [NSNumber numberWithUnsignedLongLong:entry_0.validUntil.Value()]; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LocalTime::Id: { - using TypeInfo = Attributes::LocalTime::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TimeZoneDatabase::Id: { - using TypeInfo = Attributes::TimeZoneDatabase::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::NTPServerAvailable::Id: { - using TypeInfo = Attributes::NTPServerAvailable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TimeZoneListMaxSize::Id: { - using TypeInfo = Attributes::TimeZoneListMaxSize::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DSTOffsetListMaxSize::Id: { - using TypeInfo = Attributes::DSTOffsetListMaxSize::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportsDNSResolve::Id: { - using TypeInfo = Attributes::SupportsDNSResolve::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBridgedDeviceBasicInformationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BridgedDeviceBasicInformation; - switch (aAttributeId) { - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ProductName::Id: { - using TypeInfo = Attributes::ProductName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::NodeLabel::Id: { - using TypeInfo = Attributes::NodeLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::HardwareVersion::Id: { - using TypeInfo = Attributes::HardwareVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::HardwareVersionString::Id: { - using TypeInfo = Attributes::HardwareVersionString::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SoftwareVersion::Id: { - using TypeInfo = Attributes::SoftwareVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::SoftwareVersionString::Id: { - using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ManufacturingDate::Id: { - using TypeInfo = Attributes::ManufacturingDate::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::PartNumber::Id: { - using TypeInfo = Attributes::PartNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductURL::Id: { - using TypeInfo = Attributes::ProductURL::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductLabel::Id: { - using TypeInfo = Attributes::ProductLabel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::SerialNumber::Id: { - using TypeInfo = Attributes::SerialNumber::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::Reachable::Id: { - using TypeInfo = Attributes::Reachable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::UniqueID::Id: { - using TypeInfo = Attributes::UniqueID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductAppearance::Id: { - using TypeInfo = Attributes::ProductAppearance::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct * _Nonnull value; - value = [MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct new]; - value.finish = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.finish)]; - if (cppValue.primaryColor.IsNull()) { - value.primaryColor = nil; - } else { - value.primaryColor = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.primaryColor.Value())]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForSwitchCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Switch; - switch (aAttributeId) { - case Attributes::NumberOfPositions::Id: { - using TypeInfo = Attributes::NumberOfPositions::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::CurrentPosition::Id: { - using TypeInfo = Attributes::CurrentPosition::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::MultiPressMax::Id: { - using TypeInfo = Attributes::MultiPressMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForAdministratorCommissioningCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::AdministratorCommissioning; - switch (aAttributeId) { - case Attributes::WindowStatus::Id: { - using TypeInfo = Attributes::WindowStatus::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::AdminFabricIndex::Id: { - using TypeInfo = Attributes::AdminFabricIndex::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::AdminVendorId::Id: { - using TypeInfo = Attributes::AdminVendorId::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOperationalCredentialsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OperationalCredentials; - switch (aAttributeId) { - case Attributes::NOCs::Id: { - using TypeInfo = Attributes::NOCs::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTROperationalCredentialsClusterNOCStruct * newElement_0; - newElement_0 = [MTROperationalCredentialsClusterNOCStruct new]; - newElement_0.noc = AsData(entry_0.noc); - if (entry_0.icac.IsNull()) { - newElement_0.icac = nil; - } else { - newElement_0.icac = AsData(entry_0.icac.Value()); - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::Fabrics::Id: { - using TypeInfo = Attributes::Fabrics::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTROperationalCredentialsClusterFabricDescriptorStruct * newElement_0; - newElement_0 = [MTROperationalCredentialsClusterFabricDescriptorStruct new]; - newElement_0.rootPublicKey = AsData(entry_0.rootPublicKey); - newElement_0.vendorID = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0.vendorID)]; - newElement_0.fabricID = [NSNumber numberWithUnsignedLongLong:entry_0.fabricID]; - newElement_0.nodeID = [NSNumber numberWithUnsignedLongLong:entry_0.nodeID]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::SupportedFabrics::Id: { - using TypeInfo = Attributes::SupportedFabrics::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::CommissionedFabrics::Id: { - using TypeInfo = Attributes::CommissionedFabrics::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::TrustedRootCertificates::Id: { - using TypeInfo = Attributes::TrustedRootCertificates::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSData * newElement_0; - newElement_0 = AsData(entry_0); - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::CurrentFabricIndex::Id: { - using TypeInfo = Attributes::CurrentFabricIndex::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForGroupKeyManagementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::GroupKeyManagement; - switch (aAttributeId) { - case Attributes::GroupKeyMap::Id: { - using TypeInfo = Attributes::GroupKeyMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRGroupKeyManagementClusterGroupKeyMapStruct * newElement_0; - newElement_0 = [MTRGroupKeyManagementClusterGroupKeyMapStruct new]; - newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; - newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GroupTable::Id: { - using TypeInfo = Attributes::GroupTable::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRGroupKeyManagementClusterGroupInfoMapStruct * newElement_0; - newElement_0 = [MTRGroupKeyManagementClusterGroupInfoMapStruct new]; - newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; - { // Scope for our temporary variables - 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]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.endpoints = array_2; - } - if (entry_0.groupName.HasValue()) { - newElement_0.groupName = AsString(entry_0.groupName.Value()); - if (newElement_0.groupName == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.groupName = nil; - } - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::MaxGroupsPerFabric::Id: { - using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::MaxGroupKeysPerFabric::Id: { - using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForFixedLabelCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::FixedLabel; - switch (aAttributeId) { - case Attributes::LabelList::Id: { - using TypeInfo = Attributes::LabelList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRFixedLabelClusterLabelStruct * newElement_0; - newElement_0 = [MTRFixedLabelClusterLabelStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.value = AsString(entry_0.value); - if (newElement_0.value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForUserLabelCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::UserLabel; - switch (aAttributeId) { - case Attributes::LabelList::Id: { - using TypeInfo = Attributes::LabelList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRUserLabelClusterLabelStruct * newElement_0; - newElement_0 = [MTRUserLabelClusterLabelStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.value = AsString(entry_0.value); - if (newElement_0.value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBooleanStateCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BooleanState; - switch (aAttributeId) { - case Attributes::StateValue::Id: { - using TypeInfo = Attributes::StateValue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForICDManagementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::IcdManagement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::IdleModeInterval::Id: { - using TypeInfo = Attributes::IdleModeInterval::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ActiveModeInterval::Id: { - using TypeInfo = Attributes::ActiveModeInterval::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ActiveModeThreshold::Id: { - using TypeInfo = Attributes::ActiveModeThreshold::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::RegisteredClients::Id: { - using TypeInfo = Attributes::RegisteredClients::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRICDManagementClusterMonitoringRegistrationStruct * newElement_0; - newElement_0 = [MTRICDManagementClusterMonitoringRegistrationStruct new]; - newElement_0.checkInNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.checkInNodeID]; - newElement_0.monitoredSubject = [NSNumber numberWithUnsignedLongLong:entry_0.monitoredSubject]; - newElement_0.key = AsData(entry_0.key); - newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ICDCounter::Id: { - using TypeInfo = Attributes::ICDCounter::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClientsSupportedPerFabric::Id: { - using TypeInfo = Attributes::ClientsSupportedPerFabric::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForModeSelectCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::ModeSelect; - switch (aAttributeId) { - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::StandardNamespace::Id: { - using TypeInfo = Attributes::StandardNamespace::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRModeSelectClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRModeSelectClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.semanticTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRModeSelectClusterSemanticTagStruct * newElement_2; - newElement_2 = [MTRModeSelectClusterSemanticTagStruct new]; - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode)]; - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.semanticTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForLaundryWasherModeCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::LaundryWasherMode; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRLaundryWasherModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRLaundryWasherModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRLaundryWasherModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRLaundryWasherModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.modeTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRefrigeratorAndTemperatureControlledCabinetModeCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RefrigeratorAndTemperatureControlledCabinetMode; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.modeTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForLaundryWasherControlsCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::LaundryWasherControls; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SpinSpeeds::Id: { - using TypeInfo = Attributes::SpinSpeeds::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSString * newElement_0; - newElement_0 = AsString(entry_0); - if (newElement_0 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SpinSpeedCurrent::Id: { - using TypeInfo = Attributes::SpinSpeedCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::NumberOfRinses::Id: { - using TypeInfo = Attributes::NumberOfRinses::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedRinses::Id: { - using TypeInfo = Attributes::SupportedRinses::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRVCRunModeCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RvcRunMode; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRRVCRunModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRRVCRunModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRRVCRunModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRRVCRunModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.modeTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRVCCleanModeCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RvcCleanMode; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRRVCCleanModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRRVCCleanModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRRVCCleanModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRRVCCleanModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; - } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; - } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - newElement_0.modeTags = array_2; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForTemperatureControlCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::TemperatureControl; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::TemperatureSetpoint::Id: { - using TypeInfo = Attributes::TemperatureSetpoint::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinTemperature::Id: { - using TypeInfo = Attributes::MinTemperature::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxTemperature::Id: { - using TypeInfo = Attributes::MaxTemperature::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Step::Id: { - using TypeInfo = Attributes::Step::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SelectedTemperatureLevel::Id: { - using TypeInfo = Attributes::SelectedTemperatureLevel::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedTemperatureLevels::Id: { - using TypeInfo = Attributes::SupportedTemperatureLevels::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSString * newElement_0; - newElement_0 = AsString(entry_0); - if (newElement_0 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRefrigeratorAlarmCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RefrigeratorAlarm; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::Mask::Id: { - using TypeInfo = Attributes::Mask::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::State::Id: { - using TypeInfo = Attributes::State::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Supported::Id: { - using TypeInfo = Attributes::Supported::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -11896,14 +1002,13 @@ static id _Nullable DecodeAttributeValueForRefrigeratorAlarmCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForDishwasherModeCluster( +static id _Nullable DecodeAttributeValueForAccessControlCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::DishwasherMode; + using namespace Clusters::AccessControl; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::SupportedModes::Id: { - using TypeInfo = Attributes::SupportedModes::TypeInfo; + case Attributes::Acl::Id: { + using TypeInfo = Attributes::Acl::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -11915,37 +1020,66 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRDishwasherModeClusterModeOptionStruct * newElement_0; - newElement_0 = [MTRDishwasherModeClusterModeOptionStruct new]; - newElement_0.label = AsString(entry_0.label); - if (newElement_0.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; - { // Scope for our temporary variables - auto * array_2 = [NSMutableArray new]; - auto iter_2 = entry_0.modeTags.begin(); - while (iter_2.Next()) { - auto & entry_2 = iter_2.GetValue(); - MTRDishwasherModeClusterModeTagStruct * newElement_2; - newElement_2 = [MTRDishwasherModeClusterModeTagStruct new]; - if (entry_2.mfgCode.HasValue()) { - newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; - } else { - newElement_2.mfgCode = nil; + MTRAccessControlClusterAccessControlEntryStruct * newElement_0; + newElement_0 = [MTRAccessControlClusterAccessControlEntryStruct new]; + newElement_0.privilege = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.privilege)]; + newElement_0.authMode = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.authMode)]; + if (entry_0.subjects.IsNull()) { + newElement_0.subjects = nil; + } else { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.subjects.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + NSNumber * newElement_3; + newElement_3 = [NSNumber numberWithUnsignedLongLong:entry_3]; + [array_3 addObject:newElement_3]; } - newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; - [array_2 addObject:newElement_2]; + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.subjects = array_3; } - CHIP_ERROR err = iter_2.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; + } + if (entry_0.targets.IsNull()) { + newElement_0.targets = nil; + } else { + { // Scope for our temporary variables + auto * array_3 = [NSMutableArray new]; + auto iter_3 = entry_0.targets.Value().begin(); + while (iter_3.Next()) { + auto & entry_3 = iter_3.GetValue(); + MTRAccessControlClusterAccessControlTargetStruct * newElement_3; + newElement_3 = [MTRAccessControlClusterAccessControlTargetStruct new]; + if (entry_3.cluster.IsNull()) { + newElement_3.cluster = nil; + } else { + newElement_3.cluster = [NSNumber numberWithUnsignedInt:entry_3.cluster.Value()]; + } + if (entry_3.endpoint.IsNull()) { + newElement_3.endpoint = nil; + } else { + newElement_3.endpoint = [NSNumber numberWithUnsignedShort:entry_3.endpoint.Value()]; + } + if (entry_3.deviceType.IsNull()) { + newElement_3.deviceType = nil; + } else { + newElement_3.deviceType = [NSNumber numberWithUnsignedInt:entry_3.deviceType.Value()]; + } + [array_3 addObject:newElement_3]; + } + CHIP_ERROR err = iter_3.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.targets = array_3; } - newElement_0.modeTags = array_2; } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -11957,113 +1091,8 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentMode::Id: { - using TypeInfo = Attributes::CurrentMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::StartUpMode::Id: { - using TypeInfo = Attributes::StartUpMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OnMode::Id: { - using TypeInfo = Attributes::OnMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Extension::Id: { + using TypeInfo = Attributes::Extension::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12075,8 +1104,10 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRAccessControlClusterAccessControlExtensionStruct * newElement_0; + newElement_0 = [MTRAccessControlClusterAccessControlExtensionStruct new]; + newElement_0.data = AsData(entry_0.data); + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12088,51 +1119,30 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::SubjectsPerAccessControlEntry::Id: { + using TypeInfo = Attributes::SubjectsPerAccessControlEntry::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::TargetsPerAccessControlEntry::Id: { + using TypeInfo = Attributes::TargetsPerAccessControlEntry::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::AccessControlEntriesPerFabric::Id: { + using TypeInfo = Attributes::AccessControlEntriesPerFabric::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12142,7 +1152,6 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -12151,27 +1160,12 @@ static id _Nullable DecodeAttributeValueForDishwasherModeCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForAirQualityCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForActionsCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::AirQuality; + using namespace Clusters::Actions; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::AirQuality::Id: { - using TypeInfo = Attributes::AirQuality::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ActionList::Id: { + using TypeInfo = Attributes::ActionList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12183,8 +1177,19 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRActionsClusterActionStruct * newElement_0; + newElement_0 = [MTRActionsClusterActionStruct new]; + newElement_0.actionID = [NSNumber numberWithUnsignedShort:entry_0.actionID]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; + newElement_0.endpointListID = [NSNumber numberWithUnsignedShort:entry_0.endpointListID]; + newElement_0.supportedCommands = [NSNumber numberWithUnsignedShort:entry_0.supportedCommands.Raw()]; + newElement_0.state = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.state)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12196,10 +1201,8 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::EndpointLists::Id: { + using TypeInfo = Attributes::EndpointLists::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12211,8 +1214,32 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRActionsClusterEndpointListStruct * newElement_0; + newElement_0 = [MTRActionsClusterEndpointListStruct new]; + newElement_0.endpointListID = [NSNumber numberWithUnsignedShort:entry_0.endpointListID]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; + { // Scope for our temporary variables + 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]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.endpoints = array_2; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12224,79 +1251,91 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SetupURL::Id: { + using TypeInfo = Attributes::SetupURL::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForBasicInformationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::BasicInformation; + switch (aAttributeId) { + case Attributes::DataModelRevision::Id: { + using TypeInfo = Attributes::DataModelRevision::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ProductName::Id: { + using TypeInfo = Attributes::ProductName::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::ProductID::Id: { + using TypeInfo = Attributes::ProductID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12306,248 +1345,268 @@ static id _Nullable DecodeAttributeValueForAirQualityCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } + case Attributes::NodeLabel::Id: { + using TypeInfo = Attributes::NodeLabel::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::SmokeCoAlarm; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::ExpressedState::Id: { - using TypeInfo = Attributes::ExpressedState::TypeInfo; + case Attributes::Location::Id: { + using TypeInfo = Attributes::Location::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SmokeState::Id: { - using TypeInfo = Attributes::SmokeState::TypeInfo; + case Attributes::HardwareVersion::Id: { + using TypeInfo = Attributes::HardwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::COState::Id: { - using TypeInfo = Attributes::COState::TypeInfo; + case Attributes::HardwareVersionString::Id: { + using TypeInfo = Attributes::HardwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::BatteryAlert::Id: { - using TypeInfo = Attributes::BatteryAlert::TypeInfo; + case Attributes::SoftwareVersion::Id: { + using TypeInfo = Attributes::SoftwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DeviceMuted::Id: { - using TypeInfo = Attributes::DeviceMuted::TypeInfo; + case Attributes::SoftwareVersionString::Id: { + using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::TestInProgress::Id: { - using TypeInfo = Attributes::TestInProgress::TypeInfo; + case Attributes::ManufacturingDate::Id: { + using TypeInfo = Attributes::ManufacturingDate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::HardwareFaultAlert::Id: { - using TypeInfo = Attributes::HardwareFaultAlert::TypeInfo; + case Attributes::PartNumber::Id: { + using TypeInfo = Attributes::PartNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EndOfServiceAlert::Id: { - using TypeInfo = Attributes::EndOfServiceAlert::TypeInfo; + case Attributes::ProductURL::Id: { + using TypeInfo = Attributes::ProductURL::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::InterconnectSmokeAlarm::Id: { - using TypeInfo = Attributes::InterconnectSmokeAlarm::TypeInfo; + case Attributes::ProductLabel::Id: { + using TypeInfo = Attributes::ProductLabel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::InterconnectCOAlarm::Id: { - using TypeInfo = Attributes::InterconnectCOAlarm::TypeInfo; + case Attributes::SerialNumber::Id: { + using TypeInfo = Attributes::SerialNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ContaminationState::Id: { - using TypeInfo = Attributes::ContaminationState::TypeInfo; + case Attributes::LocalConfigDisabled::Id: { + using TypeInfo = Attributes::LocalConfigDisabled::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::SmokeSensitivityLevel::Id: { - using TypeInfo = Attributes::SmokeSensitivityLevel::TypeInfo; + case Attributes::Reachable::Id: { + using TypeInfo = Attributes::Reachable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ExpiryDate::Id: { - using TypeInfo = Attributes::ExpiryDate::TypeInfo; + case Attributes::UniqueID::Id: { + using TypeInfo = Attributes::UniqueID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::CapabilityMinima::Id: { + using TypeInfo = Attributes::CapabilityMinima::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + MTRBasicInformationClusterCapabilityMinimaStruct * _Nonnull value; + value = [MTRBasicInformationClusterCapabilityMinimaStruct new]; + value.caseSessionsPerFabric = [NSNumber numberWithUnsignedShort:cppValue.caseSessionsPerFabric]; + value.subscriptionsPerFabric = [NSNumber numberWithUnsignedShort:cppValue.subscriptionsPerFabric]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ProductAppearance::Id: { + using TypeInfo = Attributes::ProductAppearance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + MTRBasicInformationClusterProductAppearanceStruct * _Nonnull value; + value = [MTRBasicInformationClusterProductAppearanceStruct new]; + value.finish = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.finish)]; + if (cppValue.primaryColor.IsNull()) { + value.primaryColor = nil; + } else { + value.primaryColor = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.primaryColor.Value())]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOTASoftwareUpdateProviderCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OtaSoftwareUpdateProvider; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOTASoftwareUpdateRequestorCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OtaSoftwareUpdateRequestor; + switch (aAttributeId) { + case Attributes::DefaultOTAProviders::Id: { + using TypeInfo = Attributes::DefaultOTAProviders::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12559,8 +1618,11 @@ static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTROTASoftwareUpdateRequestorClusterProviderLocation * newElement_0; + newElement_0 = [MTROTASoftwareUpdateRequestorClusterProviderLocation new]; + newElement_0.providerNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.providerNodeID]; + newElement_0.endpoint = [NSNumber numberWithUnsignedShort:entry_0.endpoint]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12572,61 +1634,43 @@ static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::UpdatePossible::Id: { + using TypeInfo = Attributes::UpdatePossible::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::UpdateState::Id: { + using TypeInfo = Attributes::UpdateState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::UpdateStateProgress::Id: { + using TypeInfo = Attributes::UpdateStateProgress::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -12635,66 +1679,95 @@ static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( +static id _Nullable DecodeAttributeValueForLocalizationConfigurationCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::DishwasherAlarm; + using namespace Clusters::LocalizationConfiguration; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::Mask::Id: { - using TypeInfo = Attributes::Mask::TypeInfo; + case Attributes::ActiveLocale::Id: { + using TypeInfo = Attributes::ActiveLocale::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Latch::Id: { - using TypeInfo = Attributes::Latch::TypeInfo; + case Attributes::SupportedLocales::Id: { + using TypeInfo = Attributes::SupportedLocales::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSString * newElement_0; + newElement_0 = AsString(entry_0); + if (newElement_0 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::State::Id: { - using TypeInfo = Attributes::State::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTimeFormatLocalizationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TimeFormatLocalization; + switch (aAttributeId) { + case Attributes::HourFormat::Id: { + using TypeInfo = Attributes::HourFormat::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Supported::Id: { - using TypeInfo = Attributes::Supported::TypeInfo; + case Attributes::ActiveCalendarType::Id: { + using TypeInfo = Attributes::ActiveCalendarType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::SupportedCalendarTypes::Id: { + using TypeInfo = Attributes::SupportedCalendarTypes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12707,7 +1780,7 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12719,10 +1792,45 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForUnitLocalizationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::UnitLocalization; + switch (aAttributeId) { + case Attributes::TemperatureUnit::Id: { + using TypeInfo = Attributes::TemperatureUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPowerSourceConfigurationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PowerSourceConfiguration; + switch (aAttributeId) { + case Attributes::Sources::Id: { + using TypeInfo = Attributes::Sources::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12735,7 +1843,7 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:entry_0]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12747,176 +1855,148 @@ static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPowerSourceCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PowerSource; + switch (aAttributeId) { + case Attributes::Status::Id: { + using TypeInfo = Attributes::Status::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::Order::Id: { + using TypeInfo = Attributes::Order::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::Description::Id: { + using TypeInfo = Attributes::Description::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::WiredAssessedInputVoltage::Id: { + using TypeInfo = Attributes::WiredAssessedInputVoltage::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } + return value; + } + case Attributes::WiredAssessedInputFrequency::Id: { + using TypeInfo = Attributes::WiredAssessedInputFrequency::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::WiredCurrentType::Id: { + using TypeInfo = Attributes::WiredCurrentType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOperationalStateCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OperationalState; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::PhaseList::Id: { - using TypeInfo = Attributes::PhaseList::TypeInfo; + case Attributes::WiredAssessedCurrent::Id: { + using TypeInfo = Attributes::WiredAssessedCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = cppValue.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - NSString * newElement_1; - newElement_1 = AsString(entry_1); - if (newElement_1 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_1; - } + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentPhase::Id: { - using TypeInfo = Attributes::CurrentPhase::TypeInfo; + case Attributes::WiredNominalVoltage::Id: { + using TypeInfo = Attributes::WiredNominalVoltage::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CountdownTime::Id: { - using TypeInfo = Attributes::CountdownTime::TypeInfo; + case Attributes::WiredMaximumCurrent::Id: { + using TypeInfo = Attributes::WiredMaximumCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::WiredPresent::Id: { + using TypeInfo = Attributes::WiredPresent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalStateList::Id: { - using TypeInfo = Attributes::OperationalStateList::TypeInfo; + case Attributes::ActiveWiredFaults::Id: { + using TypeInfo = Attributes::ActiveWiredFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12928,19 +2008,8 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTROperationalStateClusterOperationalStateStruct * newElement_0; - newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; - if (entry_0.operationalStateLabel.HasValue()) { - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.operationalStateLabel = nil; - } + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -12952,141 +2021,97 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalState::Id: { - using TypeInfo = Attributes::OperationalState::TypeInfo; + case Attributes::BatVoltage::Id: { + using TypeInfo = Attributes::BatVoltage::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalError::Id: { - using TypeInfo = Attributes::OperationalError::TypeInfo; + case Attributes::BatPercentRemaining::Id: { + using TypeInfo = Attributes::BatPercentRemaining::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTROperationalStateClusterErrorStateStruct * _Nonnull value; - value = [MTROperationalStateClusterErrorStateStruct new]; - value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; - if (cppValue.errorStateLabel.HasValue()) { - value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); - if (value.errorStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.errorStateLabel = nil; - } - if (cppValue.errorStateDetails.HasValue()) { - value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); - if (value.errorStateDetails == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; } else { - value.errorStateDetails = nil; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::BatTimeRemaining::Id: { + using TypeInfo = Attributes::BatTimeRemaining::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::BatChargeLevel::Id: { + using TypeInfo = Attributes::BatChargeLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::BatReplacementNeeded::Id: { + using TypeInfo = Attributes::BatReplacementNeeded::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::BatReplaceability::Id: { + using TypeInfo = Attributes::BatReplaceability::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::BatPresent::Id: { + using TypeInfo = Attributes::BatPresent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + case Attributes::ActiveBatFaults::Id: { + using TypeInfo = Attributes::ActiveBatFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13099,7 +2124,7 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13111,159 +2136,89 @@ static id _Nullable DecodeAttributeValueForOperationalStateCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::BatReplacementDescription::Id: { + using TypeInfo = Attributes::BatReplacementDescription::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::BatCommonDesignation::Id: { + using TypeInfo = Attributes::BatCommonDesignation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RvcOperationalState; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::PhaseList::Id: { - using TypeInfo = Attributes::PhaseList::TypeInfo; + case Attributes::BatANSIDesignation::Id: { + using TypeInfo = Attributes::BatANSIDesignation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = cppValue.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - NSString * newElement_1; - newElement_1 = AsString(entry_1); - if (newElement_1 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_1 addObject:newElement_1]; - } - CHIP_ERROR err = iter_1.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_1; - } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CurrentPhase::Id: { - using TypeInfo = Attributes::CurrentPhase::TypeInfo; + case Attributes::BatIECDesignation::Id: { + using TypeInfo = Attributes::BatIECDesignation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::CountdownTime::Id: { - using TypeInfo = Attributes::CountdownTime::TypeInfo; + case Attributes::BatApprovedChemistry::Id: { + using TypeInfo = Attributes::BatApprovedChemistry::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalStateList::Id: { - using TypeInfo = Attributes::OperationalStateList::TypeInfo; + case Attributes::BatCapacity::Id: { + using TypeInfo = Attributes::BatCapacity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRRVCOperationalStateClusterOperationalStateStruct * newElement_0; - newElement_0 = [MTRRVCOperationalStateClusterOperationalStateStruct new]; - newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; - if (entry_0.operationalStateLabel.HasValue()) { - newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); - if (newElement_0.operationalStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.operationalStateLabel = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalState::Id: { - using TypeInfo = Attributes::OperationalState::TypeInfo; + case Attributes::BatQuantity::Id: { + using TypeInfo = Attributes::BatQuantity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13273,100 +2228,60 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::OperationalError::Id: { - using TypeInfo = Attributes::OperationalError::TypeInfo; + case Attributes::BatChargeState::Id: { + using TypeInfo = Attributes::BatChargeState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull value; - value = [MTRRVCOperationalStateClusterErrorStateStruct new]; - value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; - if (cppValue.errorStateLabel.HasValue()) { - value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); - if (value.errorStateLabel == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.errorStateLabel = nil; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::BatTimeToFullCharge::Id: { + using TypeInfo = Attributes::BatTimeToFullCharge::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } - if (cppValue.errorStateDetails.HasValue()) { - value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); - if (value.errorStateDetails == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; } else { - value.errorStateDetails = nil; + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::BatFunctionalWhileCharging::Id: { + using TypeInfo = Attributes::BatFunctionalWhileCharging::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::BatChargingCurrent::Id: { + using TypeInfo = Attributes::BatChargingCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::ActiveBatChargeFaults::Id: { + using TypeInfo = Attributes::ActiveBatChargeFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13379,7 +2294,7 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13391,10 +2306,9 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::EndpointList::Id: { + using TypeInfo = Attributes::EndpointList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13407,7 +2321,7 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13419,32 +2333,6 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } #endif // MTR_ENABLE_PROVISIONAL default: { break; @@ -13454,27 +2342,37 @@ static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( +static id _Nullable DecodeAttributeValueForGeneralCommissioningCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::HepaFilterMonitoring; + using namespace Clusters::GeneralCommissioning; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::Condition::Id: { - using TypeInfo = Attributes::Condition::TypeInfo; + case Attributes::Breadcrumb::Id: { + using TypeInfo = Attributes::Breadcrumb::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DegradationDirection::Id: { - using TypeInfo = Attributes::DegradationDirection::TypeInfo; + case Attributes::BasicCommissioningInfo::Id: { + using TypeInfo = Attributes::BasicCommissioningInfo::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nonnull value; + value = [MTRGeneralCommissioningClusterBasicCommissioningInfo new]; + value.failSafeExpiryLengthSeconds = [NSNumber numberWithUnsignedShort:cppValue.failSafeExpiryLengthSeconds]; + value.maxCumulativeFailsafeSeconds = [NSNumber numberWithUnsignedShort:cppValue.maxCumulativeFailsafeSeconds]; + return value; + } + case Attributes::RegulatoryConfig::Id: { + using TypeInfo = Attributes::RegulatoryConfig::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13484,10 +2382,8 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ChangeIndication::Id: { - using TypeInfo = Attributes::ChangeIndication::TypeInfo; + case Attributes::LocationCapability::Id: { + using TypeInfo = Attributes::LocationCapability::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13497,10 +2393,8 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::InPlaceIndicator::Id: { - using TypeInfo = Attributes::InPlaceIndicator::TypeInfo; + case Attributes::SupportsConcurrentConnection::Id: { + using TypeInfo = Attributes::SupportsConcurrentConnection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13510,27 +2404,32 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LastChangedTime::Id: { - using TypeInfo = Attributes::LastChangedTime::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForNetworkCommissioningCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::NetworkCommissioning; + switch (aAttributeId) { + case Attributes::MaxNetworks::Id: { + using TypeInfo = Attributes::MaxNetworks::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ReplacementProductList::Id: { - using TypeInfo = Attributes::ReplacementProductList::TypeInfo; + case Attributes::Networks::Id: { + using TypeInfo = Attributes::Networks::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13542,16 +2441,10 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRHEPAFilterMonitoringClusterReplacementProductStruct * newElement_0; - newElement_0 = [MTRHEPAFilterMonitoringClusterReplacementProductStruct new]; - newElement_0.productIdentifierType = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.productIdentifierType)]; - newElement_0.productIdentifierValue = AsString(entry_0.productIdentifierValue); - if (newElement_0.productIdentifierValue == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + MTRNetworkCommissioningClusterNetworkInfoStruct * newElement_0; + newElement_0 = [MTRNetworkCommissioningClusterNetworkInfoStruct new]; + newElement_0.networkID = AsData(entry_0.networkID); + newElement_0.connected = [NSNumber numberWithBool:entry_0.connected]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13563,145 +2456,84 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ScanMaxTimeSeconds::Id: { + using TypeInfo = Attributes::ScanMaxTimeSeconds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ConnectMaxTimeSeconds::Id: { + using TypeInfo = Attributes::ConnectMaxTimeSeconds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::InterfaceEnabled::Id: { + using TypeInfo = Attributes::InterfaceEnabled::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::LastNetworkingStatus::Id: { + using TypeInfo = Attributes::LastNetworkingStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::LastNetworkID::Id: { + using TypeInfo = Attributes::LastNetworkID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::LastConnectErrorValue::Id: { + using TypeInfo = Attributes::LastConnectErrorValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithInt:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -13710,83 +2542,149 @@ static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluster( +static id _Nullable DecodeAttributeValueForDiagnosticLogsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::DiagnosticLogs; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForGeneralDiagnosticsCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ActivatedCarbonFilterMonitoring; + using namespace Clusters::GeneralDiagnostics; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::Condition::Id: { - using TypeInfo = Attributes::Condition::TypeInfo; + case Attributes::NetworkInterfaces::Id: { + using TypeInfo = Attributes::NetworkInterfaces::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRGeneralDiagnosticsClusterNetworkInterface * newElement_0; + newElement_0 = [MTRGeneralDiagnosticsClusterNetworkInterface new]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.isOperational = [NSNumber numberWithBool:entry_0.isOperational]; + if (entry_0.offPremiseServicesReachableIPv4.IsNull()) { + newElement_0.offPremiseServicesReachableIPv4 = nil; + } else { + newElement_0.offPremiseServicesReachableIPv4 = + [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv4.Value()]; + } + if (entry_0.offPremiseServicesReachableIPv6.IsNull()) { + newElement_0.offPremiseServicesReachableIPv6 = nil; + } else { + newElement_0.offPremiseServicesReachableIPv6 = + [NSNumber numberWithBool:entry_0.offPremiseServicesReachableIPv6.Value()]; + } + newElement_0.hardwareAddress = AsData(entry_0.hardwareAddress); + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.IPv4Addresses.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSData * newElement_2; + newElement_2 = AsData(entry_2); + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.iPv4Addresses = array_2; + } + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.IPv6Addresses.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + NSData * newElement_2; + newElement_2 = AsData(entry_2); + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.iPv6Addresses = array_2; + } + newElement_0.type = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.type)]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::DegradationDirection::Id: { - using TypeInfo = Attributes::DegradationDirection::TypeInfo; + case Attributes::RebootCount::Id: { + using TypeInfo = Attributes::RebootCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ChangeIndication::Id: { - using TypeInfo = Attributes::ChangeIndication::TypeInfo; + case Attributes::UpTime::Id: { + using TypeInfo = Attributes::UpTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::InPlaceIndicator::Id: { - using TypeInfo = Attributes::InPlaceIndicator::TypeInfo; + case Attributes::TotalOperationalHours::Id: { + using TypeInfo = Attributes::TotalOperationalHours::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LastChangedTime::Id: { - using TypeInfo = Attributes::LastChangedTime::TypeInfo; + case Attributes::BootReason::Id: { + using TypeInfo = Attributes::BootReason::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ReplacementProductList::Id: { - using TypeInfo = Attributes::ReplacementProductList::TypeInfo; + case Attributes::ActiveHardwareFaults::Id: { + using TypeInfo = Attributes::ActiveHardwareFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13798,16 +2696,8 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - MTRActivatedCarbonFilterMonitoringClusterReplacementProductStruct * newElement_0; - newElement_0 = [MTRActivatedCarbonFilterMonitoringClusterReplacementProductStruct new]; - newElement_0.productIdentifierType = - [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.productIdentifierType)]; - newElement_0.productIdentifierValue = AsString(entry_0.productIdentifierValue); - if (newElement_0.productIdentifierValue == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13819,10 +2709,8 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ActiveRadioFaults::Id: { + using TypeInfo = Attributes::ActiveRadioFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13835,7 +2723,7 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13847,10 +2735,8 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ActiveNetworkFaults::Id: { + using TypeInfo = Attributes::ActiveNetworkFaults::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13863,7 +2749,7 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13875,38 +2761,32 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::TestEventTriggersEnabled::Id: { + using TypeInfo = Attributes::TestEventTriggersEnabled::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForSoftwareDiagnosticsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::SoftwareDiagnostics; + switch (aAttributeId) { + case Attributes::ThreadMetrics::Id: { + using TypeInfo = Attributes::ThreadMetrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13918,8 +2798,34 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRSoftwareDiagnosticsClusterThreadMetricsStruct * newElement_0; + newElement_0 = [MTRSoftwareDiagnosticsClusterThreadMetricsStruct new]; + newElement_0.id = [NSNumber numberWithUnsignedLongLong:entry_0.id]; + if (entry_0.name.HasValue()) { + newElement_0.name = AsString(entry_0.name.Value()); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.name = nil; + } + if (entry_0.stackFreeCurrent.HasValue()) { + newElement_0.stackFreeCurrent = [NSNumber numberWithUnsignedInt:entry_0.stackFreeCurrent.Value()]; + } else { + newElement_0.stackFreeCurrent = nil; + } + if (entry_0.stackFreeMinimum.HasValue()) { + newElement_0.stackFreeMinimum = [NSNumber numberWithUnsignedInt:entry_0.stackFreeMinimum.Value()]; + } else { + newElement_0.stackFreeMinimum = nil; + } + if (entry_0.stackSize.HasValue()) { + newElement_0.stackSize = [NSNumber numberWithUnsignedInt:entry_0.stackSize.Value()]; + } else { + newElement_0.stackSize = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -13931,33 +2837,39 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::CurrentHeapFree::Id: { + using TypeInfo = Attributes::CurrentHeapFree::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::CurrentHeapUsed::Id: { + using TypeInfo = Attributes::CurrentHeapUsed::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + case Attributes::CurrentHeapHighWatermark::Id: { + using TypeInfo = Attributes::CurrentHeapHighWatermark::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -13966,12 +2878,13 @@ static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluste *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForThreadNetworkDiagnosticsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::DoorLock; + using namespace Clusters::ThreadNetworkDiagnostics; switch (aAttributeId) { - case Attributes::LockState::Id: { - using TypeInfo = Attributes::LockState::TypeInfo; + case Attributes::Channel::Id: { + using TypeInfo = Attributes::Channel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -13981,34 +2894,47 @@ static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttribut if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::LockType::Id: { - using TypeInfo = Attributes::LockType::TypeInfo; + case Attributes::RoutingRole::Id: { + using TypeInfo = Attributes::RoutingRole::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + } return value; } - case Attributes::ActuatorEnabled::Id: { - using TypeInfo = Attributes::ActuatorEnabled::TypeInfo; + case Attributes::NetworkName::Id: { + using TypeInfo = Attributes::NetworkName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + NSString * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } return value; } - case Attributes::DoorState::Id: { - using TypeInfo = Attributes::DoorState::TypeInfo; + case Attributes::PanId::Id: { + using TypeInfo = Attributes::PanId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -14018,475 +2944,443 @@ static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttribut if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::DoorOpenEvents::Id: { - using TypeInfo = Attributes::DoorOpenEvents::TypeInfo; + case Attributes::ExtendedPanId::Id: { + using TypeInfo = Attributes::ExtendedPanId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::DoorClosedEvents::Id: { - using TypeInfo = Attributes::DoorClosedEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::OpenPeriod::Id: { - using TypeInfo = Attributes::OpenPeriod::TypeInfo; + case Attributes::MeshLocalPrefix::Id: { + using TypeInfo = Attributes::MeshLocalPrefix::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::NumberOfTotalUsersSupported::Id: { - using TypeInfo = Attributes::NumberOfTotalUsersSupported::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::NumberOfPINUsersSupported::Id: { - using TypeInfo = Attributes::NumberOfPINUsersSupported::TypeInfo; + case Attributes::OverrunCount::Id: { + using TypeInfo = Attributes::OverrunCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } - case Attributes::NumberOfRFIDUsersSupported::Id: { - using TypeInfo = Attributes::NumberOfRFIDUsersSupported::TypeInfo; + case Attributes::NeighborTable::Id: { + using TypeInfo = Attributes::NeighborTable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id: { - using TypeInfo = Attributes::NumberOfWeekDaySchedulesSupportedPerUser::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThreadNetworkDiagnosticsClusterNeighborTableStruct * newElement_0; + newElement_0 = [MTRThreadNetworkDiagnosticsClusterNeighborTableStruct new]; + newElement_0.extAddress = [NSNumber numberWithUnsignedLongLong:entry_0.extAddress]; + newElement_0.age = [NSNumber numberWithUnsignedInt:entry_0.age]; + newElement_0.rloc16 = [NSNumber numberWithUnsignedShort:entry_0.rloc16]; + newElement_0.linkFrameCounter = [NSNumber numberWithUnsignedInt:entry_0.linkFrameCounter]; + newElement_0.mleFrameCounter = [NSNumber numberWithUnsignedInt:entry_0.mleFrameCounter]; + newElement_0.lqi = [NSNumber numberWithUnsignedChar:entry_0.lqi]; + if (entry_0.averageRssi.IsNull()) { + newElement_0.averageRssi = nil; + } else { + newElement_0.averageRssi = [NSNumber numberWithChar:entry_0.averageRssi.Value()]; + } + if (entry_0.lastRssi.IsNull()) { + newElement_0.lastRssi = nil; + } else { + newElement_0.lastRssi = [NSNumber numberWithChar:entry_0.lastRssi.Value()]; + } + newElement_0.frameErrorRate = [NSNumber numberWithUnsignedChar:entry_0.frameErrorRate]; + newElement_0.messageErrorRate = [NSNumber numberWithUnsignedChar:entry_0.messageErrorRate]; + newElement_0.rxOnWhenIdle = [NSNumber numberWithBool:entry_0.rxOnWhenIdle]; + newElement_0.fullThreadDevice = [NSNumber numberWithBool:entry_0.fullThreadDevice]; + newElement_0.fullNetworkData = [NSNumber numberWithBool:entry_0.fullNetworkData]; + newElement_0.isChild = [NSNumber numberWithBool:entry_0.isChild]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id: { - using TypeInfo = Attributes::NumberOfYearDaySchedulesSupportedPerUser::TypeInfo; + case Attributes::RouteTable::Id: { + using TypeInfo = Attributes::RouteTable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::NumberOfHolidaySchedulesSupported::Id: { - using TypeInfo = Attributes::NumberOfHolidaySchedulesSupported::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThreadNetworkDiagnosticsClusterRouteTableStruct * newElement_0; + newElement_0 = [MTRThreadNetworkDiagnosticsClusterRouteTableStruct new]; + newElement_0.extAddress = [NSNumber numberWithUnsignedLongLong:entry_0.extAddress]; + newElement_0.rloc16 = [NSNumber numberWithUnsignedShort:entry_0.rloc16]; + newElement_0.routerId = [NSNumber numberWithUnsignedChar:entry_0.routerId]; + newElement_0.nextHop = [NSNumber numberWithUnsignedChar:entry_0.nextHop]; + newElement_0.pathCost = [NSNumber numberWithUnsignedChar:entry_0.pathCost]; + newElement_0.lqiIn = [NSNumber numberWithUnsignedChar:entry_0.LQIIn]; + newElement_0.lqiOut = [NSNumber numberWithUnsignedChar:entry_0.LQIOut]; + newElement_0.age = [NSNumber numberWithUnsignedChar:entry_0.age]; + newElement_0.allocated = [NSNumber numberWithBool:entry_0.allocated]; + newElement_0.linkEstablished = [NSNumber numberWithBool:entry_0.linkEstablished]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxPINCodeLength::Id: { - using TypeInfo = Attributes::MaxPINCodeLength::TypeInfo; + case Attributes::PartitionId::Id: { + using TypeInfo = Attributes::PartitionId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::MinPINCodeLength::Id: { - using TypeInfo = Attributes::MinPINCodeLength::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxRFIDCodeLength::Id: { - using TypeInfo = Attributes::MaxRFIDCodeLength::TypeInfo; + case Attributes::Weighting::Id: { + using TypeInfo = Attributes::Weighting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::MinRFIDCodeLength::Id: { - using TypeInfo = Attributes::MinRFIDCodeLength::TypeInfo; + case Attributes::DataVersion::Id: { + using TypeInfo = Attributes::DataVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::CredentialRulesSupport::Id: { - using TypeInfo = Attributes::CredentialRulesSupport::TypeInfo; + case Attributes::StableDataVersion::Id: { + using TypeInfo = Attributes::StableDataVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::NumberOfCredentialsSupportedPerUser::Id: { - using TypeInfo = Attributes::NumberOfCredentialsSupportedPerUser::TypeInfo; + case Attributes::LeaderRouterId::Id: { + using TypeInfo = Attributes::LeaderRouterId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::Language::Id: { - using TypeInfo = Attributes::Language::TypeInfo; + case Attributes::DetachedRoleCount::Id: { + using TypeInfo = Attributes::DetachedRoleCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::LEDSettings::Id: { - using TypeInfo = Attributes::LEDSettings::TypeInfo; + case Attributes::ChildRoleCount::Id: { + using TypeInfo = Attributes::ChildRoleCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::AutoRelockTime::Id: { - using TypeInfo = Attributes::AutoRelockTime::TypeInfo; + case Attributes::RouterRoleCount::Id: { + using TypeInfo = Attributes::RouterRoleCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::SoundVolume::Id: { - using TypeInfo = Attributes::SoundVolume::TypeInfo; + case Attributes::LeaderRoleCount::Id: { + using TypeInfo = Attributes::LeaderRoleCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::OperatingMode::Id: { - using TypeInfo = Attributes::OperatingMode::TypeInfo; + case Attributes::AttachAttemptCount::Id: { + using TypeInfo = Attributes::AttachAttemptCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::SupportedOperatingModes::Id: { - using TypeInfo = Attributes::SupportedOperatingModes::TypeInfo; + case Attributes::PartitionIdChangeCount::Id: { + using TypeInfo = Attributes::PartitionIdChangeCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::DefaultConfigurationRegister::Id: { - using TypeInfo = Attributes::DefaultConfigurationRegister::TypeInfo; + case Attributes::BetterPartitionAttachAttemptCount::Id: { + using TypeInfo = Attributes::BetterPartitionAttachAttemptCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::EnableLocalProgramming::Id: { - using TypeInfo = Attributes::EnableLocalProgramming::TypeInfo; + case Attributes::ParentChangeCount::Id: { + using TypeInfo = Attributes::ParentChangeCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::EnableOneTouchLocking::Id: { - using TypeInfo = Attributes::EnableOneTouchLocking::TypeInfo; + case Attributes::TxTotalCount::Id: { + using TypeInfo = Attributes::TxTotalCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::EnableInsideStatusLED::Id: { - using TypeInfo = Attributes::EnableInsideStatusLED::TypeInfo; + case Attributes::TxUnicastCount::Id: { + using TypeInfo = Attributes::TxUnicastCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::EnablePrivacyModeButton::Id: { - using TypeInfo = Attributes::EnablePrivacyModeButton::TypeInfo; + case Attributes::TxBroadcastCount::Id: { + using TypeInfo = Attributes::TxBroadcastCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::LocalProgrammingFeatures::Id: { - using TypeInfo = Attributes::LocalProgrammingFeatures::TypeInfo; + case Attributes::TxAckRequestedCount::Id: { + using TypeInfo = Attributes::TxAckRequestedCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::WrongCodeEntryLimit::Id: { - using TypeInfo = Attributes::WrongCodeEntryLimit::TypeInfo; + case Attributes::TxAckedCount::Id: { + using TypeInfo = Attributes::TxAckedCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::UserCodeTemporaryDisableTime::Id: { - using TypeInfo = Attributes::UserCodeTemporaryDisableTime::TypeInfo; + case Attributes::TxNoAckRequestedCount::Id: { + using TypeInfo = Attributes::TxNoAckRequestedCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::SendPINOverTheAir::Id: { - using TypeInfo = Attributes::SendPINOverTheAir::TypeInfo; + case Attributes::TxDataCount::Id: { + using TypeInfo = Attributes::TxDataCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::RequirePINforRemoteOperation::Id: { - using TypeInfo = Attributes::RequirePINforRemoteOperation::TypeInfo; + case Attributes::TxDataPollCount::Id: { + using TypeInfo = Attributes::TxDataPollCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithBool:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ExpiringUserTimeout::Id: { - using TypeInfo = Attributes::ExpiringUserTimeout::TypeInfo; + case Attributes::TxBeaconCount::Id: { + using TypeInfo = Attributes::TxBeaconCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::TxBeaconRequestCount::Id: { + using TypeInfo = Attributes::TxBeaconRequestCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::TxOtherCount::Id: { + using TypeInfo = Attributes::TxOtherCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::TxRetryCount::Id: { + using TypeInfo = Attributes::TxRetryCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::TxDirectMaxRetryExpiryCount::Id: { + using TypeInfo = Attributes::TxDirectMaxRetryExpiryCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::TxIndirectMaxRetryExpiryCount::Id: { + using TypeInfo = Attributes::TxIndirectMaxRetryExpiryCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -14496,386 +3390,332 @@ static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttribut value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::TxErrCcaCount::Id: { + using TypeInfo = Attributes::TxErrCcaCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForWindowCoveringCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::WindowCovering; - switch (aAttributeId) { - case Attributes::Type::Id: { - using TypeInfo = Attributes::Type::TypeInfo; + case Attributes::TxErrAbortCount::Id: { + using TypeInfo = Attributes::TxErrAbortCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::PhysicalClosedLimitLift::Id: { - using TypeInfo = Attributes::PhysicalClosedLimitLift::TypeInfo; + case Attributes::TxErrBusyChannelCount::Id: { + using TypeInfo = Attributes::TxErrBusyChannelCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::PhysicalClosedLimitTilt::Id: { - using TypeInfo = Attributes::PhysicalClosedLimitTilt::TypeInfo; + case Attributes::RxTotalCount::Id: { + using TypeInfo = Attributes::RxTotalCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionLift::Id: { - using TypeInfo = Attributes::CurrentPositionLift::TypeInfo; + case Attributes::RxUnicastCount::Id: { + using TypeInfo = Attributes::RxUnicastCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionTilt::Id: { - using TypeInfo = Attributes::CurrentPositionTilt::TypeInfo; + case Attributes::RxBroadcastCount::Id: { + using TypeInfo = Attributes::RxBroadcastCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::NumberOfActuationsLift::Id: { - using TypeInfo = Attributes::NumberOfActuationsLift::TypeInfo; + case Attributes::RxDataCount::Id: { + using TypeInfo = Attributes::RxDataCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::NumberOfActuationsTilt::Id: { - using TypeInfo = Attributes::NumberOfActuationsTilt::TypeInfo; + case Attributes::RxDataPollCount::Id: { + using TypeInfo = Attributes::RxDataPollCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ConfigStatus::Id: { - using TypeInfo = Attributes::ConfigStatus::TypeInfo; + case Attributes::RxBeaconCount::Id: { + using TypeInfo = Attributes::RxBeaconCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionLiftPercentage::Id: { - using TypeInfo = Attributes::CurrentPositionLiftPercentage::TypeInfo; + case Attributes::RxBeaconRequestCount::Id: { + using TypeInfo = Attributes::RxBeaconRequestCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionTiltPercentage::Id: { - using TypeInfo = Attributes::CurrentPositionTiltPercentage::TypeInfo; + case Attributes::RxOtherCount::Id: { + using TypeInfo = Attributes::RxOtherCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::OperationalStatus::Id: { - using TypeInfo = Attributes::OperationalStatus::TypeInfo; + case Attributes::RxAddressFilteredCount::Id: { + using TypeInfo = Attributes::RxAddressFilteredCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::TargetPositionLiftPercent100ths::Id: { - using TypeInfo = Attributes::TargetPositionLiftPercent100ths::TypeInfo; + case Attributes::RxDestAddrFilteredCount::Id: { + using TypeInfo = Attributes::RxDestAddrFilteredCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::TargetPositionTiltPercent100ths::Id: { - using TypeInfo = Attributes::TargetPositionTiltPercent100ths::TypeInfo; + case Attributes::RxDuplicatedCount::Id: { + using TypeInfo = Attributes::RxDuplicatedCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::EndProductType::Id: { - using TypeInfo = Attributes::EndProductType::TypeInfo; + case Attributes::RxErrNoFrameCount::Id: { + using TypeInfo = Attributes::RxErrNoFrameCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionLiftPercent100ths::Id: { - using TypeInfo = Attributes::CurrentPositionLiftPercent100ths::TypeInfo; + case Attributes::RxErrUnknownNeighborCount::Id: { + using TypeInfo = Attributes::RxErrUnknownNeighborCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::CurrentPositionTiltPercent100ths::Id: { - using TypeInfo = Attributes::CurrentPositionTiltPercent100ths::TypeInfo; + case Attributes::RxErrInvalidSrcAddrCount::Id: { + using TypeInfo = Attributes::RxErrInvalidSrcAddrCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::InstalledOpenLimitLift::Id: { - using TypeInfo = Attributes::InstalledOpenLimitLift::TypeInfo; + case Attributes::RxErrSecCount::Id: { + using TypeInfo = Attributes::RxErrSecCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::InstalledClosedLimitLift::Id: { - using TypeInfo = Attributes::InstalledClosedLimitLift::TypeInfo; + case Attributes::RxErrFcsCount::Id: { + using TypeInfo = Attributes::RxErrFcsCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::InstalledOpenLimitTilt::Id: { - using TypeInfo = Attributes::InstalledOpenLimitTilt::TypeInfo; + case Attributes::RxErrOtherCount::Id: { + using TypeInfo = Attributes::RxErrOtherCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::InstalledClosedLimitTilt::Id: { - using TypeInfo = Attributes::InstalledClosedLimitTilt::TypeInfo; + case Attributes::ActiveTimestamp::Id: { + using TypeInfo = Attributes::ActiveTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } return value; } - case Attributes::Mode::Id: { - using TypeInfo = Attributes::Mode::TypeInfo; + case Attributes::PendingTimestamp::Id: { + using TypeInfo = Attributes::PendingTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } return value; } - case Attributes::SafetyStatus::Id: { - using TypeInfo = Attributes::SafetyStatus::TypeInfo; + case Attributes::Delay::Id: { + using TypeInfo = Attributes::Delay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::SecurityPolicy::Id: { + using TypeInfo = Attributes::SecurityPolicy::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + MTRThreadNetworkDiagnosticsClusterSecurityPolicy * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRThreadNetworkDiagnosticsClusterSecurityPolicy new]; + value.rotationTime = [NSNumber numberWithUnsignedShort:cppValue.Value().rotationTime]; + value.flags = [NSNumber numberWithUnsignedShort:cppValue.Value().flags]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ChannelPage0Mask::Id: { + using TypeInfo = Attributes::ChannelPage0Mask::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::OperationalDatasetComponents::Id: { + using TypeInfo = Attributes::OperationalDatasetComponents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents new]; + value.activeTimestampPresent = [NSNumber numberWithBool:cppValue.Value().activeTimestampPresent]; + value.pendingTimestampPresent = [NSNumber numberWithBool:cppValue.Value().pendingTimestampPresent]; + value.masterKeyPresent = [NSNumber numberWithBool:cppValue.Value().masterKeyPresent]; + value.networkNamePresent = [NSNumber numberWithBool:cppValue.Value().networkNamePresent]; + value.extendedPanIdPresent = [NSNumber numberWithBool:cppValue.Value().extendedPanIdPresent]; + value.meshLocalPrefixPresent = [NSNumber numberWithBool:cppValue.Value().meshLocalPrefixPresent]; + value.delayPresent = [NSNumber numberWithBool:cppValue.Value().delayPresent]; + value.panIdPresent = [NSNumber numberWithBool:cppValue.Value().panIdPresent]; + value.channelPresent = [NSNumber numberWithBool:cppValue.Value().channelPresent]; + value.pskcPresent = [NSNumber numberWithBool:cppValue.Value().pskcPresent]; + value.securityPolicyPresent = [NSNumber numberWithBool:cppValue.Value().securityPolicyPresent]; + value.channelMaskPresent = [NSNumber numberWithBool:cppValue.Value().channelMaskPresent]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::ActiveNetworkFaultsList::Id: { + using TypeInfo = Attributes::ActiveNetworkFaultsList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -14888,7 +3728,7 @@ static id _Nullable DecodeAttributeValueForWindowCoveringCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -14900,28 +3740,6 @@ static id _Nullable DecodeAttributeValueForWindowCoveringCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } default: { break; } @@ -14930,247 +3748,204 @@ static id _Nullable DecodeAttributeValueForWindowCoveringCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForBarrierControlCluster( +static id _Nullable DecodeAttributeValueForWiFiNetworkDiagnosticsCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::BarrierControl; + using namespace Clusters::WiFiNetworkDiagnostics; switch (aAttributeId) { - case Attributes::BarrierMovingState::Id: { - using TypeInfo = Attributes::BarrierMovingState::TypeInfo; + case Attributes::Bssid::Id: { + using TypeInfo = Attributes::Bssid::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::BarrierSafetyStatus::Id: { - using TypeInfo = Attributes::BarrierSafetyStatus::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSData * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = AsData(cppValue.Value()); } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::BarrierCapabilities::Id: { - using TypeInfo = Attributes::BarrierCapabilities::TypeInfo; + case Attributes::SecurityType::Id: { + using TypeInfo = Attributes::SecurityType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::BarrierOpenEvents::Id: { - using TypeInfo = Attributes::BarrierOpenEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::BarrierCloseEvents::Id: { - using TypeInfo = Attributes::BarrierCloseEvents::TypeInfo; + case Attributes::WiFiVersion::Id: { + using TypeInfo = Attributes::WiFiVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::BarrierCommandOpenEvents::Id: { - using TypeInfo = Attributes::BarrierCommandOpenEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::BarrierCommandCloseEvents::Id: { - using TypeInfo = Attributes::BarrierCommandCloseEvents::TypeInfo; + case Attributes::ChannelNumber::Id: { + using TypeInfo = Attributes::ChannelNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } - case Attributes::BarrierOpenPeriod::Id: { - using TypeInfo = Attributes::BarrierOpenPeriod::TypeInfo; + case Attributes::Rssi::Id: { + using TypeInfo = Attributes::Rssi::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithChar:cppValue.Value()]; + } return value; } - case Attributes::BarrierClosePeriod::Id: { - using TypeInfo = Attributes::BarrierClosePeriod::TypeInfo; + case Attributes::BeaconLostCount::Id: { + using TypeInfo = Attributes::BeaconLostCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } - case Attributes::BarrierPosition::Id: { - using TypeInfo = Attributes::BarrierPosition::TypeInfo; + case Attributes::BeaconRxCount::Id: { + using TypeInfo = Attributes::BeaconRxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::PacketMulticastRxCount::Id: { + using TypeInfo = Attributes::PacketMulticastRxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::PacketMulticastTxCount::Id: { + using TypeInfo = Attributes::PacketMulticastTxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::PacketUnicastRxCount::Id: { + using TypeInfo = Attributes::PacketUnicastRxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PacketUnicastTxCount::Id: { + using TypeInfo = Attributes::PacketUnicastTxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::CurrentMaxRate::Id: { + using TypeInfo = Attributes::CurrentMaxRate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::OverrunCount::Id: { + using TypeInfo = Attributes::OverrunCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } return value; } default: { @@ -15181,13 +3956,13 @@ static id _Nullable DecodeAttributeValueForBarrierControlCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( +static id _Nullable DecodeAttributeValueForEthernetNetworkDiagnosticsCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::PumpConfigurationAndControl; + using namespace Clusters::EthernetNetworkDiagnostics; switch (aAttributeId) { - case Attributes::MaxPressure::Id: { - using TypeInfo = Attributes::MaxPressure::TypeInfo; + case Attributes::PHYRate::Id: { + using TypeInfo = Attributes::PHYRate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15197,12 +3972,12 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } - case Attributes::MaxSpeed::Id: { - using TypeInfo = Attributes::MaxSpeed::TypeInfo; + case Attributes::FullDuplex::Id: { + using TypeInfo = Attributes::FullDuplex::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15212,42 +3987,67 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [NSNumber numberWithBool:cppValue.Value()]; } return value; } - case Attributes::MaxFlow::Id: { - using TypeInfo = Attributes::MaxFlow::TypeInfo; + case Attributes::PacketRxCount::Id: { + using TypeInfo = Attributes::PacketRxCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + case Attributes::PacketTxCount::Id: { + using TypeInfo = Attributes::PacketTxCount::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } - case Attributes::MinConstPressure::Id: { - using TypeInfo = Attributes::MinConstPressure::TypeInfo; + case Attributes::TxErrCount::Id: { + using TypeInfo = Attributes::TxErrCount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + case Attributes::CollisionCount::Id: { + using TypeInfo = Attributes::CollisionCount::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; return value; } - case Attributes::MaxConstPressure::Id: { - using TypeInfo = Attributes::MaxConstPressure::TypeInfo; + case Attributes::OverrunCount::Id: { + using TypeInfo = Attributes::OverrunCount::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + case Attributes::CarrierDetect::Id: { + using TypeInfo = Attributes::CarrierDetect::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15257,12 +4057,37 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithBool:cppValue.Value()]; } return value; } - case Attributes::MinCompPressure::Id: { - using TypeInfo = Attributes::MinCompPressure::TypeInfo; + case Attributes::TimeSinceReset::Id: { + using TypeInfo = Attributes::TimeSinceReset::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedLongLong:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTimeSynchronizationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TimeSynchronization; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::UTCTime::Id: { + using TypeInfo = Attributes::UTCTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15272,87 +4097,157 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } - case Attributes::MaxCompPressure::Id: { - using TypeInfo = Attributes::MaxCompPressure::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Granularity::Id: { + using TypeInfo = Attributes::Granularity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TimeSource::Id: { + using TypeInfo = Attributes::TimeSource::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::MinConstSpeed::Id: { - using TypeInfo = Attributes::MinConstSpeed::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TrustedTimeSource::Id: { + using TypeInfo = Attributes::TrustedTimeSource::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; + MTRTimeSynchronizationClusterTrustedTimeSourceStruct * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [MTRTimeSynchronizationClusterTrustedTimeSourceStruct new]; + value.fabricIndex = [NSNumber numberWithUnsignedChar:cppValue.Value().fabricIndex]; + value.nodeID = [NSNumber numberWithUnsignedLongLong:cppValue.Value().nodeID]; + value.endpoint = [NSNumber numberWithUnsignedShort:cppValue.Value().endpoint]; } return value; } - case Attributes::MaxConstSpeed::Id: { - using TypeInfo = Attributes::MaxConstSpeed::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DefaultNTP::Id: { + using TypeInfo = Attributes::DefaultNTP::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; + NSString * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = AsString(cppValue.Value()); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } } return value; } - case Attributes::MinConstFlow::Id: { - using TypeInfo = Attributes::MinConstFlow::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TimeZone::Id: { + using TypeInfo = Attributes::TimeZone::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRTimeSynchronizationClusterTimeZoneStruct * newElement_0; + newElement_0 = [MTRTimeSynchronizationClusterTimeZoneStruct new]; + newElement_0.offset = [NSNumber numberWithInt:entry_0.offset]; + newElement_0.validAt = [NSNumber numberWithUnsignedLongLong:entry_0.validAt]; + if (entry_0.name.HasValue()) { + newElement_0.name = AsString(entry_0.name.Value()); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.name = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::MaxConstFlow::Id: { - using TypeInfo = Attributes::MaxConstFlow::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DSTOffset::Id: { + using TypeInfo = Attributes::DSTOffset::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRTimeSynchronizationClusterDSTOffsetStruct * newElement_0; + newElement_0 = [MTRTimeSynchronizationClusterDSTOffsetStruct new]; + newElement_0.offset = [NSNumber numberWithInt:entry_0.offset]; + newElement_0.validStarting = [NSNumber numberWithUnsignedLongLong:entry_0.validStarting]; + if (entry_0.validUntil.IsNull()) { + newElement_0.validUntil = nil; + } else { + newElement_0.validUntil = [NSNumber numberWithUnsignedLongLong:entry_0.validUntil.Value()]; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::MinConstTemp::Id: { - using TypeInfo = Attributes::MinConstTemp::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LocalTime::Id: { + using TypeInfo = Attributes::LocalTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15362,383 +4257,351 @@ static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } - case Attributes::MaxConstTemp::Id: { - using TypeInfo = Attributes::MaxConstTemp::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TimeZoneDatabase::Id: { + using TypeInfo = Attributes::TimeZoneDatabase::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::PumpStatus::Id: { - using TypeInfo = Attributes::PumpStatus::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::NTPServerAvailable::Id: { + using TypeInfo = Attributes::NTPServerAvailable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::EffectiveOperationMode::Id: { - using TypeInfo = Attributes::EffectiveOperationMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TimeZoneListMaxSize::Id: { + using TypeInfo = Attributes::TimeZoneListMaxSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::EffectiveControlMode::Id: { - using TypeInfo = Attributes::EffectiveControlMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DSTOffsetListMaxSize::Id: { + using TypeInfo = Attributes::DSTOffsetListMaxSize::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::Capacity::Id: { - using TypeInfo = Attributes::Capacity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportsDNSResolve::Id: { + using TypeInfo = Attributes::SupportsDNSResolve::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::Speed::Id: { - using TypeInfo = Attributes::Speed::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForBridgedDeviceBasicInformationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::BridgedDeviceBasicInformation; + switch (aAttributeId) { + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::LifetimeRunningHours::Id: { - using TypeInfo = Attributes::LifetimeRunningHours::TypeInfo; + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } - case Attributes::Power::Id: { - using TypeInfo = Attributes::Power::TypeInfo; + case Attributes::ProductName::Id: { + using TypeInfo = Attributes::ProductName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::LifetimeEnergyConsumed::Id: { - using TypeInfo = Attributes::LifetimeEnergyConsumed::TypeInfo; + case Attributes::NodeLabel::Id: { + using TypeInfo = Attributes::NodeLabel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } - return value; - } - case Attributes::OperationMode::Id: { - using TypeInfo = Attributes::OperationMode::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ControlMode::Id: { - using TypeInfo = Attributes::ControlMode::TypeInfo; + case Attributes::HardwareVersion::Id: { + using TypeInfo = Attributes::HardwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::HardwareVersionString::Id: { + using TypeInfo = Attributes::HardwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::SoftwareVersion::Id: { + using TypeInfo = Attributes::SoftwareVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SoftwareVersionString::Id: { + using TypeInfo = Attributes::SoftwareVersionString::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::ManufacturingDate::Id: { + using TypeInfo = Attributes::ManufacturingDate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::PartNumber::Id: { + using TypeInfo = Attributes::PartNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForThermostatCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Thermostat; - switch (aAttributeId) { - case Attributes::LocalTemperature::Id: { - using TypeInfo = Attributes::LocalTemperature::TypeInfo; + case Attributes::ProductURL::Id: { + using TypeInfo = Attributes::ProductURL::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::OutdoorTemperature::Id: { - using TypeInfo = Attributes::OutdoorTemperature::TypeInfo; + case Attributes::ProductLabel::Id: { + using TypeInfo = Attributes::ProductLabel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::Occupancy::Id: { - using TypeInfo = Attributes::Occupancy::TypeInfo; + case Attributes::SerialNumber::Id: { + using TypeInfo = Attributes::SerialNumber::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - case Attributes::AbsMinHeatSetpointLimit::Id: { - using TypeInfo = Attributes::AbsMinHeatSetpointLimit::TypeInfo; + case Attributes::Reachable::Id: { + using TypeInfo = Attributes::Reachable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::AbsMaxHeatSetpointLimit::Id: { - using TypeInfo = Attributes::AbsMaxHeatSetpointLimit::TypeInfo; + case Attributes::UniqueID::Id: { + using TypeInfo = Attributes::UniqueID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - case Attributes::AbsMinCoolSetpointLimit::Id: { - using TypeInfo = Attributes::AbsMinCoolSetpointLimit::TypeInfo; + case Attributes::ProductAppearance::Id: { + using TypeInfo = Attributes::ProductAppearance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct * _Nonnull value; + value = [MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct new]; + value.finish = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.finish)]; + if (cppValue.primaryColor.IsNull()) { + value.primaryColor = nil; + } else { + value.primaryColor = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.primaryColor.Value())]; + } return value; } - case Attributes::AbsMaxCoolSetpointLimit::Id: { - using TypeInfo = Attributes::AbsMaxCoolSetpointLimit::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForSwitchCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Switch; + switch (aAttributeId) { + case Attributes::NumberOfPositions::Id: { + using TypeInfo = Attributes::NumberOfPositions::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PICoolingDemand::Id: { - using TypeInfo = Attributes::PICoolingDemand::TypeInfo; + case Attributes::CurrentPosition::Id: { + using TypeInfo = Attributes::CurrentPosition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15748,8 +4611,8 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PIHeatingDemand::Id: { - using TypeInfo = Attributes::PIHeatingDemand::TypeInfo; + case Attributes::MultiPressMax::Id: { + using TypeInfo = Attributes::MultiPressMax::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -15759,243 +4622,545 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::HVACSystemTypeConfiguration::Id: { - using TypeInfo = Attributes::HVACSystemTypeConfiguration::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForAdministratorCommissioningCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::AdministratorCommissioning; + switch (aAttributeId) { + case Attributes::WindowStatus::Id: { + using TypeInfo = Attributes::WindowStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::LocalTemperatureCalibration::Id: { - using TypeInfo = Attributes::LocalTemperatureCalibration::TypeInfo; + case Attributes::AdminFabricIndex::Id: { + using TypeInfo = Attributes::AdminFabricIndex::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::OccupiedCoolingSetpoint::Id: { - using TypeInfo = Attributes::OccupiedCoolingSetpoint::TypeInfo; + case Attributes::AdminVendorId::Id: { + using TypeInfo = Attributes::AdminVendorId::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } - case Attributes::OccupiedHeatingSetpoint::Id: { - using TypeInfo = Attributes::OccupiedHeatingSetpoint::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOperationalCredentialsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OperationalCredentials; + switch (aAttributeId) { + case Attributes::NOCs::Id: { + using TypeInfo = Attributes::NOCs::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTROperationalCredentialsClusterNOCStruct * newElement_0; + newElement_0 = [MTROperationalCredentialsClusterNOCStruct new]; + newElement_0.noc = AsData(entry_0.noc); + if (entry_0.icac.IsNull()) { + newElement_0.icac = nil; + } else { + newElement_0.icac = AsData(entry_0.icac.Value()); + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::UnoccupiedCoolingSetpoint::Id: { - using TypeInfo = Attributes::UnoccupiedCoolingSetpoint::TypeInfo; + case Attributes::Fabrics::Id: { + using TypeInfo = Attributes::Fabrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTROperationalCredentialsClusterFabricDescriptorStruct * newElement_0; + newElement_0 = [MTROperationalCredentialsClusterFabricDescriptorStruct new]; + newElement_0.rootPublicKey = AsData(entry_0.rootPublicKey); + newElement_0.vendorID = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0.vendorID)]; + newElement_0.fabricID = [NSNumber numberWithUnsignedLongLong:entry_0.fabricID]; + newElement_0.nodeID = [NSNumber numberWithUnsignedLongLong:entry_0.nodeID]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::UnoccupiedHeatingSetpoint::Id: { - using TypeInfo = Attributes::UnoccupiedHeatingSetpoint::TypeInfo; + case Attributes::SupportedFabrics::Id: { + using TypeInfo = Attributes::SupportedFabrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MinHeatSetpointLimit::Id: { - using TypeInfo = Attributes::MinHeatSetpointLimit::TypeInfo; + case Attributes::CommissionedFabrics::Id: { + using TypeInfo = Attributes::CommissionedFabrics::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxHeatSetpointLimit::Id: { - using TypeInfo = Attributes::MaxHeatSetpointLimit::TypeInfo; + case Attributes::TrustedRootCertificates::Id: { + using TypeInfo = Attributes::TrustedRootCertificates::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSData * newElement_0; + newElement_0 = AsData(entry_0); + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::MinCoolSetpointLimit::Id: { - using TypeInfo = Attributes::MinCoolSetpointLimit::TypeInfo; + case Attributes::CurrentFabricIndex::Id: { + using TypeInfo = Attributes::CurrentFabricIndex::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxCoolSetpointLimit::Id: { - using TypeInfo = Attributes::MaxCoolSetpointLimit::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForGroupKeyManagementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::GroupKeyManagement; + switch (aAttributeId) { + case Attributes::GroupKeyMap::Id: { + using TypeInfo = Attributes::GroupKeyMap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRGroupKeyManagementClusterGroupKeyMapStruct * newElement_0; + newElement_0 = [MTRGroupKeyManagementClusterGroupKeyMapStruct new]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + newElement_0.groupKeySetID = [NSNumber numberWithUnsignedShort:entry_0.groupKeySetID]; + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::MinSetpointDeadBand::Id: { - using TypeInfo = Attributes::MinSetpointDeadBand::TypeInfo; + case Attributes::GroupTable::Id: { + using TypeInfo = Attributes::GroupTable::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRGroupKeyManagementClusterGroupInfoMapStruct * newElement_0; + newElement_0 = [MTRGroupKeyManagementClusterGroupInfoMapStruct new]; + newElement_0.groupId = [NSNumber numberWithUnsignedShort:entry_0.groupId]; + { // Scope for our temporary variables + 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]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.endpoints = array_2; + } + if (entry_0.groupName.HasValue()) { + newElement_0.groupName = AsString(entry_0.groupName.Value()); + if (newElement_0.groupName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.groupName = nil; + } + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::RemoteSensing::Id: { - using TypeInfo = Attributes::RemoteSensing::TypeInfo; + case Attributes::MaxGroupsPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupsPerFabric::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ControlSequenceOfOperation::Id: { - using TypeInfo = Attributes::ControlSequenceOfOperation::TypeInfo; + case Attributes::MaxGroupKeysPerFabric::Id: { + using TypeInfo = Attributes::MaxGroupKeysPerFabric::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::SystemMode::Id: { - using TypeInfo = Attributes::SystemMode::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForFixedLabelCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::FixedLabel; + switch (aAttributeId) { + case Attributes::LabelList::Id: { + using TypeInfo = Attributes::LabelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRFixedLabelClusterLabelStruct * newElement_0; + newElement_0 = [MTRFixedLabelClusterLabelStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.value = AsString(entry_0.value); + if (newElement_0.value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::ThermostatRunningMode::Id: { - using TypeInfo = Attributes::ThermostatRunningMode::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForUserLabelCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::UserLabel; + switch (aAttributeId) { + case Attributes::LabelList::Id: { + using TypeInfo = Attributes::LabelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRUserLabelClusterLabelStruct * newElement_0; + newElement_0 = [MTRUserLabelClusterLabelStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.value = AsString(entry_0.value); + if (newElement_0.value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::StartOfWeek::Id: { - using TypeInfo = Attributes::StartOfWeek::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForBooleanStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::BooleanState; + switch (aAttributeId) { + case Attributes::StateValue::Id: { + using TypeInfo = Attributes::StateValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::NumberOfWeeklyTransitions::Id: { - using TypeInfo = Attributes::NumberOfWeeklyTransitions::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForICDManagementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::IcdManagement; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::IdleModeInterval::Id: { + using TypeInfo = Attributes::IdleModeInterval::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::NumberOfDailyTransitions::Id: { - using TypeInfo = Attributes::NumberOfDailyTransitions::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ActiveModeInterval::Id: { + using TypeInfo = Attributes::ActiveModeInterval::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::TemperatureSetpointHold::Id: { - using TypeInfo = Attributes::TemperatureSetpointHold::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ActiveModeThreshold::Id: { + using TypeInfo = Attributes::ActiveModeThreshold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::TemperatureSetpointHoldDuration::Id: { - using TypeInfo = Attributes::TemperatureSetpointHoldDuration::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::RegisteredClients::Id: { + using TypeInfo = Attributes::RegisteredClients::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRICDManagementClusterMonitoringRegistrationStruct * newElement_0; + newElement_0 = [MTRICDManagementClusterMonitoringRegistrationStruct new]; + newElement_0.checkInNodeID = [NSNumber numberWithUnsignedLongLong:entry_0.checkInNodeID]; + newElement_0.monitoredSubject = [NSNumber numberWithUnsignedLongLong:entry_0.monitoredSubject]; + newElement_0.key = AsData(entry_0.key); + newElement_0.fabricIndex = [NSNumber numberWithUnsignedChar:entry_0.fabricIndex]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::ThermostatProgrammingOperationMode::Id: { - using TypeInfo = Attributes::ThermostatProgrammingOperationMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ICDCounter::Id: { + using TypeInfo = Attributes::ICDCounter::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ThermostatRunningState::Id: { - using TypeInfo = Attributes::ThermostatRunningState::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ClientsSupportedPerFabric::Id: { + using TypeInfo = Attributes::ClientsSupportedPerFabric::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16005,19 +5170,38 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::SetpointChangeSource::Id: { - using TypeInfo = Attributes::SetpointChangeSource::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForModeSelectCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ModeSelect; + switch (aAttributeId) { + case Attributes::Description::Id: { + using TypeInfo = Attributes::Description::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - case Attributes::SetpointChangeAmount::Id: { - using TypeInfo = Attributes::SetpointChangeAmount::TypeInfo; + case Attributes::StandardNamespace::Id: { + using TypeInfo = Attributes::StandardNamespace::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16027,38 +5211,74 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::SetpointChangeSourceTimestamp::Id: { - using TypeInfo = Attributes::SetpointChangeSourceTimestamp::TypeInfo; + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRModeSelectClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRModeSelectClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.semanticTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRModeSelectClusterSemanticTagStruct * newElement_2; + newElement_2 = [MTRModeSelectClusterSemanticTagStruct new]; + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode)]; + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.semanticTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::OccupiedSetback::Id: { - using TypeInfo = Attributes::OccupiedSetback::TypeInfo; + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::OccupiedSetbackMin::Id: { - using TypeInfo = Attributes::OccupiedSetbackMin::TypeInfo; + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16072,8 +5292,8 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::OccupiedSetbackMax::Id: { - using TypeInfo = Attributes::OccupiedSetbackMax::TypeInfo; + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16087,23 +5307,92 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::UnoccupiedSetback::Id: { - using TypeInfo = Attributes::UnoccupiedSetback::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForLaundryWasherModeCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::LaundryWasherMode; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRLaundryWasherModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRLaundryWasherModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRLaundryWasherModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRLaundryWasherModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::UnoccupiedSetbackMin::Id: { - using TypeInfo = Attributes::UnoccupiedSetbackMin::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16117,8 +5406,10 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::UnoccupiedSetbackMax::Id: { - using TypeInfo = Attributes::UnoccupiedSetbackMax::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16132,52 +5423,80 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::EmergencyHeatDelta::Id: { - using TypeInfo = Attributes::EmergencyHeatDelta::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::ACType::Id: { - using TypeInfo = Attributes::ACType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; } - case Attributes::ACCapacity::Id: { - using TypeInfo = Attributes::ACCapacity::TypeInfo; + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRefrigeratorAndTemperatureControlledCabinetModeCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RefrigeratorAndTemperatureControlledCabinetMode; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ACRefrigerantType::Id: { - using TypeInfo = Attributes::ACRefrigerantType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRRefrigeratorAndTemperatureControlledCabinetModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ACCompressorType::Id: { - using TypeInfo = Attributes::ACCompressorType::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16187,30 +5506,27 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ACErrorCode::Id: { - using TypeInfo = Attributes::ACErrorCode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ACLouverPosition::Id: { - using TypeInfo = Attributes::ACLouverPosition::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ACCoilTemperature::Id: { - using TypeInfo = Attributes::ACCoilTemperature::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16220,23 +5536,27 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } - case Attributes::ACCapacityformat::Id: { - using TypeInfo = Attributes::ACCapacityformat::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForLaundryWasherControlsCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::LaundryWasherControls; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::SpinSpeeds::Id: { + using TypeInfo = Attributes::SpinSpeeds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16248,8 +5568,13 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + NSString * newElement_0; + newElement_0 = AsString(entry_0); + if (newElement_0 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16261,8 +5586,40 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SpinSpeedCurrent::Id: { + using TypeInfo = Attributes::SpinSpeedCurrent::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::NumberOfRinses::Id: { + using TypeInfo = Attributes::NumberOfRinses::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedRinses::Id: { + using TypeInfo = Attributes::SupportedRinses::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16275,7 +5632,7 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16287,9 +5644,23 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( } return value; } +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRVCRunModeCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RvcRunMode; + switch (aAttributeId) { #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16301,8 +5672,37 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRRVCRunModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRRVCRunModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRRVCRunModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRRVCRunModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16315,54 +5715,53 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -16371,35 +5770,84 @@ static id _Nullable DecodeAttributeValueForThermostatCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForFanControlCluster( +static id _Nullable DecodeAttributeValueForRVCCleanModeCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::FanControl; + using namespace Clusters::RvcCleanMode; switch (aAttributeId) { - case Attributes::FanMode::Id: { - using TypeInfo = Attributes::FanMode::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRVCCleanModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRRVCCleanModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRRVCCleanModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRRVCCleanModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::FanModeSequence::Id: { - using TypeInfo = Attributes::FanModeSequence::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PercentSetting::Id: { - using TypeInfo = Attributes::PercentSetting::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16413,30 +5861,10 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( } return value; } - case Attributes::PercentCurrent::Id: { - using TypeInfo = Attributes::PercentCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::SpeedMax::Id: { - using TypeInfo = Attributes::SpeedMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::SpeedSetting::Id: { - using TypeInfo = Attributes::SpeedSetting::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16450,129 +5878,88 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( } return value; } - case Attributes::SpeedCurrent::Id: { - using TypeInfo = Attributes::SpeedCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; - return value; - } - case Attributes::RockSupport::Id: { - using TypeInfo = Attributes::RockSupport::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::RockSetting::Id: { - using TypeInfo = Attributes::RockSetting::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; - return value; } - case Attributes::WindSupport::Id: { - using TypeInfo = Attributes::WindSupport::TypeInfo; + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTemperatureControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TemperatureControl; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::TemperatureSetpoint::Id: { + using TypeInfo = Attributes::TemperatureSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::WindSetting::Id: { - using TypeInfo = Attributes::WindSetting::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinTemperature::Id: { + using TypeInfo = Attributes::MinTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithShort:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AirflowDirection::Id: { - using TypeInfo = Attributes::AirflowDirection::TypeInfo; + case Attributes::MaxTemperature::Id: { + using TypeInfo = Attributes::MaxTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithShort:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; +#if MTR_ENABLE_PROVISIONAL + case Attributes::Step::Id: { + using TypeInfo = Attributes::Step::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SelectedTemperatureLevel::Id: { + using TypeInfo = Attributes::SelectedTemperatureLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SupportedTemperatureLevels::Id: { + using TypeInfo = Attributes::SupportedTemperatureLevels::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16584,8 +5971,13 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + NSString * newElement_0; + newElement_0 = AsString(entry_0); + if (newElement_0 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -16598,54 +5990,58 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRefrigeratorAlarmCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RefrigeratorAlarm; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::Mask::Id: { + using TypeInfo = Attributes::Mask::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::State::Id: { + using TypeInfo = Attributes::State::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Supported::Id: { + using TypeInfo = Attributes::Supported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -16654,24 +6050,71 @@ static id _Nullable DecodeAttributeValueForFanControlCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForThermostatUserInterfaceConfigurationCluster( +static id _Nullable DecodeAttributeValueForDishwasherModeCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ThermostatUserInterfaceConfiguration; + using namespace Clusters::DishwasherMode; switch (aAttributeId) { - case Attributes::TemperatureDisplayMode::Id: { - using TypeInfo = Attributes::TemperatureDisplayMode::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::SupportedModes::Id: { + using TypeInfo = Attributes::SupportedModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRDishwasherModeClusterModeOptionStruct * newElement_0; + newElement_0 = [MTRDishwasherModeClusterModeOptionStruct new]; + newElement_0.label = AsString(entry_0.label); + if (newElement_0.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.mode = [NSNumber numberWithUnsignedChar:entry_0.mode]; + { // Scope for our temporary variables + auto * array_2 = [NSMutableArray new]; + auto iter_2 = entry_0.modeTags.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRDishwasherModeClusterModeTagStruct * newElement_2; + newElement_2 = [MTRDishwasherModeClusterModeTagStruct new]; + if (entry_2.mfgCode.HasValue()) { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } else { + newElement_2.mfgCode = nil; + } + newElement_2.value = [NSNumber numberWithUnsignedShort:entry_2.value]; + [array_2 addObject:newElement_2]; + } + CHIP_ERROR err = iter_2.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + newElement_0.modeTags = array_2; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::KeypadLockout::Id: { - using TypeInfo = Attributes::KeypadLockout::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentMode::Id: { + using TypeInfo = Attributes::CurrentMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -16681,312 +6124,367 @@ static id _Nullable DecodeAttributeValueForThermostatUserInterfaceConfigurationC value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ScheduleProgrammingVisibility::Id: { - using TypeInfo = Attributes::ScheduleProgrammingVisibility::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::StartUpMode::Id: { + using TypeInfo = Attributes::StartUpMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OnMode::Id: { + using TypeInfo = Attributes::OnMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForAirQualityCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::AirQuality; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::AirQuality::Id: { + using TypeInfo = Attributes::AirQuality::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForSmokeCOAlarmCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::SmokeCoAlarm; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::ExpressedState::Id: { + using TypeInfo = Attributes::ExpressedState::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SmokeState::Id: { + using TypeInfo = Attributes::SmokeState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::COState::Id: { + using TypeInfo = Attributes::COState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::BatteryAlert::Id: { + using TypeInfo = Attributes::BatteryAlert::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DeviceMuted::Id: { + using TypeInfo = Attributes::DeviceMuted::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForColorControlCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::ColorControl; - switch (aAttributeId) { - case Attributes::CurrentHue::Id: { - using TypeInfo = Attributes::CurrentHue::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::TestInProgress::Id: { + using TypeInfo = Attributes::TestInProgress::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::CurrentSaturation::Id: { - using TypeInfo = Attributes::CurrentSaturation::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::HardwareFaultAlert::Id: { + using TypeInfo = Attributes::HardwareFaultAlert::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::RemainingTime::Id: { - using TypeInfo = Attributes::RemainingTime::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::EndOfServiceAlert::Id: { + using TypeInfo = Attributes::EndOfServiceAlert::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::CurrentX::Id: { - using TypeInfo = Attributes::CurrentX::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::InterconnectSmokeAlarm::Id: { + using TypeInfo = Attributes::InterconnectSmokeAlarm::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::CurrentY::Id: { - using TypeInfo = Attributes::CurrentY::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::InterconnectCOAlarm::Id: { + using TypeInfo = Attributes::InterconnectCOAlarm::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::DriftCompensation::Id: { - using TypeInfo = Attributes::DriftCompensation::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ContaminationState::Id: { + using TypeInfo = Attributes::ContaminationState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::CompensationText::Id: { - using TypeInfo = Attributes::CompensationText::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::SmokeSensitivityLevel::Id: { + using TypeInfo = Attributes::SmokeSensitivityLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorTemperatureMireds::Id: { - using TypeInfo = Attributes::ColorTemperatureMireds::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ExpiryDate::Id: { + using TypeInfo = Attributes::ExpiryDate::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ColorMode::Id: { - using TypeInfo = Attributes::ColorMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForDishwasherAlarmCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::DishwasherAlarm; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::Mask::Id: { + using TypeInfo = Attributes::Mask::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::Options::Id: { - using TypeInfo = Attributes::Options::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Latch::Id: { + using TypeInfo = Attributes::Latch::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::NumberOfPrimaries::Id: { - using TypeInfo = Attributes::NumberOfPrimaries::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::State::Id: { + using TypeInfo = Attributes::State::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::Primary1X::Id: { - using TypeInfo = Attributes::Primary1X::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Supported::Id: { + using TypeInfo = Attributes::Supported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } - case Attributes::Primary1Y::Id: { - using TypeInfo = Attributes::Primary1Y::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOperationalStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OperationalState; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSArray * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } + } return value; } - case Attributes::Primary1Intensity::Id: { - using TypeInfo = Attributes::Primary1Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17000,30 +6498,10 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( } return value; } - case Attributes::Primary2X::Id: { - using TypeInfo = Attributes::Primary2X::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Primary2Y::Id: { - using TypeInfo = Attributes::Primary2Y::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Primary2Intensity::Id: { - using TypeInfo = Attributes::Primary2Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17033,108 +6511,150 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::Primary3X::Id: { - using TypeInfo = Attributes::Primary3X::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTROperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTROperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::Primary3Y::Id: { - using TypeInfo = Attributes::Primary3Y::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::Primary3Intensity::Id: { - using TypeInfo = Attributes::Primary3Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; + MTROperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTROperationalStateClusterErrorStateStruct new]; + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { + value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); + if (value.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + value.errorStateLabel = nil; } - return value; - } - case Attributes::Primary4X::Id: { - using TypeInfo = Attributes::Primary4X::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + if (cppValue.errorStateDetails.HasValue()) { + value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); + if (value.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.errorStateDetails = nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::Primary4Y::Id: { - using TypeInfo = Attributes::Primary4Y::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::Primary4Intensity::Id: { - using TypeInfo = Attributes::Primary4Intensity::TypeInfo; + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRVCOperationalStateCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RvcOperationalState; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::PhaseList::Id: { + using TypeInfo = Attributes::PhaseList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; + NSArray * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; - } - case Attributes::Primary5X::Id: { - using TypeInfo = Attributes::Primary5X::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Primary5Y::Id: { - using TypeInfo = Attributes::Primary5Y::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + { // Scope for our temporary variables + auto * array_1 = [NSMutableArray new]; + auto iter_1 = cppValue.Value().begin(); + while (iter_1.Next()) { + auto & entry_1 = iter_1.GetValue(); + NSString * newElement_1; + newElement_1 = AsString(entry_1); + if (newElement_1 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_1 addObject:newElement_1]; + } + CHIP_ERROR err = iter_1.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_1; + } } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::Primary5Intensity::Id: { - using TypeInfo = Attributes::Primary5Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CurrentPhase::Id: { + using TypeInfo = Attributes::CurrentPhase::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17148,126 +6668,178 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( } return value; } - case Attributes::Primary6X::Id: { - using TypeInfo = Attributes::Primary6X::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::CountdownTime::Id: { + using TypeInfo = Attributes::CountdownTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Primary6Y::Id: { - using TypeInfo = Attributes::Primary6Y::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::Primary6Intensity::Id: { - using TypeInfo = Attributes::Primary6Intensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalStateList::Id: { + using TypeInfo = Attributes::OperationalStateList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRRVCOperationalStateClusterOperationalStateStruct * newElement_0; + newElement_0 = [MTRRVCOperationalStateClusterOperationalStateStruct new]; + newElement_0.operationalStateID = [NSNumber numberWithUnsignedChar:entry_0.operationalStateID]; + if (entry_0.operationalStateLabel.HasValue()) { + newElement_0.operationalStateLabel = AsString(entry_0.operationalStateLabel.Value()); + if (newElement_0.operationalStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.operationalStateLabel = nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } return value; } - case Attributes::WhitePointX::Id: { - using TypeInfo = Attributes::WhitePointX::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalState::Id: { + using TypeInfo = Attributes::OperationalState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::WhitePointY::Id: { - using TypeInfo = Attributes::WhitePointY::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::OperationalError::Id: { + using TypeInfo = Attributes::OperationalError::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ColorPointRX::Id: { - using TypeInfo = Attributes::ColorPointRX::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + MTRRVCOperationalStateClusterErrorStateStruct * _Nonnull value; + value = [MTRRVCOperationalStateClusterErrorStateStruct new]; + value.errorStateID = [NSNumber numberWithUnsignedChar:cppValue.errorStateID]; + if (cppValue.errorStateLabel.HasValue()) { + value.errorStateLabel = AsString(cppValue.errorStateLabel.Value()); + if (value.errorStateLabel == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.errorStateLabel = nil; + } + if (cppValue.errorStateDetails.HasValue()) { + value.errorStateDetails = AsString(cppValue.errorStateDetails.Value()); + if (value.errorStateDetails == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.errorStateDetails = nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ColorPointRY::Id: { - using TypeInfo = Attributes::ColorPointRY::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForHEPAFilterMonitoringCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::HepaFilterMonitoring; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::Condition::Id: { + using TypeInfo = Attributes::Condition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::ColorPointRIntensity::Id: { - using TypeInfo = Attributes::ColorPointRIntensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DegradationDirection::Id: { + using TypeInfo = Attributes::DegradationDirection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorPointGX::Id: { - using TypeInfo = Attributes::ColorPointGX::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ChangeIndication::Id: { + using TypeInfo = Attributes::ChangeIndication::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorPointGY::Id: { - using TypeInfo = Attributes::ColorPointGY::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::InPlaceIndicator::Id: { + using TypeInfo = Attributes::InPlaceIndicator::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::ColorPointGIntensity::Id: { - using TypeInfo = Attributes::ColorPointGIntensity::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LastChangedTime::Id: { + using TypeInfo = Attributes::LastChangedTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17277,170 +6849,216 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::ColorPointBX::Id: { - using TypeInfo = Attributes::ColorPointBX::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ReplacementProductList::Id: { + using TypeInfo = Attributes::ReplacementProductList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::ColorPointBY::Id: { - using TypeInfo = Attributes::ColorPointBY::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRHEPAFilterMonitoringClusterReplacementProductStruct * newElement_0; + newElement_0 = [MTRHEPAFilterMonitoringClusterReplacementProductStruct new]; + newElement_0.productIdentifierType = + [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.productIdentifierType)]; + newElement_0.productIdentifierValue = AsString(entry_0.productIdentifierValue); + if (newElement_0.productIdentifierValue == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ColorPointBIntensity::Id: { - using TypeInfo = Attributes::ColorPointBIntensity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::EnhancedCurrentHue::Id: { - using TypeInfo = Attributes::EnhancedCurrentHue::TypeInfo; + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForActivatedCarbonFilterMonitoringCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ActivatedCarbonFilterMonitoring; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::Condition::Id: { + using TypeInfo = Attributes::Condition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::EnhancedColorMode::Id: { - using TypeInfo = Attributes::EnhancedColorMode::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::DegradationDirection::Id: { + using TypeInfo = Attributes::DegradationDirection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorLoopActive::Id: { - using TypeInfo = Attributes::ColorLoopActive::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ChangeIndication::Id: { + using TypeInfo = Attributes::ChangeIndication::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ColorLoopDirection::Id: { - using TypeInfo = Attributes::ColorLoopDirection::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::InPlaceIndicator::Id: { + using TypeInfo = Attributes::InPlaceIndicator::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::ColorLoopTime::Id: { - using TypeInfo = Attributes::ColorLoopTime::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LastChangedTime::Id: { + using TypeInfo = Attributes::LastChangedTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } - case Attributes::ColorLoopStartEnhancedHue::Id: { - using TypeInfo = Attributes::ColorLoopStartEnhancedHue::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::ReplacementProductList::Id: { + using TypeInfo = Attributes::ReplacementProductList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRActivatedCarbonFilterMonitoringClusterReplacementProductStruct * newElement_0; + newElement_0 = [MTRActivatedCarbonFilterMonitoringClusterReplacementProductStruct new]; + newElement_0.productIdentifierType = + [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.productIdentifierType)]; + newElement_0.productIdentifierValue = AsString(entry_0.productIdentifierValue); + if (newElement_0.productIdentifierValue == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } return value; } - case Attributes::ColorLoopStoredEnhancedHue::Id: { - using TypeInfo = Attributes::ColorLoopStoredEnhancedHue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; } - case Attributes::ColorCapabilities::Id: { - using TypeInfo = Attributes::ColorCapabilities::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; } - case Attributes::ColorTempPhysicalMinMireds::Id: { - using TypeInfo = Attributes::ColorTempPhysicalMinMireds::TypeInfo; + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForDoorLockCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::DoorLock; + switch (aAttributeId) { + case Attributes::LockState::Id: { + using TypeInfo = Attributes::LockState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; + } return value; } - case Attributes::ColorTempPhysicalMaxMireds::Id: { - using TypeInfo = Attributes::ColorTempPhysicalMaxMireds::TypeInfo; + case Attributes::LockType::Id: { + using TypeInfo = Attributes::LockType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::CoupleColorTempToLevelMinMireds::Id: { - using TypeInfo = Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; + case Attributes::ActuatorEnabled::Id: { + using TypeInfo = Attributes::ActuatorEnabled::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::StartUpColorTemperatureMireds::Id: { - using TypeInfo = Attributes::StartUpColorTemperatureMireds::TypeInfo; + case Attributes::DoorState::Id: { + using TypeInfo = Attributes::DoorState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17450,129 +7068,67 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::DoorOpenEvents::Id: { + using TypeInfo = Attributes::DoorOpenEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::DoorClosedEvents::Id: { + using TypeInfo = Attributes::DoorClosedEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::OpenPeriod::Id: { + using TypeInfo = Attributes::OpenPeriod::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::NumberOfTotalUsersSupported::Id: { + using TypeInfo = Attributes::NumberOfTotalUsersSupported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::NumberOfPINUsersSupported::Id: { + using TypeInfo = Attributes::NumberOfPINUsersSupported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::NumberOfRFIDUsersSupported::Id: { + using TypeInfo = Attributes::NumberOfRFIDUsersSupported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17582,21 +7138,8 @@ static id _Nullable DecodeAttributeValueForColorControlCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::BallastConfiguration; - switch (aAttributeId) { - case Attributes::PhysicalMinLevel::Id: { - using TypeInfo = Attributes::PhysicalMinLevel::TypeInfo; + case Attributes::NumberOfWeekDaySchedulesSupportedPerUser::Id: { + using TypeInfo = Attributes::NumberOfWeekDaySchedulesSupportedPerUser::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17606,8 +7149,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PhysicalMaxLevel::Id: { - using TypeInfo = Attributes::PhysicalMaxLevel::TypeInfo; + case Attributes::NumberOfYearDaySchedulesSupportedPerUser::Id: { + using TypeInfo = Attributes::NumberOfYearDaySchedulesSupportedPerUser::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17617,8 +7160,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::BallastStatus::Id: { - using TypeInfo = Attributes::BallastStatus::TypeInfo; + case Attributes::NumberOfHolidaySchedulesSupported::Id: { + using TypeInfo = Attributes::NumberOfHolidaySchedulesSupported::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17628,8 +7171,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MinLevel::Id: { - using TypeInfo = Attributes::MinLevel::TypeInfo; + case Attributes::MaxPINCodeLength::Id: { + using TypeInfo = Attributes::MaxPINCodeLength::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17639,8 +7182,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MaxLevel::Id: { - using TypeInfo = Attributes::MaxLevel::TypeInfo; + case Attributes::MinPINCodeLength::Id: { + using TypeInfo = Attributes::MinPINCodeLength::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17650,38 +7193,41 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::IntrinsicBallastFactor::Id: { - using TypeInfo = Attributes::IntrinsicBallastFactor::TypeInfo; + case Attributes::MaxRFIDCodeLength::Id: { + using TypeInfo = Attributes::MaxRFIDCodeLength::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::BallastFactorAdjustment::Id: { - using TypeInfo = Attributes::BallastFactorAdjustment::TypeInfo; + case Attributes::MinRFIDCodeLength::Id: { + using TypeInfo = Attributes::MinRFIDCodeLength::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::CredentialRulesSupport::Id: { + using TypeInfo = Attributes::CredentialRulesSupport::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } - case Attributes::LampQuantity::Id: { - using TypeInfo = Attributes::LampQuantity::TypeInfo; + case Attributes::NumberOfCredentialsSupportedPerUser::Id: { + using TypeInfo = Attributes::NumberOfCredentialsSupportedPerUser::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17691,8 +7237,8 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::LampType::Id: { - using TypeInfo = Attributes::LampType::TypeInfo; + case Attributes::Language::Id: { + using TypeInfo = Attributes::Language::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17707,266 +7253,173 @@ static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( } return value; } - case Attributes::LampManufacturer::Id: { - using TypeInfo = Attributes::LampManufacturer::TypeInfo; + case Attributes::LEDSettings::Id: { + using TypeInfo = Attributes::LEDSettings::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::AutoRelockTime::Id: { + using TypeInfo = Attributes::AutoRelockTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::LampRatedHours::Id: { - using TypeInfo = Attributes::LampRatedHours::TypeInfo; + case Attributes::SoundVolume::Id: { + using TypeInfo = Attributes::SoundVolume::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::LampBurnHours::Id: { - using TypeInfo = Attributes::LampBurnHours::TypeInfo; + case Attributes::OperatingMode::Id: { + using TypeInfo = Attributes::OperatingMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::LampAlarmMode::Id: { - using TypeInfo = Attributes::LampAlarmMode::TypeInfo; + case Attributes::SupportedOperatingModes::Id: { + using TypeInfo = Attributes::SupportedOperatingModes::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } - case Attributes::LampBurnHoursTripPoint::Id: { - using TypeInfo = Attributes::LampBurnHoursTripPoint::TypeInfo; + case Attributes::DefaultConfigurationRegister::Id: { + using TypeInfo = Attributes::DefaultConfigurationRegister::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::EnableLocalProgramming::Id: { + using TypeInfo = Attributes::EnableLocalProgramming::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::EnableOneTouchLocking::Id: { + using TypeInfo = Attributes::EnableOneTouchLocking::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::EnableInsideStatusLED::Id: { + using TypeInfo = Attributes::EnableInsideStatusLED::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::EnablePrivacyModeButton::Id: { + using TypeInfo = Attributes::EnablePrivacyModeButton::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::LocalProgrammingFeatures::Id: { + using TypeInfo = Attributes::LocalProgrammingFeatures::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::WrongCodeEntryLimit::Id: { + using TypeInfo = Attributes::WrongCodeEntryLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForIlluminanceMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::IlluminanceMeasurement; - switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::UserCodeTemporaryDisableTime::Id: { + using TypeInfo = Attributes::UserCodeTemporaryDisableTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::SendPINOverTheAir::Id: { + using TypeInfo = Attributes::SendPINOverTheAir::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::RequirePINforRemoteOperation::Id: { + using TypeInfo = Attributes::RequirePINforRemoteOperation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; return value; } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; + case Attributes::ExpiringUserTimeout::Id: { + using TypeInfo = Attributes::ExpiringUserTimeout::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -17976,140 +7429,95 @@ static id _Nullable DecodeAttributeValueForIlluminanceMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::LightSensorType::Id: { - using TypeInfo = Attributes::LightSensorType::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForWindowCoveringCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::WindowCovering; + switch (aAttributeId) { + case Attributes::Type::Id: { + using TypeInfo = Attributes::Type::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::PhysicalClosedLimitLift::Id: { + using TypeInfo = Attributes::PhysicalClosedLimitLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::PhysicalClosedLimitTilt::Id: { + using TypeInfo = Attributes::PhysicalClosedLimitTilt::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::CurrentPositionLift::Id: { + using TypeInfo = Attributes::CurrentPositionLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::CurrentPositionTilt::Id: { + using TypeInfo = Attributes::CurrentPositionTilt::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::NumberOfActuationsLift::Id: { + using TypeInfo = Attributes::NumberOfActuationsLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::NumberOfActuationsTilt::Id: { + using TypeInfo = Attributes::NumberOfActuationsTilt::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18119,21 +7527,34 @@ static id _Nullable DecodeAttributeValueForIlluminanceMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - default: { - break; + case Attributes::ConfigStatus::Id: { + using TypeInfo = Attributes::ConfigStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; } + case Attributes::CurrentPositionLiftPercentage::Id: { + using TypeInfo = Attributes::CurrentPositionLiftPercentage::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } + return value; } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::TemperatureMeasurement; - switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::CurrentPositionTiltPercentage::Id: { + using TypeInfo = Attributes::CurrentPositionTiltPercentage::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18143,12 +7564,23 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::OperationalStatus::Id: { + using TypeInfo = Attributes::OperationalStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::TargetPositionLiftPercent100ths::Id: { + using TypeInfo = Attributes::TargetPositionLiftPercent100ths::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18158,12 +7590,12 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::TargetPositionTiltPercent100ths::Id: { + using TypeInfo = Attributes::TargetPositionTiltPercent100ths::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18173,147 +7605,115 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; + case Attributes::EndProductType::Id: { + using TypeInfo = Attributes::EndProductType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::CurrentPositionLiftPercent100ths::Id: { + using TypeInfo = Attributes::CurrentPositionLiftPercent100ths::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::CurrentPositionTiltPercent100ths::Id: { + using TypeInfo = Attributes::CurrentPositionTiltPercent100ths::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::InstalledOpenLimitLift::Id: { + using TypeInfo = Attributes::InstalledOpenLimitLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::InstalledClosedLimitLift::Id: { + using TypeInfo = Attributes::InstalledClosedLimitLift::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::InstalledOpenLimitTilt::Id: { + using TypeInfo = Attributes::InstalledOpenLimitTilt::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::InstalledClosedLimitTilt::Id: { + using TypeInfo = Attributes::InstalledClosedLimitTilt::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::Mode::Id: { + using TypeInfo = Attributes::Mode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + return value; + } + case Attributes::SafetyStatus::Id: { + using TypeInfo = Attributes::SafetyStatus::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } default: { @@ -18324,58 +7724,46 @@ static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForPressureMeasurementCluster( +static id _Nullable DecodeAttributeValueForBarrierControlCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::PressureMeasurement; + using namespace Clusters::BarrierControl; switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::BarrierMovingState::Id: { + using TypeInfo = Attributes::BarrierMovingState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::BarrierSafetyStatus::Id: { + using TypeInfo = Attributes::BarrierSafetyStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::BarrierCapabilities::Id: { + using TypeInfo = Attributes::BarrierCapabilities::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; + case Attributes::BarrierOpenEvents::Id: { + using TypeInfo = Attributes::BarrierOpenEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18385,53 +7773,52 @@ static id _Nullable DecodeAttributeValueForPressureMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ScaledValue::Id: { - using TypeInfo = Attributes::ScaledValue::TypeInfo; + case Attributes::BarrierCloseEvents::Id: { + using TypeInfo = Attributes::BarrierCloseEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::MinScaledValue::Id: { - using TypeInfo = Attributes::MinScaledValue::TypeInfo; + case Attributes::BarrierCommandOpenEvents::Id: { + using TypeInfo = Attributes::BarrierCommandOpenEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::MaxScaledValue::Id: { - using TypeInfo = Attributes::MaxScaledValue::TypeInfo; + case Attributes::BarrierCommandCloseEvents::Id: { + using TypeInfo = Attributes::BarrierCommandCloseEvents::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithShort:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::BarrierOpenPeriod::Id: { + using TypeInfo = Attributes::BarrierOpenPeriod::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ScaledTolerance::Id: { - using TypeInfo = Attributes::ScaledTolerance::TypeInfo; + case Attributes::BarrierClosePeriod::Id: { + using TypeInfo = Attributes::BarrierClosePeriod::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18441,160 +7828,122 @@ static id _Nullable DecodeAttributeValueForPressureMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::Scale::Id: { - using TypeInfo = Attributes::Scale::TypeInfo; + case Attributes::BarrierPosition::Id: { + using TypeInfo = Attributes::BarrierPosition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPumpConfigurationAndControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PumpConfigurationAndControl; + switch (aAttributeId) { + case Attributes::MaxPressure::Id: { + using TypeInfo = Attributes::MaxPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::MaxSpeed::Id: { + using TypeInfo = Attributes::MaxSpeed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MaxFlow::Id: { + using TypeInfo = Attributes::MaxFlow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::MinConstPressure::Id: { + using TypeInfo = Attributes::MinConstPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::MaxConstPressure::Id: { + using TypeInfo = Attributes::MaxConstPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::MinCompPressure::Id: { + using TypeInfo = Attributes::MinCompPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::FlowMeasurement; - switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::MaxCompPressure::Id: { + using TypeInfo = Attributes::MaxCompPressure::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18604,12 +7953,12 @@ static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::MinConstSpeed::Id: { + using TypeInfo = Attributes::MinConstSpeed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18623,8 +7972,8 @@ static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( } return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::MaxConstSpeed::Id: { + using TypeInfo = Attributes::MaxConstSpeed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18638,160 +7987,101 @@ static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( } return value; } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; + case Attributes::MinConstFlow::Id: { + using TypeInfo = Attributes::MinConstFlow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::MaxConstFlow::Id: { + using TypeInfo = Attributes::MaxConstFlow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::MinConstTemp::Id: { + using TypeInfo = Attributes::MinConstTemp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MaxConstTemp::Id: { + using TypeInfo = Attributes::MaxConstTemp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PumpStatus::Id: { + using TypeInfo = Attributes::PumpStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::EffectiveOperationMode::Id: { + using TypeInfo = Attributes::EffectiveOperationMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::EffectiveControlMode::Id: { + using TypeInfo = Attributes::EffectiveControlMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::RelativeHumidityMeasurement; - switch (aAttributeId) { - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::Capacity::Id: { + using TypeInfo = Attributes::Capacity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18801,12 +8091,12 @@ static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::Speed::Id: { + using TypeInfo = Attributes::Speed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18820,8 +8110,8 @@ static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( } return value; } - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::LifetimeRunningHours::Id: { + using TypeInfo = Attributes::LifetimeRunningHours::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -18829,149 +8119,62 @@ static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( } NSNumber * _Nullable value; if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; - } - return value; - } - case Attributes::Tolerance::Id: { - using TypeInfo = Attributes::Tolerance::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Power::Id: { + using TypeInfo = Attributes::Power::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::LifetimeEnergyConsumed::Id: { + using TypeInfo = Attributes::LifetimeEnergyConsumed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::OperationMode::Id: { + using TypeInfo = Attributes::OperationMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ControlMode::Id: { + using TypeInfo = Attributes::ControlMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } default: { @@ -18982,101 +8185,109 @@ static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForOccupancySensingCluster( +static id _Nullable DecodeAttributeValueForThermostatCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::OccupancySensing; + using namespace Clusters::Thermostat; switch (aAttributeId) { - case Attributes::Occupancy::Id: { - using TypeInfo = Attributes::Occupancy::TypeInfo; + case Attributes::LocalTemperature::Id: { + using TypeInfo = Attributes::LocalTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } - case Attributes::OccupancySensorType::Id: { - using TypeInfo = Attributes::OccupancySensorType::TypeInfo; + case Attributes::OutdoorTemperature::Id: { + using TypeInfo = Attributes::OutdoorTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } - case Attributes::OccupancySensorTypeBitmap::Id: { - using TypeInfo = Attributes::OccupancySensorTypeBitmap::TypeInfo; + case Attributes::Occupancy::Id: { + using TypeInfo = Attributes::Occupancy::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PIROccupiedToUnoccupiedDelay::Id: { - using TypeInfo = Attributes::PIROccupiedToUnoccupiedDelay::TypeInfo; + case Attributes::AbsMinHeatSetpointLimit::Id: { + using TypeInfo = Attributes::AbsMinHeatSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::PIRUnoccupiedToOccupiedDelay::Id: { - using TypeInfo = Attributes::PIRUnoccupiedToOccupiedDelay::TypeInfo; + case Attributes::AbsMaxHeatSetpointLimit::Id: { + using TypeInfo = Attributes::AbsMaxHeatSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::PIRUnoccupiedToOccupiedThreshold::Id: { - using TypeInfo = Attributes::PIRUnoccupiedToOccupiedThreshold::TypeInfo; + case Attributes::AbsMinCoolSetpointLimit::Id: { + using TypeInfo = Attributes::AbsMinCoolSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id: { - using TypeInfo = Attributes::UltrasonicOccupiedToUnoccupiedDelay::TypeInfo; + case Attributes::AbsMaxCoolSetpointLimit::Id: { + using TypeInfo = Attributes::AbsMaxCoolSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::UltrasonicUnoccupiedToOccupiedDelay::Id: { - using TypeInfo = Attributes::UltrasonicUnoccupiedToOccupiedDelay::TypeInfo; + case Attributes::PICoolingDemand::Id: { + using TypeInfo = Attributes::PICoolingDemand::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id: { - using TypeInfo = Attributes::UltrasonicUnoccupiedToOccupiedThreshold::TypeInfo; + case Attributes::PIHeatingDemand::Id: { + using TypeInfo = Attributes::PIHeatingDemand::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19086,497 +8297,321 @@ static id _Nullable DecodeAttributeValueForOccupancySensingCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: { - using TypeInfo = Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo; + case Attributes::HVACSystemTypeConfiguration::Id: { + using TypeInfo = Attributes::HVACSystemTypeConfiguration::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: { - using TypeInfo = Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo; + case Attributes::LocalTemperatureCalibration::Id: { + using TypeInfo = Attributes::LocalTemperatureCalibration::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithChar:cppValue]; return value; } - case Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: { - using TypeInfo = Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::TypeInfo; + case Attributes::OccupiedCoolingSetpoint::Id: { + using TypeInfo = Attributes::OccupiedCoolingSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::OccupiedHeatingSetpoint::Id: { + using TypeInfo = Attributes::OccupiedHeatingSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::UnoccupiedCoolingSetpoint::Id: { + using TypeInfo = Attributes::UnoccupiedCoolingSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::UnoccupiedHeatingSetpoint::Id: { + using TypeInfo = Attributes::UnoccupiedHeatingSetpoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::MinHeatSetpointLimit::Id: { + using TypeInfo = Attributes::MinHeatSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; + return value; + } + case Attributes::MaxHeatSetpointLimit::Id: { + using TypeInfo = Attributes::MaxHeatSetpointLimit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::MinCoolSetpointLimit::Id: { + using TypeInfo = Attributes::MinCoolSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::MaxCoolSetpointLimit::Id: { + using TypeInfo = Attributes::MaxCoolSetpointLimit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForCarbonMonoxideConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::CarbonMonoxideConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::MinSetpointDeadBand::Id: { + using TypeInfo = Attributes::MinSetpointDeadBand::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::RemoteSensing::Id: { + using TypeInfo = Attributes::RemoteSensing::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::ControlSequenceOfOperation::Id: { + using TypeInfo = Attributes::ControlSequenceOfOperation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::SystemMode::Id: { + using TypeInfo = Attributes::SystemMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::ThermostatRunningMode::Id: { + using TypeInfo = Attributes::ThermostatRunningMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::StartOfWeek::Id: { + using TypeInfo = Attributes::StartOfWeek::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::NumberOfWeeklyTransitions::Id: { + using TypeInfo = Attributes::NumberOfWeeklyTransitions::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::NumberOfDailyTransitions::Id: { + using TypeInfo = Attributes::NumberOfDailyTransitions::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::TemperatureSetpointHold::Id: { + using TypeInfo = Attributes::TemperatureSetpointHold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::TemperatureSetpointHoldDuration::Id: { + using TypeInfo = Attributes::TemperatureSetpointHoldDuration::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::ThermostatProgrammingOperationMode::Id: { + using TypeInfo = Attributes::ThermostatProgrammingOperationMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ThermostatRunningState::Id: { + using TypeInfo = Attributes::ThermostatRunningState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::SetpointChangeSource::Id: { + using TypeInfo = Attributes::SetpointChangeSource::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::SetpointChangeAmount::Id: { + using TypeInfo = Attributes::SetpointChangeAmount::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::SetpointChangeSourceTimestamp::Id: { + using TypeInfo = Attributes::SetpointChangeSourceTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } + case Attributes::OccupiedSetback::Id: { + using TypeInfo = Attributes::OccupiedSetback::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::OccupiedSetbackMin::Id: { + using TypeInfo = Attributes::OccupiedSetbackMin::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::CarbonDioxideConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::OccupiedSetbackMax::Id: { + using TypeInfo = Attributes::OccupiedSetbackMax::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19586,14 +8621,12 @@ static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurement if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::UnoccupiedSetback::Id: { + using TypeInfo = Attributes::UnoccupiedSetback::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19603,14 +8636,12 @@ static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurement if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::UnoccupiedSetbackMin::Id: { + using TypeInfo = Attributes::UnoccupiedSetbackMin::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19620,14 +8651,12 @@ static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurement if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::UnoccupiedSetbackMax::Id: { + using TypeInfo = Attributes::UnoccupiedSetbackMax::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19637,260 +8666,187 @@ static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurement if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::EmergencyHeatDelta::Id: { + using TypeInfo = Attributes::EmergencyHeatDelta::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::ACType::Id: { + using TypeInfo = Attributes::ACType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::ACCapacity::Id: { + using TypeInfo = Attributes::ACCapacity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::ACRefrigerantType::Id: { + using TypeInfo = Attributes::ACRefrigerantType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::ACCompressorType::Id: { + using TypeInfo = Attributes::ACCompressorType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::ACErrorCode::Id: { + using TypeInfo = Attributes::ACErrorCode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::ACLouverPosition::Id: { + using TypeInfo = Attributes::ACLouverPosition::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ACCoilTemperature::Id: { + using TypeInfo = Attributes::ACCoilTemperature::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ACCapacityformat::Id: { + using TypeInfo = Attributes::ACCapacityformat::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForFanControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::FanControl; + switch (aAttributeId) { + case Attributes::FanMode::Id: { + using TypeInfo = Attributes::FanMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::FanModeSequence::Id: { + using TypeInfo = Attributes::FanModeSequence::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PercentSetting::Id: { + using TypeInfo = Attributes::PercentSetting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::PercentCurrent::Id: { + using TypeInfo = Attributes::PercentCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::SpeedMax::Id: { + using TypeInfo = Attributes::SpeedMax::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForNitrogenDioxideConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::NitrogenDioxideConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::SpeedSetting::Id: { + using TypeInfo = Attributes::SpeedSetting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -19900,311 +8856,254 @@ static id _Nullable DecodeAttributeValueForNitrogenDioxideConcentrationMeasureme if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::SpeedCurrent::Id: { + using TypeInfo = Attributes::SpeedCurrent::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::RockSupport::Id: { + using TypeInfo = Attributes::RockSupport::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::RockSetting::Id: { + using TypeInfo = Attributes::RockSetting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::WindSupport::Id: { + using TypeInfo = Attributes::WindSupport::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::WindSetting::Id: { + using TypeInfo = Attributes::WindSetting::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::AirflowDirection::Id: { + using TypeInfo = Attributes::AirflowDirection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForThermostatUserInterfaceConfigurationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ThermostatUserInterfaceConfiguration; + switch (aAttributeId) { + case Attributes::TemperatureDisplayMode::Id: { + using TypeInfo = Attributes::TemperatureDisplayMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::KeypadLockout::Id: { + using TypeInfo = Attributes::KeypadLockout::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::ScheduleProgrammingVisibility::Id: { + using TypeInfo = Attributes::ScheduleProgrammingVisibility::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForColorControlCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ColorControl; + switch (aAttributeId) { + case Attributes::CurrentHue::Id: { + using TypeInfo = Attributes::CurrentHue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::CurrentSaturation::Id: { + using TypeInfo = Attributes::CurrentSaturation::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::RemainingTime::Id: { + using TypeInfo = Attributes::RemainingTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::CurrentX::Id: { + using TypeInfo = Attributes::CurrentX::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::CurrentY::Id: { + using TypeInfo = Attributes::CurrentY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::DriftCompensation::Id: { + using TypeInfo = Attributes::DriftCompensation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::CompensationText::Id: { + using TypeInfo = Attributes::CompensationText::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::ColorTemperatureMireds::Id: { + using TypeInfo = Attributes::ColorTemperatureMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ColorMode::Id: { + using TypeInfo = Attributes::ColorMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } + case Attributes::Options::Id: { + using TypeInfo = Attributes::Options::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::OzoneConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::NumberOfPrimaries::Id: { + using TypeInfo = Attributes::NumberOfPrimaries::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20214,31 +9113,34 @@ static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::Primary1X::Id: { + using TypeInfo = Attributes::Primary1X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::Primary1Y::Id: { + using TypeInfo = Attributes::Primary1Y::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::Primary1Intensity::Id: { + using TypeInfo = Attributes::Primary1Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20248,44 +9150,34 @@ static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::Primary2X::Id: { + using TypeInfo = Attributes::Primary2X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::Primary2Y::Id: { + using TypeInfo = Attributes::Primary2Y::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::Primary2Intensity::Id: { + using TypeInfo = Attributes::Primary2Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20295,204 +9187,171 @@ static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::Primary3X::Id: { + using TypeInfo = Attributes::Primary3X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::Primary3Y::Id: { + using TypeInfo = Attributes::Primary3Y::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::Primary3Intensity::Id: { + using TypeInfo = Attributes::Primary3Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::Primary4X::Id: { + using TypeInfo = Attributes::Primary4X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::Primary4Y::Id: { + using TypeInfo = Attributes::Primary4Y::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::Primary4Intensity::Id: { + using TypeInfo = Attributes::Primary4Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::Primary5X::Id: { + using TypeInfo = Attributes::Primary5X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::Primary5Y::Id: { + using TypeInfo = Attributes::Primary5Y::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::Primary5Intensity::Id: { + using TypeInfo = Attributes::Primary5Intensity::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Primary6X::Id: { + using TypeInfo = Attributes::Primary6X::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::Primary6Y::Id: { + using TypeInfo = Attributes::Primary6Y::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::Primary6Intensity::Id: { + using TypeInfo = Attributes::Primary6Intensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::WhitePointX::Id: { + using TypeInfo = Attributes::WhitePointX::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::WhitePointY::Id: { + using TypeInfo = Attributes::WhitePointY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20502,57 +9361,30 @@ static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Pm25ConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::ColorPointRX::Id: { + using TypeInfo = Attributes::ColorPointRX::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::ColorPointRY::Id: { + using TypeInfo = Attributes::ColorPointRY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::ColorPointRIntensity::Id: { + using TypeInfo = Attributes::ColorPointRIntensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20562,44 +9394,34 @@ static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::ColorPointGX::Id: { + using TypeInfo = Attributes::ColorPointGX::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::ColorPointGY::Id: { + using TypeInfo = Attributes::ColorPointGY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::ColorPointGIntensity::Id: { + using TypeInfo = Attributes::ColorPointGIntensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20609,204 +9431,126 @@ static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::ColorPointBX::Id: { + using TypeInfo = Attributes::ColorPointBX::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::ColorPointBY::Id: { + using TypeInfo = Attributes::ColorPointBY::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::ColorPointBIntensity::Id: { + using TypeInfo = Attributes::ColorPointBIntensity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::EnhancedCurrentHue::Id: { + using TypeInfo = Attributes::EnhancedCurrentHue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::EnhancedColorMode::Id: { + using TypeInfo = Attributes::EnhancedColorMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::ColorLoopActive::Id: { + using TypeInfo = Attributes::ColorLoopActive::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ColorLoopDirection::Id: { + using TypeInfo = Attributes::ColorLoopDirection::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::ColorLoopTime::Id: { + using TypeInfo = Attributes::ColorLoopTime::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::ColorLoopStartEnhancedHue::Id: { + using TypeInfo = Attributes::ColorLoopStartEnhancedHue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::ColorLoopStoredEnhancedHue::Id: { + using TypeInfo = Attributes::ColorLoopStoredEnhancedHue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ColorCapabilities::Id: { + using TypeInfo = Attributes::ColorCapabilities::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20816,74 +9560,41 @@ static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForFormaldehydeConcentrationMeasurementCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::FormaldehydeConcentrationMeasurement; - switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasuredValue::Id: { - using TypeInfo = Attributes::MeasuredValue::TypeInfo; + case Attributes::ColorTempPhysicalMinMireds::Id: { + using TypeInfo = Attributes::ColorTempPhysicalMinMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MinMeasuredValue::Id: { - using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + case Attributes::ColorTempPhysicalMaxMireds::Id: { + using TypeInfo = Attributes::ColorTempPhysicalMaxMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MaxMeasuredValue::Id: { - using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + case Attributes::CoupleColorTempToLevelMinMireds::Id: { + using TypeInfo = Attributes::CoupleColorTempToLevelMinMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::StartUpColorTemperatureMireds::Id: { + using TypeInfo = Attributes::StartUpColorTemperatureMireds::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -20893,244 +9604,207 @@ static id _Nullable DecodeAttributeValueForFormaldehydeConcentrationMeasurementC if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForBallastConfigurationCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::BallastConfiguration; + switch (aAttributeId) { + case Attributes::PhysicalMinLevel::Id: { + using TypeInfo = Attributes::PhysicalMinLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::PhysicalMaxLevel::Id: { + using TypeInfo = Attributes::PhysicalMaxLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::BallastStatus::Id: { + using TypeInfo = Attributes::BallastStatus::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::MinLevel::Id: { + using TypeInfo = Attributes::MinLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::MaxLevel::Id: { + using TypeInfo = Attributes::MaxLevel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::IntrinsicBallastFactor::Id: { + using TypeInfo = Attributes::IntrinsicBallastFactor::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::BallastFactorAdjustment::Id: { + using TypeInfo = Attributes::BallastFactorAdjustment::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::LampQuantity::Id: { + using TypeInfo = Attributes::LampQuantity::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::LampType::Id: { + using TypeInfo = Attributes::LampType::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + return value; + } + case Attributes::LampManufacturer::Id: { + using TypeInfo = Attributes::LampManufacturer::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::LampRatedHours::Id: { + using TypeInfo = Attributes::LampRatedHours::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::LampBurnHours::Id: { + using TypeInfo = Attributes::LampBurnHours::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::LampAlarmMode::Id: { + using TypeInfo = Attributes::LampAlarmMode::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::LampBurnHoursTripPoint::Id: { + using TypeInfo = Attributes::LampBurnHoursTripPoint::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -21139,12 +9813,11 @@ static id _Nullable DecodeAttributeValueForFormaldehydeConcentrationMeasurementC *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( +static id _Nullable DecodeAttributeValueForIlluminanceMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Pm1ConcentrationMeasurement; + using namespace Clusters::IlluminanceMeasurement; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL case Attributes::MeasuredValue::Id: { using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21156,12 +9829,10 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL case Attributes::MinMeasuredValue::Id: { using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21173,12 +9844,10 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL case Attributes::MaxMeasuredValue::Id: { using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21190,14 +9859,23 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::LightSensorType::Id: { + using TypeInfo = Attributes::LightSensorType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21207,27 +9885,40 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value())]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTemperatureMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TemperatureMeasurement; + switch (aAttributeId) { + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21237,214 +9928,172 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPressureMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::PressureMeasurement; + switch (aAttributeId) { + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; + } + return value; + } + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::ScaledValue::Id: { + using TypeInfo = Attributes::ScaledValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MinScaledValue::Id: { + using TypeInfo = Attributes::MinScaledValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::MaxScaledValue::Id: { + using TypeInfo = Attributes::MaxScaledValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::ScaledTolerance::Id: { + using TypeInfo = Attributes::ScaledTolerance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::Scale::Id: { + using TypeInfo = Attributes::Scale::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -21453,12 +10102,11 @@ static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( +static id _Nullable DecodeAttributeValueForFlowMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::Pm10ConcentrationMeasurement; + using namespace Clusters::FlowMeasurement; switch (aAttributeId) { -#if MTR_ENABLE_PROVISIONAL case Attributes::MeasuredValue::Id: { using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21470,12 +10118,10 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL case Attributes::MinMeasuredValue::Id: { using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21487,12 +10133,10 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL case Attributes::MaxMeasuredValue::Id: { using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; @@ -21504,14 +10148,36 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValue::Id: { - using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForRelativeHumidityMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::RelativeHumidityMeasurement; + switch (aAttributeId) { + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21521,27 +10187,27 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::PeakMeasuredValueWindow::Id: { - using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValue::Id: { - using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21551,40 +10217,47 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; } return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + case Attributes::Tolerance::Id: { + using TypeInfo = Attributes::Tolerance::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForOccupancySensingCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::OccupancySensing; + switch (aAttributeId) { + case Attributes::Occupancy::Id: { + using TypeInfo = Attributes::Occupancy::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + case Attributes::OccupancySensorType::Id: { + using TypeInfo = Attributes::OccupancySensorType::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -21594,171 +10267,116 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + case Attributes::OccupancySensorTypeBitmap::Id: { + using TypeInfo = Attributes::OccupancySensorTypeBitmap::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; + case Attributes::PIROccupiedToUnoccupiedDelay::Id: { + using TypeInfo = Attributes::PIROccupiedToUnoccupiedDelay::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::PIRUnoccupiedToOccupiedDelay::Id: { + using TypeInfo = Attributes::PIRUnoccupiedToOccupiedDelay::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; + return value; + } + case Attributes::PIRUnoccupiedToOccupiedThreshold::Id: { + using TypeInfo = Attributes::PIRUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::UltrasonicOccupiedToUnoccupiedDelay::Id: { + using TypeInfo = Attributes::UltrasonicOccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::UltrasonicUnoccupiedToOccupiedDelay::Id: { + using TypeInfo = Attributes::UltrasonicUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::UltrasonicUnoccupiedToOccupiedThreshold::Id: { + using TypeInfo = Attributes::UltrasonicUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PhysicalContactOccupiedToUnoccupiedDelay::Id: { + using TypeInfo = Attributes::PhysicalContactOccupiedToUnoccupiedDelay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::PhysicalContactUnoccupiedToOccupiedDelay::Id: { + using TypeInfo = Attributes::PhysicalContactUnoccupiedToOccupiedDelay::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::Id: { + using TypeInfo = Attributes::PhysicalContactUnoccupiedToOccupiedThreshold::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -21767,10 +10385,10 @@ static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForTotalVolatileOrganicCompoundsConcentrationMeasurementCluster( +static id _Nullable DecodeAttributeValueForCarbonMonoxideConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement; + using namespace Clusters::CarbonMonoxideConcentrationMeasurement; switch (aAttributeId) { #if MTR_ENABLE_PROVISIONAL case Attributes::MeasuredValue::Id: { @@ -21859,217 +10477,79 @@ static id _Nullable DecodeAttributeValueForTotalVolatileOrganicCompoundsConcentr TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithFloat:cppValue.Value()]; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AverageMeasuredValueWindow::Id: { - using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::Uncertainty::Id: { - using TypeInfo = Attributes::Uncertainty::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementUnit::Id: { - using TypeInfo = Attributes::MeasurementUnit::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::MeasurementMedium::Id: { - using TypeInfo = Attributes::MeasurementMedium::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::LevelValue::Id: { - using TypeInfo = Attributes::LevelValue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL @@ -22081,10 +10561,10 @@ static id _Nullable DecodeAttributeValueForTotalVolatileOrganicCompoundsConcentr *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForRadonConcentrationMeasurementCluster( +static id _Nullable DecodeAttributeValueForCarbonDioxideConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::RadonConcentrationMeasurement; + using namespace Clusters::CarbonDioxideConcentrationMeasurement; switch (aAttributeId) { #if MTR_ENABLE_PROVISIONAL case Attributes::MeasuredValue::Id: { @@ -22249,141 +10729,179 @@ static id _Nullable DecodeAttributeValueForRadonConcentrationMeasurementCluster( return value; } #endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForNitrogenDioxideConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::NitrogenDioxideConcentrationMeasurement; + switch (aAttributeId) { #if MTR_ENABLE_PROVISIONAL - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } #endif // MTR_ENABLE_PROVISIONAL @@ -22395,134 +10913,112 @@ static id _Nullable DecodeAttributeValueForRadonConcentrationMeasurementCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForWakeOnLANCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForOzoneConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::WakeOnLan; + using namespace Clusters::OzoneConcentrationMeasurement; switch (aAttributeId) { - case Attributes::MACAddress::Id: { - using TypeInfo = Attributes::MACAddress::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -22532,284 +11028,173 @@ static id _Nullable DecodeAttributeValueForWakeOnLANCluster(AttributeId aAttribu value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithFloat:cppValue]; return value; } - default: { - break; - } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::Channel; - switch (aAttributeId) { - case Attributes::ChannelList::Id: { - using TypeInfo = Attributes::ChannelList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRChannelClusterChannelInfoStruct * newElement_0; - newElement_0 = [MTRChannelClusterChannelInfoStruct new]; - newElement_0.majorNumber = [NSNumber numberWithUnsignedShort:entry_0.majorNumber]; - newElement_0.minorNumber = [NSNumber numberWithUnsignedShort:entry_0.minorNumber]; - if (entry_0.name.HasValue()) { - newElement_0.name = AsString(entry_0.name.Value()); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.name = nil; - } - if (entry_0.callSign.HasValue()) { - newElement_0.callSign = AsString(entry_0.callSign.Value()); - if (newElement_0.callSign == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.callSign = nil; - } - if (entry_0.affiliateCallSign.HasValue()) { - newElement_0.affiliateCallSign = AsString(entry_0.affiliateCallSign.Value()); - if (newElement_0.affiliateCallSign == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - newElement_0.affiliateCallSign = nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::Lineup::Id: { - using TypeInfo = Attributes::Lineup::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPM25ConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Pm25ConcentrationMeasurement; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRChannelClusterLineupInfoStruct * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRChannelClusterLineupInfoStruct new]; - value.operatorName = AsString(cppValue.Value().operatorName); - if (value.operatorName == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - if (cppValue.Value().lineupName.HasValue()) { - value.lineupName = AsString(cppValue.Value().lineupName.Value()); - if (value.lineupName == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.lineupName = nil; - } - if (cppValue.Value().postalCode.HasValue()) { - value.postalCode = AsString(cppValue.Value().postalCode.Value()); - if (value.postalCode == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.postalCode = nil; - } - value.lineupInfoType = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().lineupInfoType)]; + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::CurrentChannel::Id: { - using TypeInfo = Attributes::CurrentChannel::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRChannelClusterChannelInfoStruct * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRChannelClusterChannelInfoStruct new]; - value.majorNumber = [NSNumber numberWithUnsignedShort:cppValue.Value().majorNumber]; - value.minorNumber = [NSNumber numberWithUnsignedShort:cppValue.Value().minorNumber]; - if (cppValue.Value().name.HasValue()) { - value.name = AsString(cppValue.Value().name.Value()); - if (value.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.name = nil; - } - if (cppValue.Value().callSign.HasValue()) { - value.callSign = AsString(cppValue.Value().callSign.Value()); - if (value.callSign == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.callSign = nil; - } - if (cppValue.Value().affiliateCallSign.HasValue()) { - value.affiliateCallSign = AsString(cppValue.Value().affiliateCallSign.Value()); - if (value.affiliateCallSign == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } else { - value.affiliateCallSign = nil; - } + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -22819,17 +11204,59 @@ static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttribute value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -22838,163 +11265,112 @@ static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttribute *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForTargetNavigatorCluster( +static id _Nullable DecodeAttributeValueForFormaldehydeConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::TargetNavigator; + using namespace Clusters::FormaldehydeConcentrationMeasurement; switch (aAttributeId) { - case Attributes::TargetList::Id: { - using TypeInfo = Attributes::TargetList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRTargetNavigatorClusterTargetInfoStruct * newElement_0; - newElement_0 = [MTRTargetNavigatorClusterTargetInfoStruct new]; - newElement_0.identifier = [NSNumber numberWithUnsignedChar:entry_0.identifier]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::CurrentTarget::Id: { - using TypeInfo = Attributes::CurrentTarget::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23004,32 +11380,23 @@ static id _Nullable DecodeAttributeValueForTargetNavigatorCluster( value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithFloat:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::MediaPlayback; - switch (aAttributeId) { - case Attributes::CurrentState::Id: { - using TypeInfo = Attributes::CurrentState::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23039,70 +11406,83 @@ static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::StartTime::Id: { - using TypeInfo = Attributes::StartTime::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::Duration::Id: { - using TypeInfo = Attributes::Duration::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nullable value; - if (cppValue.IsNull()) { - value = nil; - } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::SampledPosition::Id: { - using TypeInfo = Attributes::SampledPosition::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForPM1ConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Pm1ConcentrationMeasurement; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRMediaPlaybackClusterPlaybackPositionStruct * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRMediaPlaybackClusterPlaybackPositionStruct new]; - value.updatedAt = [NSNumber numberWithUnsignedLongLong:cppValue.Value().updatedAt]; - if (cppValue.Value().position.IsNull()) { - value.position = nil; - } else { - value.position = [NSNumber numberWithUnsignedLongLong:cppValue.Value().position.Value()]; - } + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::PlaybackSpeed::Id: { - using TypeInfo = Attributes::PlaybackSpeed::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithFloat:cppValue]; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } return value; } - case Attributes::SeekRangeEnd::Id: { - using TypeInfo = Attributes::SeekRangeEnd::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23112,12 +11492,14 @@ static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::SeekRangeStart::Id: { - using TypeInfo = Attributes::SeekRangeStart::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23127,138 +11509,106 @@ static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -23267,190 +11617,174 @@ static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForMediaInputCluster( +static id _Nullable DecodeAttributeValueForPM10ConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::MediaInput; + using namespace Clusters::Pm10ConcentrationMeasurement; switch (aAttributeId) { - case Attributes::InputList::Id: { - using TypeInfo = Attributes::InputList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRMediaInputClusterInputInfoStruct * newElement_0; - newElement_0 = [MTRMediaInputClusterInputInfoStruct new]; - newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; - newElement_0.inputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.inputType)]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - newElement_0.descriptionString = AsString(entry_0.description); - if (newElement_0.descriptionString == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::CurrentInput::Id: { - using TypeInfo = Attributes::CurrentInput::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -23459,118 +11793,82 @@ static id _Nullable DecodeAttributeValueForMediaInputCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForLowPowerCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForTotalVolatileOrganicCompoundsConcentrationMeasurementCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::LowPower; + using namespace Clusters::TotalVolatileOrganicCompoundsConcentrationMeasurement; switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23580,158 +11878,89 @@ static id _Nullable DecodeAttributeValueForLowPowerCluster(AttributeId aAttribut value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForKeypadInputCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::KeypadInput; - switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -23740,44 +11969,82 @@ static id _Nullable DecodeAttributeValueForKeypadInputCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForContentLauncherCluster( +static id _Nullable DecodeAttributeValueForRadonConcentrationMeasurementCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ContentLauncher; + using namespace Clusters::RadonConcentrationMeasurement; switch (aAttributeId) { - case Attributes::AcceptHeader::Id: { - using TypeInfo = Attributes::AcceptHeader::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasuredValue::Id: { + using TypeInfo = Attributes::MeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSString * newElement_0; - newElement_0 = AsString(entry_0); - if (newElement_0 == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::SupportedStreamingProtocols::Id: { - using TypeInfo = Attributes::SupportedStreamingProtocols::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MinMeasuredValue::Id: { + using TypeInfo = Attributes::MinMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MaxMeasuredValue::Id: { + using TypeInfo = Attributes::MaxMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValue::Id: { + using TypeInfo = Attributes::PeakMeasuredValue::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; + } + return value; + } +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::PeakMeasuredValueWindow::Id: { + using TypeInfo = Attributes::PeakMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23787,134 +12054,89 @@ static id _Nullable DecodeAttributeValueForContentLauncherCluster( value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValue::Id: { + using TypeInfo = Attributes::AverageMeasuredValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithFloat:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::AverageMeasuredValueWindow::Id: { + using TypeInfo = Attributes::AverageMeasuredValueWindow::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::Uncertainty::Id: { + using TypeInfo = Attributes::Uncertainty::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; return value; } #endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementUnit::Id: { + using TypeInfo = Attributes::MeasurementUnit::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::MeasurementMedium::Id: { + using TypeInfo = Attributes::MeasurementMedium::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + case Attributes::LevelValue::Id: { + using TypeInfo = Attributes::LevelValue::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } +#endif // MTR_ENABLE_PROVISIONAL default: { break; } @@ -23923,58 +12145,40 @@ static id _Nullable DecodeAttributeValueForContentLauncherCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForAudioOutputCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +static id _Nullable DecodeAttributeValueForWakeOnLANCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::AudioOutput; + using namespace Clusters::WakeOnLan; switch (aAttributeId) { - case Attributes::OutputList::Id: { - using TypeInfo = Attributes::OutputList::TypeInfo; + case Attributes::MACAddress::Id: { + using TypeInfo = Attributes::MACAddress::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - MTRAudioOutputClusterOutputInfoStruct * newElement_0; - newElement_0 = [MTRAudioOutputClusterOutputInfoStruct new]; - newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; - newElement_0.outputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.outputType)]; - newElement_0.name = AsString(entry_0.name); - if (newElement_0.name == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::CurrentOutput::Id: { - using TypeInfo = Attributes::CurrentOutput::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForChannelCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Channel; + switch (aAttributeId) { + case Attributes::ChannelList::Id: { + using TypeInfo = Attributes::ChannelList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -23986,8 +12190,40 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRChannelClusterChannelInfoStruct * newElement_0; + newElement_0 = [MTRChannelClusterChannelInfoStruct new]; + newElement_0.majorNumber = [NSNumber numberWithUnsignedShort:entry_0.majorNumber]; + newElement_0.minorNumber = [NSNumber numberWithUnsignedShort:entry_0.minorNumber]; + if (entry_0.name.HasValue()) { + newElement_0.name = AsString(entry_0.name.Value()); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.name = nil; + } + if (entry_0.callSign.HasValue()) { + newElement_0.callSign = AsString(entry_0.callSign.Value()); + if (newElement_0.callSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.callSign = nil; + } + if (entry_0.affiliateCallSign.HasValue()) { + newElement_0.affiliateCallSign = AsString(entry_0.affiliateCallSign.Value()); + if (newElement_0.affiliateCallSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + newElement_0.affiliateCallSign = nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -23999,62 +12235,110 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::Lineup::Id: { + using TypeInfo = Attributes::Lineup::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { + MTRChannelClusterLineupInfoStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRChannelClusterLineupInfoStruct new]; + value.operatorName = AsString(cppValue.Value().operatorName); + if (value.operatorName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } - value = array_0; + if (cppValue.Value().lineupName.HasValue()) { + value.lineupName = AsString(cppValue.Value().lineupName.Value()); + if (value.lineupName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.lineupName = nil; + } + if (cppValue.Value().postalCode.HasValue()) { + value.postalCode = AsString(cppValue.Value().postalCode.Value()); + if (value.postalCode == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.postalCode = nil; + } + value.lineupInfoType = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().lineupInfoType)]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::CurrentChannel::Id: { + using TypeInfo = Attributes::CurrentChannel::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; + MTRChannelClusterChannelInfoStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRChannelClusterChannelInfoStruct new]; + value.majorNumber = [NSNumber numberWithUnsignedShort:cppValue.Value().majorNumber]; + value.minorNumber = [NSNumber numberWithUnsignedShort:cppValue.Value().minorNumber]; + if (cppValue.Value().name.HasValue()) { + value.name = AsString(cppValue.Value().name.Value()); + if (value.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.name = nil; } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; + if (cppValue.Value().callSign.HasValue()) { + value.callSign = AsString(cppValue.Value().callSign.Value()); + if (value.callSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.callSign = nil; + } + if (cppValue.Value().affiliateCallSign.HasValue()) { + value.affiliateCallSign = AsString(cppValue.Value().affiliateCallSign.Value()); + if (value.affiliateCallSign == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + } else { + value.affiliateCallSign = nil; } - value = array_0; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForTargetNavigatorCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::TargetNavigator; + switch (aAttributeId) { + case Attributes::TargetList::Id: { + using TypeInfo = Attributes::TargetList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24066,8 +12350,15 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRTargetNavigatorClusterTargetInfoStruct * newElement_0; + newElement_0 = [MTRTargetNavigatorClusterTargetInfoStruct new]; + newElement_0.identifier = [NSNumber numberWithUnsignedChar:entry_0.identifier]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24079,26 +12370,15 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::CurrentTarget::Id: { + using TypeInfo = Attributes::CurrentTarget::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } default: { @@ -24109,120 +12389,129 @@ static id _Nullable DecodeAttributeValueForAudioOutputCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( +static id _Nullable DecodeAttributeValueForMediaPlaybackCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ApplicationLauncher; + using namespace Clusters::MediaPlayback; switch (aAttributeId) { - case Attributes::CatalogList::Id: { - using TypeInfo = Attributes::CatalogList::TypeInfo; + case Attributes::CurrentState::Id: { + using TypeInfo = Attributes::CurrentState::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; + return value; + } + case Attributes::StartTime::Id: { + using TypeInfo = Attributes::StartTime::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } - case Attributes::CurrentApp::Id: { - using TypeInfo = Attributes::CurrentApp::TypeInfo; + case Attributes::Duration::Id: { + using TypeInfo = Attributes::Duration::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value; + NSNumber * _Nullable value; if (cppValue.IsNull()) { value = nil; } else { - value = [MTRApplicationLauncherClusterApplicationEPStruct new]; - value.application = [MTRApplicationLauncherClusterApplicationStruct new]; - value.application.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.Value().application.catalogVendorID]; - value.application.applicationID = AsString(cppValue.Value().application.applicationID); - if (value.application.applicationID == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - if (cppValue.Value().endpoint.HasValue()) { - value.endpoint = [NSNumber numberWithUnsignedShort:cppValue.Value().endpoint.Value()]; + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + } + return value; + } + case Attributes::SampledPosition::Id: { + using TypeInfo = Attributes::SampledPosition::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRMediaPlaybackClusterPlaybackPositionStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRMediaPlaybackClusterPlaybackPositionStruct new]; + value.updatedAt = [NSNumber numberWithUnsignedLongLong:cppValue.Value().updatedAt]; + if (cppValue.Value().position.IsNull()) { + value.position = nil; } else { - value.endpoint = nil; + value.position = [NSNumber numberWithUnsignedLongLong:cppValue.Value().position.Value()]; } } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::PlaybackSpeed::Id: { + using TypeInfo = Attributes::PlaybackSpeed::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nonnull value; + value = [NSNumber numberWithFloat:cppValue]; + return value; + } + case Attributes::SeekRangeEnd::Id: { + using TypeInfo = Attributes::SeekRangeEnd::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::SeekRangeStart::Id: { + using TypeInfo = Attributes::SeekRangeStart::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSNumber * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForMediaInputCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::MediaInput; + switch (aAttributeId) { + case Attributes::InputList::Id: { + using TypeInfo = Attributes::InputList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24234,8 +12523,22 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + MTRMediaInputClusterInputInfoStruct * newElement_0; + newElement_0 = [MTRMediaInputClusterInputInfoStruct new]; + newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; + newElement_0.inputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.inputType)]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + newElement_0.descriptionString = AsString(entry_0.description); + if (newElement_0.descriptionString == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24247,9 +12550,57 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::CurrentInput::Id: { + using TypeInfo = Attributes::CurrentInput::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForLowPowerCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::LowPower; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForKeypadInputCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::KeypadInput; + switch (aAttributeId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForContentLauncherCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ContentLauncher; + switch (aAttributeId) { + case Attributes::AcceptHeader::Id: { + using TypeInfo = Attributes::AcceptHeader::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24261,8 +12612,13 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + NSString * newElement_0; + newElement_0 = AsString(entry_0); + if (newElement_0 == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24274,8 +12630,8 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::SupportedStreamingProtocols::Id: { + using TypeInfo = Attributes::SupportedStreamingProtocols::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24285,17 +12641,6 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( value = [NSNumber numberWithUnsignedInt:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } default: { break; } @@ -24304,112 +12649,13 @@ static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } -static id _Nullable DecodeAttributeValueForApplicationBasicCluster( +static id _Nullable DecodeAttributeValueForAudioOutputCluster( AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { - using namespace Clusters::ApplicationBasic; + using namespace Clusters::AudioOutput; switch (aAttributeId) { - case Attributes::VendorName::Id: { - using TypeInfo = Attributes::VendorName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::VendorID::Id: { - using TypeInfo = Attributes::VendorID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ApplicationName::Id: { - using TypeInfo = Attributes::ApplicationName::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::ProductID::Id: { - using TypeInfo = Attributes::ProductID::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::Application::Id: { - using TypeInfo = Attributes::Application::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - MTRApplicationBasicClusterApplicationStruct * _Nonnull value; - value = [MTRApplicationBasicClusterApplicationStruct new]; - value.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.catalogVendorID]; - value.applicationID = AsString(cppValue.applicationID); - if (value.applicationID == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::Status::Id: { - using TypeInfo = Attributes::Status::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; - return value; - } - case Attributes::ApplicationVersion::Id: { - using TypeInfo = Attributes::ApplicationVersion::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSString * _Nonnull value; - value = AsString(cppValue); - if (value == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - return value; - } - case Attributes::AllowedVendorList::Id: { - using TypeInfo = Attributes::AllowedVendorList::TypeInfo; + case Attributes::OutputList::Id: { + using TypeInfo = Attributes::OutputList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24421,8 +12667,16 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( auto iter_0 = cppValue.begin(); while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0)]; + MTRAudioOutputClusterOutputInfoStruct * newElement_0; + newElement_0 = [MTRAudioOutputClusterOutputInfoStruct new]; + newElement_0.index = [NSNumber numberWithUnsignedChar:entry_0.index]; + newElement_0.outputType = [NSNumber numberWithUnsignedChar:chip::to_underlying(entry_0.outputType)]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24434,8 +12688,32 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( } return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::CurrentOutput::Id: { + using TypeInfo = Attributes::CurrentOutput::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForApplicationLauncherCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ApplicationLauncher; + switch (aAttributeId) { + case Attributes::CatalogList::Id: { + using TypeInfo = Attributes::CatalogList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24448,7 +12726,7 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedShort:entry_0]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24460,99 +12738,92 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::CurrentApp::Id: { + using TypeInfo = Attributes::CurrentApp::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { + MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRApplicationLauncherClusterApplicationEPStruct new]; + value.application = [MTRApplicationLauncherClusterApplicationStruct new]; + value.application.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.Value().application.catalogVendorID]; + value.application.applicationID = AsString(cppValue.Value().application.applicationID); + if (value.application.applicationID == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; *aError = err; return nil; } - value = array_0; + if (cppValue.Value().endpoint.HasValue()) { + value.endpoint = [NSNumber numberWithUnsignedShort:cppValue.Value().endpoint.Value()]; + } else { + value.endpoint = nil; + } } return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForApplicationBasicCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::ApplicationBasic; + switch (aAttributeId) { + case Attributes::VendorName::Id: { + using TypeInfo = Attributes::VendorName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::VendorID::Id: { + using TypeInfo = Attributes::VendorID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:chip::to_underlying(cppValue)]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::ApplicationName::Id: { + using TypeInfo = Attributes::ApplicationName::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::ProductID::Id: { + using TypeInfo = Attributes::ProductID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24562,101 +12833,53 @@ static id _Nullable DecodeAttributeValueForApplicationBasicCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - default: { - break; - } - } - - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - return nil; -} -static id _Nullable DecodeAttributeValueForAccountLoginCluster( - AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) -{ - using namespace Clusters::AccountLogin; - switch (aAttributeId) { - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::Application::Id: { + using TypeInfo = Attributes::Application::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + MTRApplicationBasicClusterApplicationStruct * _Nonnull value; + value = [MTRApplicationBasicClusterApplicationStruct new]; + value.catalogVendorID = [NSNumber numberWithUnsignedShort:cppValue.catalogVendorID]; + value.applicationID = AsString(cppValue.applicationID); + if (value.applicationID == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::Status::Id: { + using TypeInfo = Attributes::Status::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue)]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::ApplicationVersion::Id: { + using TypeInfo = Attributes::ApplicationVersion::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; + NSString * _Nonnull value; + value = AsString(cppValue); + if (value == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::AllowedVendorList::Id: { + using TypeInfo = Attributes::AllowedVendorList::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -24669,7 +12892,7 @@ static id _Nullable DecodeAttributeValueForAccountLoginCluster( while (iter_0.Next()) { auto & entry_0 = iter_0.GetValue(); NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + newElement_0 = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_0)]; [array_0 addObject:newElement_0]; } CHIP_ERROR err = iter_0.GetStatus(); @@ -24681,28 +12904,19 @@ static id _Nullable DecodeAttributeValueForAccountLoginCluster( } return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; + default: { + break; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} +static id _Nullable DecodeAttributeValueForAccountLoginCluster( + AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::AccountLogin; + switch (aAttributeId) { default: { break; } @@ -26011,88 +14225,22 @@ static id _Nullable DecodeAttributeValueForElectricalMeasurementCluster( return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } - case Attributes::ReactivePowerPhaseC::Id: { - using TypeInfo = Attributes::ReactivePowerPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithShort:cppValue]; - return value; - } - case Attributes::ApparentPowerPhaseC::Id: { - using TypeInfo = Attributes::ApparentPowerPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::PowerFactorPhaseC::Id: { - using TypeInfo = Attributes::PowerFactorPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithChar:cppValue]; - return value; - } - case Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id: { - using TypeInfo = Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::AverageRmsOverVoltageCounterPhaseC::Id: { - using TypeInfo = Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } - case Attributes::AverageRmsUnderVoltageCounterPhaseC::Id: { - using TypeInfo = Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo; + case Attributes::ReactivePowerPhaseC::Id: { + using TypeInfo = Attributes::ReactivePowerPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithShort:cppValue]; return value; } - case Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo; + case Attributes::ApparentPowerPhaseC::Id: { + using TypeInfo = Attributes::ApparentPowerPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -26102,19 +14250,19 @@ static id _Nullable DecodeAttributeValueForElectricalMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::RmsVoltageSagPeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo; + case Attributes::PowerFactorPhaseC::Id: { + using TypeInfo = Attributes::PowerFactorPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithChar:cppValue]; return value; } - case Attributes::RmsVoltageSwellPeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo; + case Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id: { + using TypeInfo = Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -26124,125 +14272,63 @@ static id _Nullable DecodeAttributeValueForElectricalMeasurementCluster( value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + case Attributes::AverageRmsOverVoltageCounterPhaseC::Id: { + using TypeInfo = Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + case Attributes::AverageRmsUnderVoltageCounterPhaseC::Id: { + using TypeInfo = Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; + case Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id: { + using TypeInfo = Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; + case Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id: { + using TypeInfo = Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; + case Attributes::RmsVoltageSagPeriodPhaseC::Id: { + using TypeInfo = Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; + case Attributes::RmsVoltageSwellPeriodPhaseC::Id: { + using TypeInfo = Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -27677,134 +15763,6 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster( value = [NSNumber numberWithUnsignedChar:cppValue]; return value; } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#if MTR_ENABLE_PROVISIONAL - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } -#endif // MTR_ENABLE_PROVISIONAL - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSArray * _Nonnull value; - { // Scope for our temporary variables - auto * array_0 = [NSMutableArray new]; - auto iter_0 = cppValue.begin(); - while (iter_0.Next()) { - auto & entry_0 = iter_0.GetValue(); - NSNumber * newElement_0; - newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; - [array_0 addObject:newElement_0]; - } - CHIP_ERROR err = iter_0.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; - } - value = array_0; - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) { - return nil; - } - NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; - return value; - } default: { break; } @@ -27816,6 +15774,10 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster( id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & aReader, CHIP_ERROR * aError) { + if (IsGlobalAttribute(aPath.mAttributeId)) { + return DecodeGlobalAttributeValue(aPath.mAttributeId, aReader, aError); + } + switch (aPath.mClusterId) { case Clusters::Identify::Id: { return DecodeAttributeValueForIdentifyCluster(aPath.mAttributeId, aReader, aError); diff --git a/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m b/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m index 53c4e47b498804..799974fb7c04f7 100644 --- a/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDataValueParserTests.m @@ -1111,4 +1111,59 @@ - (void)test036_CommandResponseWrongData XCTAssertEqual(error.code, MTRErrorCodeSchemaMismatch); } +- (void)globalListAttributeHelper:(NSNumber *)clusterID +{ + // clusterID, AcceptedCommandList + NSDictionary * input = @{ + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:clusterID attributeID:@(0xFFF9)], + MTRDataKey : @ { + MTRTypeKey : MTRArrayValueType, + MTRValueKey : @[ + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(5), + }, + }, + @{ + MTRDataKey : @ { + MTRTypeKey : MTRUnsignedIntegerValueType, + MTRValueKey : @(8), + }, + }, + ], + }, + }; + + NSError * error; + __auto_type * report = [[MTRAttributeReport alloc] initWithResponseValue:input error:&error]; + XCTAssertNotNil(report); + XCTAssertNil(error); + + XCTAssertEqualObjects(input[MTRAttributePathKey], report.path); + XCTAssertNotNil(report.value); + XCTAssertTrue([report.value isKindOfClass:[NSArray class]]); + + NSArray * array = report.value; + XCTAssertTrue([array[0] isKindOfClass:[NSNumber class]]); + XCTAssertEqualObjects(array[0], @(5)); + + XCTAssertTrue([array[1] isKindOfClass:[NSNumber class]]); + XCTAssertEqualObjects(array[1], @(8)); + + XCTAssertNil(report.error); +} + +- (void)test037_GlobalListAttributeStandardCluster +{ + // OnOff cluster. + [self globalListAttributeHelper:@(0x0006)]; +} + +- (void)test037_GlobalListAttributeManufacturerSpecific +{ + // Manufacturer specific cluster IDs start at 0xFC00. + [self globalListAttributeHelper:@(0xFFF4FD01)]; +} + @end From 40f8d796838881277aa1e642e50c7836b10502e4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 5 Sep 2023 21:49:02 -0400 Subject: [PATCH 018/134] Allow creating Darwin controllers via alloc/initWithParameters. (#29025) * Allow creating Darwin controllers via alloc/initWithParameters. * Address review comment. --- .../Framework/CHIP/MTRDeviceController.h | 22 ++- .../Framework/CHIP/MTRDeviceController.mm | 20 +++ .../CHIP/MTRDeviceControllerFactory.h | 31 +--- .../CHIP/MTRDeviceControllerFactory.mm | 160 ++++++++---------- .../MTRDeviceControllerFactory_Internal.h | 24 +++ ...ters.h => MTRDeviceControllerParameters.h} | 4 +- ...> MTRDeviceControllerParameters_Wrapper.h} | 4 +- .../CHIP/MTRDeviceControllerStartupParams.mm | 12 +- ...TRDeviceControllerStartupParams_Internal.h | 10 +- src/darwin/Framework/CHIP/Matter.h | 2 +- .../CHIPTests/MTRControllerAdvertisingTests.m | 42 ++--- .../CHIPTests/MTRPerControllerStorageTests.m | 41 ++--- .../Matter.xcodeproj/project.pbxproj | 8 +- 13 files changed, 183 insertions(+), 197 deletions(-) rename src/darwin/Framework/CHIP/{MTRDeviceControllerStartupParameters.h => MTRDeviceControllerParameters.h} (96%) rename src/darwin/Framework/CHIP/{MTRDeviceControllerStartupParameters_Wrapper.h => MTRDeviceControllerParameters_Wrapper.h} (86%) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index d8636796707946..3831a4979475e6 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -23,6 +23,10 @@ @class MTRBaseDevice; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +@class MTRDeviceControllerParameters; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + NS_ASSUME_NONNULL_BEGIN MTR_DEPRECATED("Please use MTRBaseDevice deviceWithNodeID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @@ -37,11 +41,27 @@ typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NS @interface MTRDeviceController : NSObject /** - * Controllers are created via the MTRDeviceControllerFactory object. + * Controllers are created via the MTRDeviceControllerFactory object or + * initialized via initWithParameters:error:. */ - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +/** + * Initialize a device controller with the provided parameters. This will: + * + * 1) Auto-start the MTRDeviceControllerFactory in storage-per-controller mode + * if it has not already been started. + * 2) Return nil or a running controller. + * + * Once this returns non-nil, it's the caller's resposibility to call shutdown + * on the controller to avoid leaking it. + */ +- (nullable instancetype)initWithParameters:(MTRDeviceControllerParameters *)parameters + error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + /** * If true, the controller has not been shut down yet. */ diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 98d757d6d291e7..ee0f845597aef8 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -16,6 +16,12 @@ */ #import +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#import +#else +#import "MTRDeviceControllerParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + #import "MTRDeviceController_Internal.h" #import "MTRAttestationTrustStoreBridge.h" @@ -119,6 +125,20 @@ @interface MTRDeviceController () { @implementation MTRDeviceController +- (nullable instancetype)initWithParameters:(MTRDeviceControllerParameters *)parameters error:(NSError * __autoreleasing *)error +{ + __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; + if (!factory.isRunning) { + auto * params = [[MTRDeviceControllerFactoryParams alloc] initWithoutStorage]; + + if (![factory startControllerFactory:params error:error]) { + return nil; + } + } + + return [factory initializeController:self withParameters:parameters error:error]; +} + - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory queue:(dispatch_queue_t)queue storageDelegate:(id _Nullable)storageDelegate diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h index 5cb4b7c7fd188f..3dfb3eaa9478bd 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.h @@ -23,11 +23,6 @@ #import #import #import -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -#import -#else -@class MTRDeviceControllerStartupParameters; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED NS_ASSUME_NONNULL_BEGIN @@ -42,6 +37,9 @@ NS_ASSUME_NONNULL_BEGIN API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRDeviceControllerFactoryParams : NSObject + +- (instancetype)init NS_UNAVAILABLE; + /* * Storage used to store persistent information for the fabrics the * controllers ends up interacting with. This is only used if "initWithStorage" @@ -98,15 +96,6 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) */ - (instancetype)initWithStorage:(id)storage; -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -/* - * Initialize the device controller factory without storage. In this mode, - * device controllers will need to have per-controller storage provided to allow - * storing controller-specific information. - */ -- (instancetype)init MTR_NEWLY_AVAILABLE; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - @end API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @@ -188,20 +177,6 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControllerStartupParams *)startupParams error:(NSError * __autoreleasing *)error; -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -/** - * Create an MTRDeviceController. Returns nil on failure. - * - * This method will fail if there is already a controller running for the given - * node identity. - * - * This method will fail if the controller factory was not initialized in - * storage-per-controller mode. - */ -- (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupParameters *)startupParameters - error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - @end MTR_DEPRECATED( diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 31b261ad74b79a..21660828e25847 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -17,6 +17,14 @@ #import "MTRDeviceControllerFactory.h" #import "MTRDeviceControllerFactory_Internal.h" +#import + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#import +#else +#import "MTRDeviceControllerParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + #import "MTRCertificates.h" #import "MTRControllerAccessControl.h" #import "MTRDemuxingStorage.h" @@ -34,9 +42,6 @@ #import "MTRPersistentStorageDelegateBridge.h" #import "MTRSessionResumptionStorageBridge.h" #import "NSDataSpanConversion.h" -#if !MTR_PER_CONTROLLER_STORAGE_ENABLED -#import "MTRDeviceControllerStartupParameters_Wrapper.h" -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import @@ -547,8 +552,12 @@ - (void)stopControllerFactory * The fabricChecker block will run on the Matter queue, and is expected to * return nil if pre-startup fabric table checks fail, and set fabricError to * the right error value in that situation. + * + * The provided controller is expected to have just been allocated and to not be + * initialized yet. */ -- (MTRDeviceController * _Nullable)_startDeviceController:(id)startupParams +- (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController *)controller + startupParams:(id)startupParams fabricChecker:(MTRDeviceControllerStartupParamsInternal * (^)(FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError))fabricChecker @@ -566,8 +575,8 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(id)startupParams NSUUID * uniqueIdentifier; id _Nullable otaProviderDelegate; dispatch_queue_t _Nullable otaProviderDelegateQueue; - if ([startupParams isKindOfClass:[MTRDeviceControllerStartupParameters class]]) { - MTRDeviceControllerStartupParameters * params = startupParams; + if ([startupParams isKindOfClass:[MTRDeviceControllerParameters class]]) { + MTRDeviceControllerParameters * params = startupParams; storageDelegate = params.storageDelegate; storageDelegateQueue = params.storageDelegateQueue; uniqueIdentifier = params.uniqueIdentifier; @@ -608,20 +617,35 @@ - (MTRDeviceController * _Nullable)_startDeviceController:(id)startupParams otaProviderDelegateQueue = self.otaProviderDelegateQueue; } - // Create the controller, so we start the event loop, since we plan to do - // our fabric table operations there. - auto * controller = [self _createController:storageDelegate - storageDelegateQueue:storageDelegateQueue - otaProviderDelegate:otaProviderDelegate - otaProviderDelegateQueue:otaProviderDelegateQueue - uniqueIdentifier:uniqueIdentifier]; + controller = [controller initWithFactory:self + queue:_chipWorkQueue + storageDelegate:storageDelegate + storageDelegateQueue:storageDelegateQueue + otaProviderDelegate:otaProviderDelegate + otaProviderDelegateQueue:otaProviderDelegateQueue + uniqueIdentifier:uniqueIdentifier]; if (controller == nil) { if (error != nil) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_NO_MEMORY]; + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; } return nil; } + if ([_controllers count] == 0) { + // Bringing up the first controller. Start the event loop now. If we + // fail to bring it up, its cleanup will stop the event loop again. + chip::DeviceLayer::PlatformMgrImpl().StartEventLoopTask(); + dispatch_sync(_chipWorkQueue, ^{ + self->_operationalBrowser = new MTROperationalBrowser(self, self->_chipWorkQueue); + }); + } + + // Add the controller to _controllers now, so if we fail partway through its + // startup we will still do the right cleanups. + os_unfair_lock_lock(&_controllersLock); + [_controllers addObject:controller]; + os_unfair_lock_unlock(&_controllersLock); + __block MTRDeviceControllerStartupParamsInternal * params = nil; __block CHIP_ERROR fabricError = CHIP_NO_ERROR; @@ -716,7 +740,8 @@ - (MTRDeviceController * _Nullable)createControllerOnExistingFabric:(MTRDeviceCo return nil; } - return [self _startDeviceController:startupParams + return [self _startDeviceController:[MTRDeviceController alloc] + startupParams:startupParams fabricChecker:^MTRDeviceControllerStartupParamsInternal *( FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { const FabricInfo * fabric = nullptr; @@ -792,7 +817,8 @@ - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControl return nil; } - return [self _startDeviceController:startupParams + return [self _startDeviceController:[MTRDeviceController alloc] + startupParams:startupParams fabricChecker:^MTRDeviceControllerStartupParamsInternal *( FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { const FabricInfo * fabric = nullptr; @@ -825,73 +851,6 @@ - (MTRDeviceController * _Nullable)createControllerOnNewFabric:(MTRDeviceControl error:error]; } -- (MTRDeviceController * _Nullable)createController:(MTRDeviceControllerStartupParameters *)startupParameters - error:(NSError * __autoreleasing *)error -{ - [self _assertCurrentQueueIsNotMatterQueue]; - - return [self _startDeviceController:startupParameters - fabricChecker:^MTRDeviceControllerStartupParamsInternal *( - FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { - auto advertiseOperational = self.advertiseOperational && startupParameters.shouldAdvertiseOperational; - auto * params = - [[MTRDeviceControllerStartupParamsInternal alloc] initForNewController:controller - fabricTable:fabricTable - keystore:self->_keystore - advertiseOperational:advertiseOperational - params:startupParameters - error:fabricError]; - if (params != nil) { - if (params.productAttestationAuthorityCertificates == nil) { - params.productAttestationAuthorityCertificates = self.productAttestationAuthorityCertificates; - } - if (params.certificationDeclarationCertificates == nil) { - params.certificationDeclarationCertificates = self.certificationDeclarationCertificates; - } - } - return params; - } - error:error]; -} - -- (MTRDeviceController * _Nullable)_createController:(id _Nullable)storageDelegate - storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue - otaProviderDelegate:(id _Nullable)otaProviderDelegate - otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue - uniqueIdentifier:(NSUUID *)uniqueIdentifier -{ - [self _assertCurrentQueueIsNotMatterQueue]; - - MTRDeviceController * controller = [[MTRDeviceController alloc] initWithFactory:self - queue:_chipWorkQueue - storageDelegate:storageDelegate - storageDelegateQueue:storageDelegateQueue - otaProviderDelegate:otaProviderDelegate - otaProviderDelegateQueue:otaProviderDelegateQueue - uniqueIdentifier:uniqueIdentifier]; - if (controller == nil) { - MTR_LOG_ERROR("Failed to init controller"); - return nil; - } - - if ([_controllers count] == 0) { - // Bringing up the first controller. Start the event loop now. If we - // fail to bring it up, its cleanup will stop the event loop again. - chip::DeviceLayer::PlatformMgrImpl().StartEventLoopTask(); - dispatch_sync(_chipWorkQueue, ^{ - self->_operationalBrowser = new MTROperationalBrowser(self, self->_chipWorkQueue); - }); - } - - // Add the controller to _controllers now, so if we fail partway through its - // startup we will still do the right cleanups. - os_unfair_lock_lock(&_controllersLock); - [_controllers addObject:controller]; - os_unfair_lock_unlock(&_controllersLock); - - return controller; -} - // Finds a fabric that matches the given params, if one exists. // // Returns NO on failure, YES on success. If YES is returned, the @@ -1126,6 +1085,37 @@ - (void)operationalInstanceAdded:(chip::PeerId &)operationalID } } +- (MTRDeviceController * _Nullable)initializeController:(MTRDeviceController *)controller + withParameters:(MTRDeviceControllerParameters *)parameters + error:(NSError * __autoreleasing *)error +{ + [self _assertCurrentQueueIsNotMatterQueue]; + + return [self _startDeviceController:controller + startupParams:parameters + fabricChecker:^MTRDeviceControllerStartupParamsInternal *( + FabricTable * fabricTable, MTRDeviceController * controller, CHIP_ERROR & fabricError) { + auto advertiseOperational = self.advertiseOperational && parameters.shouldAdvertiseOperational; + auto * params = + [[MTRDeviceControllerStartupParamsInternal alloc] initForNewController:controller + fabricTable:fabricTable + keystore:self->_keystore + advertiseOperational:advertiseOperational + params:parameters + error:fabricError]; + if (params != nil) { + if (params.productAttestationAuthorityCertificates == nil) { + params.productAttestationAuthorityCertificates = self.productAttestationAuthorityCertificates; + } + if (params.certificationDeclarationCertificates == nil) { + params.certificationDeclarationCertificates = self.certificationDeclarationCertificates; + } + } + return params; + } + error:error]; +} + - (PersistentStorageDelegate *)storageDelegate { return _persistentStorageDelegate; @@ -1176,7 +1166,7 @@ - (instancetype)initWithStorage:(id)storage return self; } -- (instancetype)init +- (instancetype)initWithoutStorage { if (!(self = [super init])) { return nil; @@ -1191,7 +1181,7 @@ - (instancetype)init _productAttestationAuthorityCertificates = nil; _certificationDeclarationCertificates = nil; _port = nil; - _shouldStartServer = NO; + _shouldStartServer = YES; return self; } diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h index 9717f5062c93f5..72827d10131d89 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h @@ -20,6 +20,14 @@ */ #import +#import +#import + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +#import +#else +#import "MTRDeviceControllerParameters_Wrapper.h" +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import "MTRDeviceControllerFactory.h" @@ -67,9 +75,25 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)operationalInstanceAdded:(chip::PeerId &)operationalID; +/** + * Initialize an MTRDeviceController with the given parameters. + */ +- (nullable MTRDeviceController *)initializeController:(MTRDeviceController *)controller + withParameters:(MTRDeviceControllerParameters *)parameters + error:(NSError * __autoreleasing *)error; + @property (readonly) chip::PersistentStorageDelegate * storageDelegate; @property (readonly) chip::Credentials::GroupDataProvider * groupData; @end +@interface MTRDeviceControllerFactoryParams () +/* + * Initialize the device controller factory without storage. In this mode, + * device controllers will need to have per-controller storage provided to allow + * storing controller-specific information. + */ +- (instancetype)initWithoutStorage; +@end + NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h similarity index 96% rename from src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h rename to src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h index 7b69f0f3d96531..bcbea7902b6083 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h @@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN MTR_HIDDEN #endif MTR_NEWLY_AVAILABLE -@interface MTRDeviceControllerStartupParameters : NSObject +@interface MTRDeviceControllerParameters : NSObject - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -81,7 +81,7 @@ MTR_NEWLY_AVAILABLE MTR_HIDDEN #endif MTR_NEWLY_AVAILABLE -@interface MTRDeviceControllerExternalCertificateStartupParameters : MTRDeviceControllerStartupParameters +@interface MTRDeviceControllerExternalCertificateParameters : MTRDeviceControllerParameters - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters_Wrapper.h similarity index 86% rename from src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h rename to src/darwin/Framework/CHIP/MTRDeviceControllerParameters_Wrapper.h index 537958dabf37fb..4f26e1a49c9d18 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParameters_Wrapper.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters_Wrapper.h @@ -17,9 +17,9 @@ #include #if MTR_PER_CONTROLLER_STORAGE_ENABLED -#error Should be including Matter/MTRDeviceControllerStartupParameters.h +#error Should be including Matter/MTRDeviceControllerParameters.h #endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #define MTR_INTERNAL_INCLUDE -#import +#import #undef MTR_INTERNAL_INCLUDE diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index 3da8a906c0886d..0c14065199e507 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -144,15 +144,15 @@ - (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params return self; } -- (instancetype)initWithParameters:(MTRDeviceControllerStartupParameters *)params error:(CHIP_ERROR &)error +- (instancetype)initWithParameters:(MTRDeviceControllerParameters *)params error:(CHIP_ERROR &)error { if (!(self = [super init])) { error = CHIP_ERROR_INCORRECT_STATE; return nil; } - if (![params isKindOfClass:[MTRDeviceControllerExternalCertificateStartupParameters class]]) { - MTR_LOG_ERROR("Unexpected subclass of MTRDeviceControllerStartupParameters"); + if (![params isKindOfClass:[MTRDeviceControllerExternalCertificateParameters class]]) { + MTR_LOG_ERROR("Unexpected subclass of MTRDeviceControllerParameters"); error = CHIP_ERROR_INVALID_ARGUMENT; return nil; } @@ -251,7 +251,7 @@ - (instancetype)initWithOperationalKeypair:(id)operationalKeypair @end -@implementation MTRDeviceControllerStartupParameters +@implementation MTRDeviceControllerParameters - (instancetype)initWithStorageDelegate:(id)storageDelegate storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue uniqueIdentifier:(NSUUID *)uniqueIdentifier @@ -301,7 +301,7 @@ - (void)setOTAProviderDelegate:(id)otaProviderDelegate q @end -@implementation MTRDeviceControllerExternalCertificateStartupParameters +@implementation MTRDeviceControllerExternalCertificateParameters - (instancetype)initWithStorageDelegate:(id)storageDelegate storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue uniqueIdentifier:(NSUUID *)uniqueIdentifier @@ -542,7 +542,7 @@ - (instancetype)initForNewController:(MTRDeviceController *)controller fabricTable:(chip::FabricTable *)fabricTable keystore:(chip::Crypto::OperationalKeystore *)keystore advertiseOperational:(BOOL)advertiseOperational - params:(MTRDeviceControllerStartupParameters *)params + params:(MTRDeviceControllerParameters *)params error:(CHIP_ERROR &)error { if (!(self = [super initWithParameters:params error:error])) { diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h index 9d52067d510982..2850fc78258486 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h @@ -21,9 +21,9 @@ #import #import #if MTR_PER_CONTROLLER_STORAGE_ENABLED -#import +#import #else -#import "MTRDeviceControllerStartupParameters_Wrapper.h" +#import "MTRDeviceControllerParameters_Wrapper.h" #endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include @@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN - (instancetype)initWithParams:(MTRDeviceControllerStartupParams *)params; @end -@interface MTRDeviceControllerStartupParameters () +@interface MTRDeviceControllerParameters () - (instancetype)initWithStorageDelegate:(id)storageDelegate storageDelegateQueue:(dispatch_queue_t)storageDelegateQueue @@ -64,7 +64,7 @@ NS_ASSUME_NONNULL_BEGIN intermediateCertificate:(MTRCertificateDERBytes _Nullable)intermediateCertificate rootCertificate:(MTRCertificateDERBytes)rootCertificate; -// When we have other subclasses of MTRDeviceControllerStartupParameters, we may +// When we have other subclasses of MTRDeviceControllerParameters, we may // need to make more things nullable here and/or add more fields. But for now // we know exactly what information we have. @property (nonatomic, copy, readonly) NSData * ipk; @@ -157,7 +157,7 @@ MTR_HIDDEN fabricTable:(chip::FabricTable *)fabricTable keystore:(chip::Crypto::OperationalKeystore *)keystore advertiseOperational:(BOOL)advertiseOperational - params:(MTRDeviceControllerStartupParameters *)params + params:(MTRDeviceControllerParameters *)params error:(CHIP_ERROR &)error; /** diff --git a/src/darwin/Framework/CHIP/Matter.h b/src/darwin/Framework/CHIP/Matter.h index 63c067f48d084d..2cf62428bbfc2c 100644 --- a/src/darwin/Framework/CHIP/Matter.h +++ b/src/darwin/Framework/CHIP/Matter.h @@ -42,7 +42,7 @@ #import #import #import -#import +#import #import #import #import diff --git a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m index 549d66ec3826a5..b7fa9a1cfa574f 100644 --- a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m +++ b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m @@ -133,8 +133,6 @@ - (void)setUp [self setContinueAfterFailure:NO]; _storageQueue = dispatch_queue_create("test.storage.queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - - [self startFactory]; } - (void)tearDown @@ -145,22 +143,6 @@ - (void)tearDown [super tearDown]; } -- (void)startFactory -{ - __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; - XCTAssertNotNil(factory); - - __auto_type * factoryParams = [[MTRDeviceControllerFactoryParams alloc] init]; - factoryParams.shouldStartServer = YES; - - NSError * error; - BOOL ok = [factory startControllerFactory:factoryParams error:&error]; - XCTAssertNil(error); - XCTAssertTrue(ok); - - XCTAssertTrue(factory.isRunning); -} - - (void)stopFactory { __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; @@ -180,9 +162,6 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo { XCTAssertTrue(error != NULL); - __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; - XCTAssertNotNil(factory); - // Specify a fixed issuerID, so we get the same cert if we use the same keys. __auto_type * root = [MTRCertificates createRootCertificate:rootKeys issuerID:@(1) fabricID:nil error:error]; XCTAssertNil(*error); @@ -198,21 +177,20 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo XCTAssertNil(*error); XCTAssertNotNil(operational); - __auto_type * params = - [[MTRDeviceControllerExternalCertificateStartupParameters alloc] initWithStorageDelegate:storage - storageDelegateQueue:_storageQueue - uniqueIdentifier:storage.controllerID - ipk:rootKeys.ipk - vendorID:@(kTestVendorId) - operationalKeypair:operationalKeys - operationalCertificate:operational - intermediateCertificate:nil - rootCertificate:root]; + __auto_type * params = [[MTRDeviceControllerExternalCertificateParameters alloc] initWithStorageDelegate:storage + storageDelegateQueue:_storageQueue + uniqueIdentifier:storage.controllerID + ipk:rootKeys.ipk + vendorID:@(kTestVendorId) + operationalKeypair:operationalKeys + operationalCertificate:operational + intermediateCertificate:nil + rootCertificate:root]; XCTAssertNotNil(params); params.shouldAdvertiseOperational = advertiseOperational; - return [factory createController:params error:error]; + return [[MTRDeviceController alloc] initWithParameters:params error:error]; } - (void)test001_CheckAdvertisingAsExpected diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index f81cc23af4e44e..8bbb529236671e 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -30,7 +30,6 @@ static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00"; -static const uint16_t kLocalPort = 5541; static const uint16_t kTestVendorId = 0xFFF1u; @interface MTRPerControllerStorageTestsControllerDelegate : NSObject @@ -194,8 +193,6 @@ - (void)setUp [self setContinueAfterFailure:NO]; _storageQueue = dispatch_queue_create("test.storage.queue", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - - [self startFactory]; } - (void)tearDown @@ -206,20 +203,6 @@ - (void)tearDown [super tearDown]; } -- (void)startFactory -{ - __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; - XCTAssertNotNil(factory); - - __auto_type * factoryParams = [[MTRDeviceControllerFactoryParams alloc] init]; - factoryParams.port = @(kLocalPort); - - NSError * error; - BOOL ok = [factory startControllerFactory:factoryParams error:&error]; - XCTAssertNil(error); - XCTAssertTrue(ok); -} - - (void)stopFactory { __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; @@ -262,9 +245,6 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo { XCTAssertTrue(error != NULL); - __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; - XCTAssertNotNil(factory); - // Specify a fixed issuerID, so we get the same cert if we use the same keys. __auto_type * root = [MTRCertificates createRootCertificate:rootKeys issuerID:@(1) fabricID:nil error:error]; XCTAssertNil(*error); @@ -280,16 +260,15 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo XCTAssertNil(*error); XCTAssertNotNil(operational); - __auto_type * params = - [[MTRDeviceControllerExternalCertificateStartupParameters alloc] initWithStorageDelegate:storage - storageDelegateQueue:_storageQueue - uniqueIdentifier:storage.controllerID - ipk:rootKeys.ipk - vendorID:@(kTestVendorId) - operationalKeypair:operationalKeys - operationalCertificate:operational - intermediateCertificate:nil - rootCertificate:root]; + __auto_type * params = [[MTRDeviceControllerExternalCertificateParameters alloc] initWithStorageDelegate:storage + storageDelegateQueue:_storageQueue + uniqueIdentifier:storage.controllerID + ipk:rootKeys.ipk + vendorID:@(kTestVendorId) + operationalKeypair:operationalKeys + operationalCertificate:operational + intermediateCertificate:nil + rootCertificate:root]; XCTAssertNotNil(params); __auto_type * ourCertificateIssuer = [[MTRPerControllerStorageTestsCertificateIssuer alloc] initWithRootCertificate:root @@ -304,7 +283,7 @@ - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)roo [params setOperationalCertificateIssuer:ourCertificateIssuer queue:dispatch_get_main_queue()]; - return [factory createController:params error:error]; + return [[MTRDeviceController alloc] initWithParameters:params error:error]; } - (nullable MTRDeviceController *)startControllerWithRootKeys:(MTRTestKeys *)rootKeys diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index a95c790993dfd5..fc6fcc5c7f2c13 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -159,7 +159,7 @@ 51565CB12A7AD77600469F18 /* MTRDeviceControllerDataStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CAF2A7AD77600469F18 /* MTRDeviceControllerDataStore.h */; }; 51565CB22A7AD77600469F18 /* MTRDeviceControllerDataStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51565CB02A7AD77600469F18 /* MTRDeviceControllerDataStore.mm */; }; 51565CB42A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CB32A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 51565CB62A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CB52A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 51565CB62A7B0D6600469F18 /* MTRDeviceControllerParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 51565CB52A7B0D6600469F18 /* MTRDeviceControllerParameters.h */; settings = {ATTRIBUTES = (Public, ); }; }; 515C1C6F284F9FFB00A48F0C /* MTRFramework.mm in Sources */ = {isa = PBXBuildFile; fileRef = 515C1C6D284F9FFB00A48F0C /* MTRFramework.mm */; }; 515C1C70284F9FFB00A48F0C /* MTRFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 515C1C6E284F9FFB00A48F0C /* MTRFramework.h */; }; 51669AF02913204400F4AA36 /* MTRBackwardsCompatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 51669AEF2913204400F4AA36 /* MTRBackwardsCompatTests.m */; }; @@ -474,7 +474,7 @@ 51565CAF2A7AD77600469F18 /* MTRDeviceControllerDataStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerDataStore.h; sourceTree = ""; }; 51565CB02A7AD77600469F18 /* MTRDeviceControllerDataStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceControllerDataStore.mm; sourceTree = ""; }; 51565CB32A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerStorageDelegate.h; sourceTree = ""; }; - 51565CB52A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerStartupParameters.h; sourceTree = ""; }; + 51565CB52A7B0D6600469F18 /* MTRDeviceControllerParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerParameters.h; sourceTree = ""; }; 515C1C6D284F9FFB00A48F0C /* MTRFramework.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRFramework.mm; sourceTree = ""; }; 515C1C6E284F9FFB00A48F0C /* MTRFramework.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRFramework.h; sourceTree = ""; }; 51669AEF2913204400F4AA36 /* MTRBackwardsCompatTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRBackwardsCompatTests.m; sourceTree = ""; }; @@ -1083,7 +1083,7 @@ 51E51FBC282AD37A00FC978D /* MTRDeviceControllerStartupParams.h */, 51E51FBD282AD37A00FC978D /* MTRDeviceControllerStartupParams_Internal.h */, 51E51FBE282AD37A00FC978D /* MTRDeviceControllerStartupParams.mm */, - 51565CB52A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h */, + 51565CB52A7B0D6600469F18 /* MTRDeviceControllerParameters.h */, 51565CB32A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h */, 5A6FEC9427B5976200F25F42 /* MTRDeviceControllerXPCConnection.h */, 5A6FEC9527B5983000F25F42 /* MTRDeviceControllerXPCConnection.mm */, @@ -1233,7 +1233,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 51565CB62A7B0D6600469F18 /* MTRDeviceControllerStartupParameters.h in Headers */, + 51565CB62A7B0D6600469F18 /* MTRDeviceControllerParameters.h in Headers */, 51565CB42A7AD78D00469F18 /* MTRDeviceControllerStorageDelegate.h in Headers */, 510A07492A685D3900A9241C /* Matter.apinotes in Headers */, 51EF279F2A2A3EB100E33F75 /* MTRBackwardsCompatShims.h in Headers */, From 6b708ab29de982d9fa0363d6ce8a2b9a9840b31a Mon Sep 17 00:00:00 2001 From: Cliff Chung <116232729+cliffamzn@users.noreply.github.com> Date: Tue, 5 Sep 2023 19:23:12 -0700 Subject: [PATCH 019/134] Fixing feature map for resource monitoring cluster (#29074) * Fixing feature map for resource monitoring cluster The replacement product list feature bitmask was set to 0x3 when it should have been set to 0x4. Fixing it here. Verified by looking reading the feature map in the all clusters app and the resource monitoring app: ``` > hepafiltermonitoring read feature-map 1 1 ... [1693934613437] [9078:18462448] [DMG] AttributeReportIBs = [1693934613437] [9078:18462448] [DMG] [ [1693934613437] [9078:18462448] [DMG] AttributeReportIB = [1693934613437] [9078:18462448] [DMG] { [1693934613437] [9078:18462448] [DMG] AttributeDataIB = [1693934613437] [9078:18462448] [DMG] { [1693934613437] [9078:18462448] [DMG] DataVersion = 0x443616af, [1693934613437] [9078:18462448] [DMG] AttributePathIB = [1693934613437] [9078:18462448] [DMG] { [1693934613437] [9078:18462448] [DMG] Endpoint = 0x1, [1693934613437] [9078:18462448] [DMG] Cluster = 0x72, [1693934613437] [9078:18462448] [DMG] Attribute = 0x0000_FFFC, [1693934613437] [9078:18462448] [DMG] } [1693934613437] [9078:18462448] [DMG] [1693934613437] [9078:18462448] [DMG] Data = 7, [1693934613437] [9078:18462448] [DMG] }, [1693934613437] [9078:18462448] [DMG] [1693934613437] [9078:18462448] [DMG] }, [1693934613437] [9078:18462448] [DMG] [1693934613437] [9078:18462448] [DMG] ], ``` This fixes #28197 and #28198 * Updating and adding feature flag tests --- .../all-clusters-app.matter | 8 +-- .../all-clusters-common/all-clusters-app.zap | 7 +- ...umiditysensor_thermostat_56de3d5f45.matter | 4 +- .../resource-monitoring-app.matter | 8 +-- .../resource-monitoring-app.zap | 19 ++--- .../resource-monitoring-cluster-objects.h | 2 +- .../TestActivatedCarbonFilterMonitoring.yaml | 8 +++ .../suites/TestHepaFilterMonitoring.yaml | 8 +++ .../certification/Test_TC_ACFREMON_1_1.yaml | 2 +- .../certification/Test_TC_HEPAFREMON_1_1.yaml | 2 +- .../chip/resource-monitoring-cluster.xml | 2 +- .../data_model/controller-clusters.matter | 4 +- .../python/chip/clusters/Objects.py | 4 +- .../CHIP/zap-generated/MTRBaseClusters.h | 4 +- .../app-common/zap-generated/cluster-enums.h | 4 +- .../zap-generated/test/Commands.h | 72 ++++++++++++++++--- 16 files changed, 116 insertions(+), 42 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index f4b5dfbb3e58c0..58f744659d5801 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3162,7 +3162,7 @@ server cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -3210,7 +3210,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -6914,7 +6914,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 1; } @@ -6928,7 +6928,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 3; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 1; } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 570a4984aa0c45..bcd0bb239ab26d 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -18456,7 +18456,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -18710,7 +18710,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -35392,5 +35392,6 @@ "endpointId": 65534, "networkId": 0 } - ] + ], + "log": [] } diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 411c2ab7329d17..d047d19cf62177 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -967,7 +967,7 @@ server cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -1011,7 +1011,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter index 85a69adcb65dea..60ebc011244e03 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter @@ -1538,7 +1538,7 @@ server cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -1586,7 +1586,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -2010,7 +2010,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 1; } @@ -2024,7 +2024,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 0; + ram attribute featureMap default = 7; ram attribute clusterRevision default = 1; } diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index 012f9b9557d681..60857f16ab28e3 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -16,6 +16,12 @@ } ], "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -23,12 +29,6 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" - }, - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" } ], "endpointTypes": [ @@ -6373,7 +6373,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6627,7 +6627,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "7", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6993,5 +6993,6 @@ "endpointId": 1, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h index 61d90da007df0a..03598ceb7eafc5 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h @@ -62,7 +62,7 @@ enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, - kReplacementProductList = 0x3 + kReplacementProductList = 0x4 }; // Enum for ProductIdentifierTypeEnum diff --git a/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml b/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml index c47e01fc473bf4..c1a1a9561353fc 100644 --- a/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml +++ b/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml @@ -28,6 +28,14 @@ tests: - name: "nodeId" value: nodeId + - label: "Validate the feature map" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x7] + - label: "Read Replacement Product List" command: "readAttribute" attribute: "ReplacementProductList" diff --git a/src/app/tests/suites/TestHepaFilterMonitoring.yaml b/src/app/tests/suites/TestHepaFilterMonitoring.yaml index 44b79eec8afc5c..9492ef1840d283 100644 --- a/src/app/tests/suites/TestHepaFilterMonitoring.yaml +++ b/src/app/tests/suites/TestHepaFilterMonitoring.yaml @@ -28,6 +28,14 @@ tests: - name: "nodeId" value: nodeId + - label: "Validate the feature map" + command: "readAttribute" + attribute: "FeatureMap" + response: + constraints: + type: bitmap32 + hasMasksSet: [0x7] + - label: "Read Replacement Product List" command: "readAttribute" attribute: "ReplacementProductList" diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml index 2d5b61e4e3c3cd..a96963ee818858 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml @@ -79,7 +79,7 @@ tests: response: constraints: type: bitmap32 - hasMasksSet: [0x3] + hasMasksSet: [0x4] - label: "Step 4a: Read the global attribute: AttributeList" PICS: PICS_EVENT_LIST_ENABLED diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml index 7814f985956b25..acc422bd8fc313 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml @@ -79,7 +79,7 @@ tests: response: constraints: type: bitmap32 - hasMasksSet: [0x3] + hasMasksSet: [0x4] - label: "Step 4: Read the global attribute: AttributeList" PICS: PICS_EVENT_LIST_ENABLED diff --git a/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml index a6be42b1a32e60..efce0eab24d55f 100644 --- a/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml @@ -68,7 +68,7 @@ limitations under the License. - + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index ebd2a1cf32c196..8a623075a5ef86 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3497,7 +3497,7 @@ client cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { @@ -3546,7 +3546,7 @@ client cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; - kReplacementProductList = 0x3; + kReplacementProductList = 0x4; } struct ReplacementProductStruct { diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 96662454953e0e..a3a72f4f87fee1 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -19176,7 +19176,7 @@ class Bitmaps: class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 - kReplacementProductList = 0x3 + kReplacementProductList = 0x4 class Structs: @dataclass @@ -19471,7 +19471,7 @@ class Bitmaps: class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 - kReplacementProductList = 0x3 + kReplacementProductList = 0x4 class Structs: @dataclass diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 64750300422587..8385b0ac441938 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -26673,7 +26673,7 @@ typedef NS_ENUM(uint8_t, MTRHEPAFilterMonitoringProductIdentifierType) { typedef NS_OPTIONS(uint32_t, MTRHEPAFilterMonitoringFeature) { MTRHEPAFilterMonitoringFeatureCondition MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRHEPAFilterMonitoringFeatureWarning MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRHEPAFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x3, + MTRHEPAFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x4, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRActivatedCarbonFilterMonitoringChangeIndication) { @@ -26698,7 +26698,7 @@ typedef NS_ENUM(uint8_t, MTRActivatedCarbonFilterMonitoringProductIdentifierType typedef NS_OPTIONS(uint32_t, MTRActivatedCarbonFilterMonitoringFeature) { MTRActivatedCarbonFilterMonitoringFeatureCondition MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRActivatedCarbonFilterMonitoringFeatureWarning MTR_PROVISIONALLY_AVAILABLE = 0x2, - MTRActivatedCarbonFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x3, + MTRActivatedCarbonFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x4, } MTR_PROVISIONALLY_AVAILABLE; typedef NS_ENUM(uint8_t, MTRDoorLockAlarmCode) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 40cef5085e5861..c5badb6f9d7091 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1934,7 +1934,7 @@ enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, - kReplacementProductList = 0x3, + kReplacementProductList = 0x4, }; } // namespace HepaFilterMonitoring @@ -1985,7 +1985,7 @@ enum class Feature : uint32_t { kCondition = 0x1, kWarning = 0x2, - kReplacementProductList = 0x3, + kReplacementProductList = 0x4, }; } // namespace ActivatedCarbonFilterMonitoring diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 35a6c29cc80972..c3b182ff614a02 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -177436,8 +177436,12 @@ class TestActivatedCarbonFilterMonitoring : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read Replacement Product List\n"); - err = TestReadReplacementProductList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Validate the feature map\n"); + err = TestValidateTheFeatureMap_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read Replacement Product List\n"); + err = TestReadReplacementProductList_2(); break; } @@ -177456,6 +177460,9 @@ class TestActivatedCarbonFilterMonitoring : public TestCommandBridge { case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -177469,7 +177476,7 @@ class TestActivatedCarbonFilterMonitoring : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -177484,7 +177491,28 @@ class TestActivatedCarbonFilterMonitoring : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadReplacementProductList_1() + CHIP_ERROR TestValidateTheFeatureMap_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate the feature map Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadReplacementProductList_2() { MTRBaseDevice * device = GetDevice("alpha"); @@ -177583,8 +177611,12 @@ class TestHepaFilterMonitoring : public TestCommandBridge { err = TestWaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Read Replacement Product List\n"); - err = TestReadReplacementProductList_1(); + ChipLogProgress(chipTool, " ***** Test Step 1 : Validate the feature map\n"); + err = TestValidateTheFeatureMap_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Read Replacement Product List\n"); + err = TestReadReplacementProductList_2(); break; } @@ -177603,6 +177635,9 @@ class TestHepaFilterMonitoring : public TestCommandBridge { case 1: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -177616,7 +177651,7 @@ class TestHepaFilterMonitoring : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 2; + const uint16_t mTestCount = 3; chip::Optional mNodeId; chip::Optional mCluster; @@ -177631,7 +177666,28 @@ class TestHepaFilterMonitoring : public TestCommandBridge { return WaitForCommissionee("alpha", value); } - CHIP_ERROR TestReadReplacementProductList_1() + CHIP_ERROR TestValidateTheFeatureMap_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Validate the feature map Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32")); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadReplacementProductList_2() { MTRBaseDevice * device = GetDevice("alpha"); From ba45f9ca99c826c1e35cc2a410bc39374ac3b69e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Ba=C5=82ys?= Date: Wed, 6 Sep 2023 13:37:06 +0200 Subject: [PATCH 020/134] [nrfconnect][ota] Change image checking condition for OTA. (#28983) If we want to confirm the new firmware update in the AppTask Init method we cannot rely on the imageProcessor. Instead, for the nRF53 target we should check if the image has been confirmed already, and if not, confirm it, for targets other than nRF53 we should use the mcuboot_swap_type function to verify whether the swapping type is equal to REVERT before verifying the image. --- .../nrfconnect/main/AppTask.cpp | 6 +----- .../nrfconnect/main/AppTask.cpp | 6 +----- .../nrfconnect/main/AppTask.cpp | 6 +----- .../lighting-app/nrfconnect/main/AppTask.cpp | 14 +++++-------- examples/lock-app/nrfconnect/main/AppTask.cpp | 6 +----- examples/platform/nrfconnect/util/OTAUtil.cpp | 20 ++++++++++++++----- .../nrfconnect/util/include/OTAUtil.h | 2 +- examples/pump-app/nrfconnect/main/AppTask.cpp | 6 +----- .../nrfconnect/main/AppTask.cpp | 6 +----- .../window-app/nrfconnect/main/AppTask.cpp | 6 +----- 10 files changed, 28 insertions(+), 50 deletions(-) diff --git a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp index 7f9b4f87b74eea..217748c218519f 100644 --- a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp @@ -180,11 +180,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp index 783096c52d32b5..6ec81dfd5c363b 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp +++ b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp @@ -139,11 +139,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/light-switch-app/nrfconnect/main/AppTask.cpp b/examples/light-switch-app/nrfconnect/main/AppTask.cpp index 6bc4138a9d635a..b64f70472558c4 100644 --- a/examples/light-switch-app/nrfconnect/main/AppTask.cpp +++ b/examples/light-switch-app/nrfconnect/main/AppTask.cpp @@ -181,11 +181,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize Timers diff --git a/examples/lighting-app/nrfconnect/main/AppTask.cpp b/examples/lighting-app/nrfconnect/main/AppTask.cpp index a2ad1d6e5996e5..8bbddd6b47774f 100644 --- a/examples/lighting-app/nrfconnect/main/AppTask.cpp +++ b/examples/lighting-app/nrfconnect/main/AppTask.cpp @@ -203,6 +203,11 @@ CHIP_ERROR AppTask::Init() GetDFUOverSMP().ConfirmNewImage(); #endif +#ifdef CONFIG_CHIP_OTA_REQUESTOR + /* OTA image confirmation must be done before the factory data init. */ + OtaConfirmNewImage(); +#endif + // Initialize lighting device (PWM) uint8_t minLightLevel = kDefaultMinLevel; Clusters::LevelControl::Attributes::MinLevel::Get(kLightEndpointId, &minLightLevel); @@ -217,15 +222,6 @@ CHIP_ERROR AppTask::Init() } mPWMDevice.SetCallbacks(ActionInitiated, ActionCompleted); -#ifdef CONFIG_CHIP_OTA_REQUESTOR - /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } -#endif - // Initialize CHIP server #if CONFIG_CHIP_FACTORY_DATA ReturnErrorOnFailure(mFactoryDataProvider.Init()); diff --git a/examples/lock-app/nrfconnect/main/AppTask.cpp b/examples/lock-app/nrfconnect/main/AppTask.cpp index ab5df56d36d9d4..17fa9e31412123 100644 --- a/examples/lock-app/nrfconnect/main/AppTask.cpp +++ b/examples/lock-app/nrfconnect/main/AppTask.cpp @@ -189,11 +189,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/platform/nrfconnect/util/OTAUtil.cpp b/examples/platform/nrfconnect/util/OTAUtil.cpp index f1c1c916aa0aa7..c642a9001f56ef 100644 --- a/examples/platform/nrfconnect/util/OTAUtil.cpp +++ b/examples/platform/nrfconnect/util/OTAUtil.cpp @@ -66,20 +66,30 @@ void InitBasicOTARequestor() imageProcessor.TriggerFlashAction(ExternalFlashManager::Action::SLEEP); } -CHIP_ERROR OtaConfirmNewImage() +void OtaConfirmNewImage() { - CHIP_ERROR err = CHIP_NO_ERROR; +#ifndef CONFIG_SOC_SERIES_NRF53X + /* Check if the image is run in the REVERT mode and eventually + confirm it to prevent reverting on the next boot. + On nRF53 target there is not way to verify current swap type + because we use permanent swap so we can skip it. */ + VerifyOrReturn(mcuboot_swap_type() == BOOT_SWAP_TYPE_REVERT); +#endif + OTAImageProcessorImpl & imageProcessor = GetOTAImageProcessor(); - if (imageProcessor.IsFirstImageRun()) + if (!boot_is_img_confirmed()) { CHIP_ERROR err = System::MapErrorZephyr(boot_write_img_confirmed()); if (CHIP_NO_ERROR == err) { imageProcessor.SetImageConfirmed(); + ChipLogProgress(SoftwareUpdate, "New firmware image confirmed"); + } + else + { + ChipLogError(SoftwareUpdate, "Failed to confirm firmware image, it will be reverted on the next boot"); } } - ChipLogError(SoftwareUpdate, "Failed to confirm firmware image, it will be reverted on the next boot"); - return err; } #endif diff --git a/examples/platform/nrfconnect/util/include/OTAUtil.h b/examples/platform/nrfconnect/util/include/OTAUtil.h index 2e120f6b7db096..9c4c6d8d410bc5 100644 --- a/examples/platform/nrfconnect/util/include/OTAUtil.h +++ b/examples/platform/nrfconnect/util/include/OTAUtil.h @@ -54,7 +54,7 @@ void InitBasicOTARequestor(); * boot after the OTA update. * Other CHIP_ERROR codes if the image could not be confirmed. */ -CHIP_ERROR OtaConfirmNewImage(); +void OtaConfirmNewImage(); #endif // CONFIG_CHIP_OTA_REQUESTOR diff --git a/examples/pump-app/nrfconnect/main/AppTask.cpp b/examples/pump-app/nrfconnect/main/AppTask.cpp index d21908bfa165b4..b2406ed56cf29d 100644 --- a/examples/pump-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-app/nrfconnect/main/AppTask.cpp @@ -162,11 +162,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp index f1b0fb19a3a19b..9b00a541cada3b 100644 --- a/examples/pump-controller-app/nrfconnect/main/AppTask.cpp +++ b/examples/pump-controller-app/nrfconnect/main/AppTask.cpp @@ -160,11 +160,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server diff --git a/examples/window-app/nrfconnect/main/AppTask.cpp b/examples/window-app/nrfconnect/main/AppTask.cpp index 5b80507a375c71..ed16dc1311dff8 100644 --- a/examples/window-app/nrfconnect/main/AppTask.cpp +++ b/examples/window-app/nrfconnect/main/AppTask.cpp @@ -167,11 +167,7 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_CHIP_OTA_REQUESTOR /* OTA image confirmation must be done before the factory data init. */ - err = OtaConfirmNewImage(); - if (err != CHIP_NO_ERROR) - { - return err; - } + OtaConfirmNewImage(); #endif // Initialize CHIP server From cd41f0b89867f06d642c5621a7c37cb5235d854c Mon Sep 17 00:00:00 2001 From: Sharad Binjola <31142146+sharadb-amazon@users.noreply.github.com> Date: Wed, 6 Sep 2023 08:17:41 -0700 Subject: [PATCH 021/134] iOS tv-casting-app: refactored Initialization (#29002) --- .../project.pbxproj | 58 +++++ .../MatterTvCastingBridge/MTRCastingApp.h | 53 +++++ .../MatterTvCastingBridge/MTRCastingApp.mm | 115 +++++++++ .../MTRCommissionableData.h | 43 ++++ .../MTRCommissionableData.mm | 39 +++ .../MTRCommissionableDataProvider.h | 71 ++++++ .../MTRCommissionableDataProvider.mm | 225 ++++++++++++++++++ ...CommonCaseDeviceServerInitParamsProvider.h | 42 ++++ .../MatterTvCastingBridge/MTRDataSource.h | 36 +++ .../MTRDeviceAttestationCredentials.h | 42 ++++ .../MTRDeviceAttestationCredentials.mm | 37 +++ .../MTRDeviceAttestationCredentialsProvider.h | 55 +++++ ...MTRDeviceAttestationCredentialsProvider.mm | 132 ++++++++++ .../MTRRotatingDeviceIdUniqueIdProvider.h | 46 ++++ .../MTRRotatingDeviceIdUniqueIdProvider.mm | 54 +++++ .../MatterTvCastingBridge/MatterError.h | 4 + .../MatterTvCastingBridge/MatterError.mm | 43 ++++ .../MatterTvCastingBridge.h | 6 + .../TvCasting.xcodeproj/project.pbxproj | 6 +- .../xcschemes/TvCasting Release.xcscheme | 7 + .../xcshareddata/xcschemes/TvCasting.xcscheme | 7 + .../TvCasting/TvCasting/ContentView.swift | 5 +- .../TvCasting/MTRInitializationExample.swift | 92 +++++++ .../TvCasting/TvCasting/TvCastingApp.swift | 92 +++++-- examples/tv-casting-app/darwin/args.gni | 6 +- .../tv-casting-app/tv-casting-common/BUILD.gn | 6 +- .../tv-casting-common/core/CastingApp.cpp | 12 +- 27 files changed, 1300 insertions(+), 34 deletions(-) create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommonCaseDeviceServerInitParamsProvider.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDataSource.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.mm create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.h create mode 100644 examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.mm create mode 100644 examples/tv-casting-app/darwin/TvCasting/TvCasting/MTRInitializationExample.swift diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj index cbc52e427053d4..75b1e3a695f520 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge.xcodeproj/project.pbxproj @@ -15,6 +15,9 @@ 3C4E53B228E5184C00F293E8 /* TargetNavigatorTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4E53B128E5184C00F293E8 /* TargetNavigatorTypes.mm */; }; 3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */; }; 3C66FBFC290327BB00B63FE7 /* AppParameters.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C66FBFB290327BB00B63FE7 /* AppParameters.mm */; }; + 3C6920462AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */; }; + 3C6920482AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */; }; + 3C69204C2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */; }; 3C81C74C28F7A777001CB9D1 /* ContentApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C74B28F7A777001CB9D1 /* ContentApp.mm */; }; 3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C74F28F7A7D3001CB9D1 /* VideoPlayer.m */; }; 3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -27,9 +30,20 @@ 3CCB8743286A593700771BAD /* CastingServerBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB873D286A593700771BAD /* CastingServerBridge.mm */; }; 3CCB8744286A593700771BAD /* ConversionUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CCB873E286A593700771BAD /* ConversionUtils.mm */; }; 3CD6D01A298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD6D019298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h */; }; + 3CD73F172A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD73F162A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h */; }; + 3CD73F192A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CD73F182A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm */; }; + 3CD73F1C2A9E8396009D82D1 /* MTRCommissionableDataProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD73F1B2A9E8396009D82D1 /* MTRCommissionableDataProvider.h */; }; + 3CD73F1E2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CD73F1D2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm */; }; + 3CD73F202A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CD73F1F2A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h */; }; + 3CD73F222A9EA078009D82D1 /* MTRDeviceAttestationCredentials.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CD73F212A9EA077009D82D1 /* MTRDeviceAttestationCredentials.mm */; }; 3CE5ECCE2A673B30007CF331 /* CommissioningCallbackHandlers.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CE5ECCD2A673B30007CF331 /* CommissioningCallbackHandlers.h */; }; 3CE5ECD02A673E2C007CF331 /* CommissioningCallbackHandlers.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CE5ECCF2A673E2C007CF331 /* CommissioningCallbackHandlers.m */; }; 3CE868F42946D76200FCB92B /* CommissionableDataProviderImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CE868F32946D76200FCB92B /* CommissionableDataProviderImpl.mm */; }; + 3CF71C0A2A992D0D003A5CE5 /* MTRCastingApp.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */; }; + 3CF71C0C2A992D25003A5CE5 /* MTRCastingApp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */; }; + 3CF71C0E2A992DA2003A5CE5 /* MTRDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */; }; + 3CF71C102A99312D003A5CE5 /* MTRCommissionableData.h in Headers */ = {isa = PBXBuildFile; fileRef = 3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */; }; + 3CF71C122A993298003A5CE5 /* MTRCommissionableData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */; }; 3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3CF8532628E37F1000F07B9F /* MatterError.mm */; }; /* End PBXBuildFile section */ @@ -48,6 +62,9 @@ 3C4E53B528E5595A00F293E8 /* ContentLauncherTypes.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentLauncherTypes.mm; sourceTree = ""; }; 3C66FBFA2903279A00B63FE7 /* AppParameters.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppParameters.h; sourceTree = ""; }; 3C66FBFB290327BB00B63FE7 /* AppParameters.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppParameters.mm; sourceTree = ""; }; + 3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationCredentialsProvider.h; sourceTree = ""; }; + 3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceAttestationCredentialsProvider.mm; sourceTree = ""; }; + 3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommonCaseDeviceServerInitParamsProvider.h; sourceTree = ""; }; 3C81C74B28F7A777001CB9D1 /* ContentApp.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentApp.mm; sourceTree = ""; }; 3C81C74E28F7A7AE001CB9D1 /* ContentApp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentApp.h; sourceTree = ""; }; 3C81C74F28F7A7D3001CB9D1 /* VideoPlayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VideoPlayer.m; sourceTree = ""; }; @@ -64,9 +81,20 @@ 3CCB873D286A593700771BAD /* CastingServerBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CastingServerBridge.mm; sourceTree = ""; }; 3CCB873E286A593700771BAD /* ConversionUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ConversionUtils.mm; sourceTree = ""; }; 3CD6D019298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommissionerDiscoveryDelegateImpl.h; sourceTree = ""; }; + 3CD73F162A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRRotatingDeviceIdUniqueIdProvider.h; sourceTree = ""; }; + 3CD73F182A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRRotatingDeviceIdUniqueIdProvider.mm; sourceTree = ""; }; + 3CD73F1B2A9E8396009D82D1 /* MTRCommissionableDataProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommissionableDataProvider.h; sourceTree = ""; }; + 3CD73F1D2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCommissionableDataProvider.mm; sourceTree = ""; }; + 3CD73F1F2A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationCredentials.h; sourceTree = ""; }; + 3CD73F212A9EA077009D82D1 /* MTRDeviceAttestationCredentials.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceAttestationCredentials.mm; sourceTree = ""; }; 3CE5ECCD2A673B30007CF331 /* CommissioningCallbackHandlers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommissioningCallbackHandlers.h; sourceTree = ""; }; 3CE5ECCF2A673E2C007CF331 /* CommissioningCallbackHandlers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CommissioningCallbackHandlers.m; sourceTree = ""; }; 3CE868F32946D76200FCB92B /* CommissionableDataProviderImpl.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CommissionableDataProviderImpl.mm; sourceTree = ""; }; + 3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCastingApp.h; sourceTree = ""; }; + 3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCastingApp.mm; sourceTree = ""; }; + 3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDataSource.h; sourceTree = ""; }; + 3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCommissionableData.h; sourceTree = ""; }; + 3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCommissionableData.mm; sourceTree = ""; }; 3CF8532528E37ED800F07B9F /* MatterError.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MatterError.h; sourceTree = ""; }; 3CF8532628E37F1000F07B9F /* MatterError.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MatterError.mm; sourceTree = ""; }; /* End PBXFileReference section */ @@ -106,6 +134,20 @@ isa = PBXGroup; children = ( 3CCB87202869085400771BAD /* MatterTvCastingBridge.h */, + 3CF71C092A992D0D003A5CE5 /* MTRCastingApp.h */, + 3CF71C0B2A992D25003A5CE5 /* MTRCastingApp.mm */, + 3CF71C0D2A992DA2003A5CE5 /* MTRDataSource.h */, + 3CF71C0F2A99312D003A5CE5 /* MTRCommissionableData.h */, + 3CF71C112A993298003A5CE5 /* MTRCommissionableData.mm */, + 3CD73F1B2A9E8396009D82D1 /* MTRCommissionableDataProvider.h */, + 3CD73F1D2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm */, + 3CD73F162A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h */, + 3CD73F182A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm */, + 3CD73F1F2A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h */, + 3CD73F212A9EA077009D82D1 /* MTRDeviceAttestationCredentials.mm */, + 3C6920452AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h */, + 3C6920472AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm */, + 3C69204B2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h */, 3CCB873A286A593700771BAD /* CastingServerBridge.h */, 3CCB873D286A593700771BAD /* CastingServerBridge.mm */, 3C66FBFA2903279A00B63FE7 /* AppParameters.h */, @@ -148,13 +190,21 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + 3C69204C2AA136BA00D0F613 /* MTRCommonCaseDeviceServerInitParamsProvider.h in Headers */, 3CD6D01A298CDA2100D7569A /* CommissionerDiscoveryDelegateImpl.h in Headers */, + 3CF71C0E2A992DA2003A5CE5 /* MTRDataSource.h in Headers */, 3C26AC8C2926FE0C00BA6881 /* DeviceAttestationCredentialsProviderImpl.hpp in Headers */, + 3CD73F1C2A9E8396009D82D1 /* MTRCommissionableDataProvider.h in Headers */, + 3CF71C0A2A992D0D003A5CE5 /* MTRCastingApp.h in Headers */, + 3CD73F172A9E6884009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.h in Headers */, + 3CF71C102A99312D003A5CE5 /* MTRCommissionableData.h in Headers */, + 3CD73F202A9EA060009D82D1 /* MTRDeviceAttestationCredentials.h in Headers */, 3CCB8740286A593700771BAD /* CastingServerBridge.h in Headers */, 3CE5ECCE2A673B30007CF331 /* CommissioningCallbackHandlers.h in Headers */, 3CCB8742286A593700771BAD /* ConversionUtils.hpp in Headers */, 3CCB8741286A593700771BAD /* DiscoveredNodeData.h in Headers */, 3CCB87212869085400771BAD /* MatterTvCastingBridge.h in Headers */, + 3C6920462AA1093300D0F613 /* MTRDeviceAttestationCredentialsProvider.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -256,18 +306,24 @@ files = ( 3CCB8743286A593700771BAD /* CastingServerBridge.mm in Sources */, 3C4E53B228E5184C00F293E8 /* TargetNavigatorTypes.mm in Sources */, + 3C6920482AA1094000D0F613 /* MTRDeviceAttestationCredentialsProvider.mm in Sources */, 3CE5ECD02A673E2C007CF331 /* CommissioningCallbackHandlers.m in Sources */, + 3CD73F192A9E68A7009D82D1 /* MTRRotatingDeviceIdUniqueIdProvider.mm in Sources */, 3CF8532728E37F1000F07B9F /* MatterError.mm in Sources */, 3C4E53B628E5595A00F293E8 /* ContentLauncherTypes.mm in Sources */, 3C81C75028F7A7D3001CB9D1 /* VideoPlayer.m in Sources */, 3CCB8744286A593700771BAD /* ConversionUtils.mm in Sources */, + 3CF71C0C2A992D25003A5CE5 /* MTRCastingApp.mm in Sources */, 3C4E53B028E4F28100F293E8 /* MediaPlaybackTypes.mm in Sources */, + 3CD73F1E2A9E83C1009D82D1 /* MTRCommissionableDataProvider.mm in Sources */, + 3CD73F222A9EA078009D82D1 /* MTRDeviceAttestationCredentials.mm in Sources */, 3C66FBFC290327BB00B63FE7 /* AppParameters.mm in Sources */, 3CE868F42946D76200FCB92B /* CommissionableDataProviderImpl.mm in Sources */, 3C26AC9329282B8100BA6881 /* DeviceAttestationCredentialsHolder.m in Sources */, 3C26AC902927008900BA6881 /* DeviceAttestationCredentialsProviderImpl.mm in Sources */, 3CCB873F286A593700771BAD /* DiscoveredNodeData.mm in Sources */, 3C81C74C28F7A777001CB9D1 /* ContentApp.mm in Sources */, + 3CF71C122A993298003A5CE5 /* MTRCommissionableData.mm in Sources */, 3C4AE650286A7D4D005B52A4 /* OnboardingPayload.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -418,6 +474,7 @@ GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = ( "${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common/include", + "${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common", "$(CHIP_ROOT)/src", "$(CHIP_ROOT)/src/include", "$(CHIP_ROOT)/src/lib", @@ -498,6 +555,7 @@ GENERATE_INFOPLIST_FILE = YES; HEADER_SEARCH_PATHS = ( "${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common/include", + "${CHIP_ROOT}/examples/tv-casting-app/tv-casting-common", "$(CHIP_ROOT)/src", "$(CHIP_ROOT)/src/include", "$(CHIP_ROOT)/src/lib", diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.h new file mode 100644 index 00000000000000..37a07e36452767 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.h @@ -0,0 +1,53 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRDataSource.h" +#import "MatterError.h" + +#ifndef MTRCastingApp_h +#define MTRCastingApp_h + +/** + * @brief MTRCastingApp represents an app that can cast content to a Casting Player. + */ +@interface MTRCastingApp : NSObject + +/** + * Returns a shared instance of the MTRCastingApp + */ ++ (MTRCastingApp * _Nullable)getSharedInstance; + +/** + * @brief Initializes the MTRCastingApp with appParameters + * + * @param dataSource provides all the parameters required to initialize the MTRCastingApp + */ +- (MatterError * _Nonnull)initializeWithDataSource:(id _Nonnull)dataSource; + +/** + * @brief Starts the Matter server that the MTRCastingApp runs on and registers all the necessary delegates + */ +- (MatterError * _Nonnull)start; + +/** + * @brief Stops the Matter server that the MTRCastingApp runs on + */ +- (MatterError * _Nonnull)stop; + +@end + +#endif /* MTRCastingApp_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.mm new file mode 100644 index 00000000000000..1ee0bc98bb2805 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCastingApp.mm @@ -0,0 +1,115 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRCastingApp.h" + +#import "MTRCommissionableDataProvider.h" +#import "MTRCommonCaseDeviceServerInitParamsProvider.h" +#import "MTRDeviceAttestationCredentialsProvider.h" +#import "MTRRotatingDeviceIdUniqueIdProvider.h" + +#import "core/Types.h" +#include +#include + +#import + +@interface MTRCastingApp () + +@property matter::casting::support::AppParameters appParameters; +@property matter::casting::support::MTRRotatingDeviceIdUniqueIdProvider uniqueIdProvider; +@property matter::casting::support::MTRCommissionableDataProvider * commissionableDataProvider; +@property matter::casting::support::MTRDeviceAttestationCredentialsProvider * dacProvider; +@property MTRCommonCaseDeviceServerInitParamsProvider * serverInitParamsProvider; + +// queue used to serialize all work performed by the CastingServerBridge +@property (atomic) dispatch_queue_t chipWorkQueue; + +@end + +@implementation MTRCastingApp + ++ (MTRCastingApp * _Nullable)getSharedInstance +{ + static MTRCastingApp * instance = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + instance = [[self alloc] init]; + }); + return instance; +} + +- (MatterError * _Nonnull)initializeWithDataSource:(id _Nonnull)dataSource +{ + ChipLogProgress(AppServer, "MTRCastingApp.initializeWithDataSource called"); + + // Initialize cpp Providers + VerifyOrReturnValue(_uniqueIdProvider.Initialize(dataSource) == CHIP_NO_ERROR, MATTER_ERROR_INVALID_ARGUMENT); + + _commissionableDataProvider = new matter::casting::support::MTRCommissionableDataProvider(); + VerifyOrReturnValue(_commissionableDataProvider->Initialize(dataSource) == CHIP_NO_ERROR, MATTER_ERROR_INVALID_ARGUMENT); + + _dacProvider = new matter::casting::support::MTRDeviceAttestationCredentialsProvider(); + VerifyOrReturnValue(_dacProvider->Initialize(dataSource) == CHIP_NO_ERROR, MATTER_ERROR_INVALID_ARGUMENT); + + _serverInitParamsProvider = new MTRCommonCaseDeviceServerInitParamsProvider(); + + // Create cpp AppParameters + VerifyOrReturnValue(_appParameters.Create(&_uniqueIdProvider, _commissionableDataProvider, _dacProvider, + GetDefaultDACVerifier(chip::Credentials::GetTestAttestationTrustStore()), _serverInitParamsProvider) + == CHIP_NO_ERROR, + MATTER_ERROR_INVALID_ARGUMENT); + + // Initialize cpp CastingApp + VerifyOrReturnValue(matter::casting::core::CastingApp::GetInstance()->Initialize(_appParameters) == CHIP_NO_ERROR, + MATTER_ERROR_INCORRECT_STATE); + + // Get and store the CHIP Work queue + _chipWorkQueue = chip::DeviceLayer::PlatformMgrImpl().GetWorkQueue(); + + return MATTER_NO_ERROR; +} + +- (MatterError * _Nonnull)start +{ + ChipLogProgress(AppServer, "MTRCastingApp.start called"); + VerifyOrReturnValue(_chipWorkQueue != nil, MATTER_ERROR_INCORRECT_STATE); + + __block CHIP_ERROR err = CHIP_NO_ERROR; + + dispatch_sync(_chipWorkQueue, ^{ + err = matter::casting::core::CastingApp::GetInstance()->Start(); + }); + + return err == CHIP_NO_ERROR ? MATTER_NO_ERROR : MATTER_ERROR_INCORRECT_STATE; +} + +- (MatterError * _Nonnull)stop +{ + ChipLogProgress(AppServer, "MTRCastingApp.stop called"); + VerifyOrReturnValue(_chipWorkQueue != nil, MATTER_ERROR_INCORRECT_STATE); + + __block CHIP_ERROR err = CHIP_NO_ERROR; + + dispatch_sync(_chipWorkQueue, ^{ + err = matter::casting::core::CastingApp::GetInstance()->Stop(); + }); + + return err == CHIP_NO_ERROR ? MATTER_NO_ERROR : MATTER_ERROR_INCORRECT_STATE; +} + +@end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.h new file mode 100644 index 00000000000000..59eb8acdb9eb53 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.h @@ -0,0 +1,43 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#ifndef MTRCommissionableData_h +#define MTRCommissionableData_h + +@interface MTRCommissionableData : NSObject + +@property (nonatomic, readonly) uint32_t passcode; + +@property (nonatomic, readonly) uint16_t discriminator; + +@property (nonatomic, readonly) uint32_t spake2pIterationCount; + +@property (nonatomic, strong, readonly) NSData * _Nullable spake2pVerifier; + +@property (nonatomic, strong, readonly) NSData * _Nullable spake2pSalt; + +- (instancetype _Nonnull)initWithPasscode:(uint32_t)passcode + discriminator:(uint16_t)discriminator + spake2pIterationCount:(uint32_t)spake2pIterationCount + spake2pVerifier:(NSData * _Nullable)spake2pVerifier + spake2pSalt:(NSData * _Nullable)spake2pSalt; + +@end + +#endif /* MTRCommissionableData_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.mm new file mode 100644 index 00000000000000..85858b36dffbd1 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableData.mm @@ -0,0 +1,39 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRCommissionableData.h" +#import + +@implementation MTRCommissionableData + +- (instancetype)initWithPasscode:(uint32_t)passcode + discriminator:(uint16_t)discriminator + spake2pIterationCount:(uint32_t)spake2pIterationCount + spake2pVerifier:(NSData * _Nullable)spake2pVerifier + spake2pSalt:(NSData * _Nullable)spake2pSalt +{ + if (self = [super init]) { + _passcode = passcode; + _discriminator = discriminator; + _spake2pIterationCount = spake2pIterationCount; + _spake2pVerifier = spake2pVerifier; + _spake2pVerifier = spake2pVerifier; + } + return self; +} + +@end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.h new file mode 100644 index 00000000000000..8112207a003028 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.h @@ -0,0 +1,71 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#import "MTRDataSource.h" + +#include +#include +#include +#include +#include + +#ifndef MTRCommissionableDataProvider_h +#define MTRCommissionableDataProvider_h + +namespace matter { +namespace casting { +namespace support { + +class MTRCommissionableDataProvider : public chip::DeviceLayer::CommissionableDataProvider +{ +public: + CHIP_ERROR Initialize(id dataSource); + CHIP_ERROR GetSetupDiscriminator(uint16_t & setupDiscriminator) override; + CHIP_ERROR SetSetupDiscriminator(uint16_t setupDiscriminator) override + { + // We don't support overriding the discriminator post-init (it is deprecated!) + return CHIP_ERROR_NOT_IMPLEMENTED; + } + CHIP_ERROR GetSpake2pIterationCount(uint32_t & iterationCount) override; + CHIP_ERROR GetSpake2pSalt(chip::MutableByteSpan & saltBuf) override; + CHIP_ERROR GetSpake2pVerifier(chip::MutableByteSpan & verifierBuf, size_t & outVerifierLen) override; + CHIP_ERROR GetSetupPasscode(uint32_t & setupPasscode) override; + CHIP_ERROR SetSetupPasscode(uint32_t setupPasscode) override + { + // We don't support overriding the passcode post-init (it is deprecated!) + return CHIP_ERROR_NOT_IMPLEMENTED; + } + +private: + id mDataSource = nullptr; + + bool mFirstUpdated = false; + std::vector mSerializedPaseVerifier; + std::vector mPaseSalt; + uint32_t mPaseIterationCount = 0; + chip::Optional mSetupPasscode; + uint16_t mDiscriminator = 0; +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter + +#endif /* MTRCommissionableDataProvider_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.mm new file mode 100644 index 00000000000000..6a6047984c1a8a --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommissionableDataProvider.mm @@ -0,0 +1,225 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRCommissionableDataProvider.h" + +#import "MTRCommissionableData.h" + +#include +#include + +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::Crypto; + +namespace matter { +namespace casting { + namespace support { + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT +#define CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT 1000 +#endif + + CHIP_ERROR GeneratePaseSalt(std::vector & spake2pSaltVector) + { + constexpr size_t kSaltLen = kSpake2p_Max_PBKDF_Salt_Length; + spake2pSaltVector.resize(kSaltLen); + return DRBG_get_bytes(spake2pSaltVector.data(), spake2pSaltVector.size()); + } + + CHIP_ERROR MTRCommissionableDataProvider::Initialize(id dataSource) + { + VerifyOrReturnLogError(dataSource != nil, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnLogError(mDataSource == nullptr, CHIP_ERROR_INCORRECT_STATE); + + mDataSource = dataSource; + MTRCommissionableData * commissionableData = + [mDataSource castingAppDidReceiveRequestForCommissionableData:@"MTRCommissionableDataProvider.Initialize()"]; + + VerifyOrReturnLogError(commissionableData.discriminator <= chip::kMaxDiscriminatorValue, CHIP_ERROR_INVALID_ARGUMENT); + + uint32_t spake2pIterationCount = commissionableData.spake2pIterationCount; + if (spake2pIterationCount == 0) { + spake2pIterationCount = CHIP_DEVICE_CONFIG_USE_TEST_SPAKE2P_ITERATION_COUNT; + } + VerifyOrReturnLogError( + static_cast(spake2pIterationCount) >= kSpake2p_Min_PBKDF_Iterations, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnLogError( + static_cast(spake2pIterationCount) <= kSpake2p_Max_PBKDF_Iterations, CHIP_ERROR_INVALID_ARGUMENT); + + const bool havePaseVerifier = (commissionableData.spake2pVerifier != nullptr); + const bool havePaseSalt = (commissionableData.spake2pSalt != nullptr); + VerifyOrReturnLogError(!havePaseVerifier || (havePaseVerifier && havePaseSalt), CHIP_ERROR_INVALID_ARGUMENT); + + CHIP_ERROR err; + // read verifier from paramter if provided + Spake2pVerifier providedVerifier; + std::vector serializedSpake2pVerifier(kSpake2p_VerifierSerialized_Length); + if (havePaseVerifier) { + size_t maxBase64Size = BASE64_ENCODED_LEN(chip::Crypto::kSpake2p_VerifierSerialized_Length); + VerifyOrReturnLogError( + static_cast(commissionableData.spake2pVerifier.length) <= maxBase64Size, CHIP_ERROR_INVALID_ARGUMENT); + + size_t decodedLen = chip::Base64Decode32(reinterpret_cast(commissionableData.spake2pVerifier.bytes), + static_cast(commissionableData.spake2pVerifier.length), + reinterpret_cast(serializedSpake2pVerifier.data())); + VerifyOrReturnLogError(decodedLen == chip::Crypto::kSpake2p_VerifierSerialized_Length, CHIP_ERROR_INVALID_ARGUMENT); + + chip::MutableByteSpan verifierSpan { serializedSpake2pVerifier.data(), decodedLen }; + err = providedVerifier.Deserialize(verifierSpan); + VerifyOrReturnLogError(err == CHIP_NO_ERROR, err); + + ChipLogProgress(Support, "Got externally provided verifier, using it."); + } + + // read salt from paramter if provided or generate one + std::vector spake2pSalt(chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length); + if (!havePaseSalt) { + ChipLogProgress(Support, "MTRCommissionableDataProvider didn't get a PASE salt, generating one."); + err = GeneratePaseSalt(spake2pSalt); + VerifyOrReturnLogError(err == CHIP_NO_ERROR, err); + } else { + size_t maxBase64Size = BASE64_ENCODED_LEN(chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length); + VerifyOrReturnLogError( + static_cast(commissionableData.spake2pSalt.length) <= maxBase64Size, CHIP_ERROR_INVALID_ARGUMENT); + + size_t decodedLen = chip::Base64Decode32(reinterpret_cast(commissionableData.spake2pSalt.bytes), + static_cast(commissionableData.spake2pSalt.length), reinterpret_cast(spake2pSalt.data())); + VerifyOrReturnLogError(decodedLen >= chip::Crypto::kSpake2p_Min_PBKDF_Salt_Length + && decodedLen <= chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length, + CHIP_ERROR_INVALID_ARGUMENT); + spake2pSalt.resize(decodedLen); + } + + // generate verifier from passcode if provided + const bool havePasscode + = (commissionableData.passcode > kMinSetupPasscode && commissionableData.passcode < kMaxSetupPasscode); + Spake2pVerifier passcodeVerifier; + std::vector serializedPasscodeVerifier(kSpake2p_VerifierSerialized_Length); + chip::MutableByteSpan saltSpan { spake2pSalt.data(), spake2pSalt.size() }; + if (havePasscode) { + uint32_t u32SetupPasscode = static_cast(commissionableData.passcode); + err = passcodeVerifier.Generate(spake2pIterationCount, saltSpan, u32SetupPasscode); + VerifyOrReturnLogError(err == CHIP_NO_ERROR, err); + + chip::MutableByteSpan verifierSpan { serializedPasscodeVerifier.data(), serializedPasscodeVerifier.size() }; + err = passcodeVerifier.Serialize(verifierSpan); + VerifyOrReturnLogError(err == CHIP_NO_ERROR, err); + } + + // Make sure we actually have a verifier + VerifyOrReturnLogError(havePasscode || havePaseVerifier, CHIP_ERROR_INVALID_ARGUMENT); + + // If both passcode and external verifier were provided, validate they match, otherwise + // it's ambiguous. + if (havePasscode && havePaseVerifier) { + VerifyOrReturnLogError(serializedPasscodeVerifier == serializedSpake2pVerifier, CHIP_ERROR_INVALID_ARGUMENT); + ChipLogProgress( + Support, "Validated externally provided passcode matches the one generated from provided passcode."); + } + + // External PASE verifier takes precedence when present (even though it is identical to passcode-based + // one when the latter is present). + if (havePaseVerifier) { + mSerializedPaseVerifier = std::move(serializedSpake2pVerifier); + } else { + mSerializedPaseVerifier = std::move(serializedPasscodeVerifier); + } + mDiscriminator = commissionableData.discriminator; + mPaseSalt = std::move(spake2pSalt); + mPaseIterationCount = spake2pIterationCount; + if (havePasscode) { + mSetupPasscode.SetValue(commissionableData.passcode); + } + + // Set to global CommissionableDataProvider once success first time + if (!mFirstUpdated) { + DeviceLayer::SetCommissionableDataProvider(this); + } + mFirstUpdated = true; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSetupDiscriminator(uint16_t & setupDiscriminator) + { + VerifyOrReturnError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + setupDiscriminator = mDiscriminator; + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSpake2pIterationCount(uint32_t & iterationCount) + { + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSpake2pIterationCount called"); + VerifyOrReturnLogError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + iterationCount = mPaseIterationCount; + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSpake2pSalt(chip::MutableByteSpan & saltBuf) + { + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSpake2pSalt called"); + VerifyOrReturnError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + + VerifyOrReturnError(saltBuf.size() >= kSpake2p_Max_PBKDF_Salt_Length, CHIP_ERROR_BUFFER_TOO_SMALL); + memcpy(saltBuf.data(), mPaseSalt.data(), mPaseSalt.size()); + saltBuf.reduce_size(mPaseSalt.size()); + + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSpake2pVerifier(chip::MutableByteSpan & verifierBuf, size_t & outVerifierLen) + { + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSpake2pVerifier called"); + VerifyOrReturnError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + + // By now, serialized verifier from Init should be correct size + VerifyOrReturnError(mSerializedPaseVerifier.size() == kSpake2p_VerifierSerialized_Length, CHIP_ERROR_INTERNAL); + + outVerifierLen = mSerializedPaseVerifier.size(); + VerifyOrReturnError(verifierBuf.size() >= outVerifierLen, CHIP_ERROR_BUFFER_TOO_SMALL); + memcpy(verifierBuf.data(), mSerializedPaseVerifier.data(), mSerializedPaseVerifier.size()); + verifierBuf.reduce_size(mSerializedPaseVerifier.size()); + + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRCommissionableDataProvider::GetSetupPasscode(uint32_t & setupPasscode) + { + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSetupPasscode called"); + VerifyOrReturnError(mFirstUpdated, CHIP_ERROR_INCORRECT_STATE); + + // Pretend not implemented if we don't have a passcode value externally set + if (!mSetupPasscode.HasValue()) { + return CHIP_ERROR_NOT_IMPLEMENTED; + } + + setupPasscode = mSetupPasscode.Value(); + ChipLogProgress(AppServer, "MTRCommissionableDataProvider::GetSetupPasscode returning value %d", setupPasscode); + return CHIP_NO_ERROR; + } + + }; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommonCaseDeviceServerInitParamsProvider.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommonCaseDeviceServerInitParamsProvider.h new file mode 100644 index 00000000000000..a22113074e31f1 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRCommonCaseDeviceServerInitParamsProvider.h @@ -0,0 +1,42 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "core/Types.h" + +#ifndef MTRCommonCaseDeviceServerInitParamsProvider_h +#define MTRCommonCaseDeviceServerInitParamsProvider_h + +/** + * @brief Provides the ServerInitParams required to start the CastingApp, which in turn starts the Matter server + */ +class MTRCommonCaseDeviceServerInitParamsProvider : public matter::casting::support::ServerInitParamsProvider +{ +private: + // For this example, we'll use CommonCaseDeviceServerInitParams + chip::CommonCaseDeviceServerInitParams serverInitParams; + +public: + chip::ServerInitParams * Get() + { + CHIP_ERROR err = serverInitParams.InitializeStaticResourcesBeforeServerInit(); + VerifyOrReturnValue(err == CHIP_NO_ERROR, nullptr, + ChipLogError(AppServer, "Initialization of ServerInitParams failed %" CHIP_ERROR_FORMAT, err.Format())); + return &serverInitParams; + } +}; + +#endif /* MTRCommonCaseDeviceServerInitParamsProvider_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDataSource.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDataSource.h new file mode 100644 index 00000000000000..a350673b70f6c4 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDataSource.h @@ -0,0 +1,36 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRCommissionableData.h" +#import "MTRDeviceAttestationCredentials.h" + +#ifndef MTRDataSource_h +#define MTRDataSource_h + +@protocol MTRDataSource + +- (dispatch_queue_t _Nonnull)clientQueue; + +- (NSData * _Nonnull)castingAppDidReceiveRequestForRotatingDeviceIdUniqueId:(id _Nonnull)sender; +- (MTRCommissionableData * _Nonnull)castingAppDidReceiveRequestForCommissionableData:(id _Nonnull)sender; +- (MTRDeviceAttestationCredentials * _Nonnull)castingAppDidReceiveRequestForDeviceAttestationCredentials:(id _Nonnull)sender; + +- (NSData * _Nonnull)castingApp:(id _Nonnull)sender didReceiveRequestToSignCertificateRequest:(NSData * _Nonnull)csrData; + +@end + +#endif /* MTRDataSource_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.h new file mode 100644 index 00000000000000..aed7eceedbacdd --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.h @@ -0,0 +1,42 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import +#import + +#ifndef MTRDeviceAttestationCredentials_h +#define MTRDeviceAttestationCredentials_h + +@interface MTRDeviceAttestationCredentials : NSObject + +@property (nonatomic, strong, readonly) NSData * _Nonnull certificationDeclaration; + +@property (nonatomic, strong, readonly) NSData * _Nonnull firmwareInformation; + +@property (nonatomic, strong, readonly) NSData * _Nonnull deviceAttestationCert; + +@property (nonatomic, strong, readonly) NSData * _Nonnull productAttestationIntermediateCert; + +- (MTRDeviceAttestationCredentials * _Nonnull)initWithCertificationDeclaration:(NSData * _Nonnull)certificationDeclaration + firmwareInformation:(NSData * _Nonnull)firmwareInformation + deviceAttestationCert:(NSData * _Nonnull)deviceAttestationCert + productAttestationIntermediateCert: + (NSData * _Nonnull)productAttestationIntermediateCert; + +@end + +#endif /* MTRDeviceAttestationCredentials_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.mm new file mode 100644 index 00000000000000..1daa18a681c93c --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentials.mm @@ -0,0 +1,37 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRDeviceAttestationCredentials.h" +#import + +@implementation MTRDeviceAttestationCredentials + +- (instancetype)initWithCertificationDeclaration:(NSData * _Nonnull)certificationDeclaration + firmwareInformation:(NSData * _Nonnull)firmwareInformation + deviceAttestationCert:(NSData * _Nonnull)deviceAttestationCert + productAttestationIntermediateCert:(NSData * _Nonnull)productAttestationIntermediateCert; +{ + if (self = [super init]) { + _certificationDeclaration = certificationDeclaration; + _firmwareInformation = firmwareInformation; + _deviceAttestationCert = deviceAttestationCert; + _productAttestationIntermediateCert = productAttestationIntermediateCert; + } + return self; +} + +@end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.h new file mode 100644 index 00000000000000..e955ac9ee7eb33 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.h @@ -0,0 +1,55 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRDataSource.h" + +#include +#include +#include + +#import +#include + +#ifndef MTRDeviceAttestationCredentialsProvider_h +#define MTRDeviceAttestationCredentialsProvider_h + +namespace matter { +namespace casting { +namespace support { + +class MTRDeviceAttestationCredentialsProvider : public chip::Credentials::DeviceAttestationCredentialsProvider +{ +public: + CHIP_ERROR Initialize(id dataSource); + + CHIP_ERROR GetCertificationDeclaration(chip::MutableByteSpan & outCertificationDeclaration) override; + CHIP_ERROR GetFirmwareInformation(chip::MutableByteSpan & outFirmwareInformation) override; + CHIP_ERROR GetDeviceAttestationCert(chip::MutableByteSpan & outDeviceAttestationCert) override; + CHIP_ERROR GetProductAttestationIntermediateCert(chip::MutableByteSpan & outProductAttestationIntermediateCert) override; + CHIP_ERROR SignWithDeviceAttestationKey(const chip::ByteSpan & messageToSign, + chip::MutableByteSpan & outSignatureBuffer) override; + +private: + id mDataSource = nullptr; + MTRDeviceAttestationCredentials * mDac = nullptr; +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter + +#endif /* MTRDeviceAttestationCredentialsProvider_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.mm new file mode 100644 index 00000000000000..8a2bcb0439c217 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRDeviceAttestationCredentialsProvider.mm @@ -0,0 +1,132 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRDeviceAttestationCredentialsProvider.h" + +#import "MTRDeviceAttestationCredentials.h" + +#include "lib/support/logging/CHIPLogging.h" +#include +#include + +#import + +namespace matter { +namespace casting { + namespace support { + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::Initialize(id dataSource) + { + VerifyOrReturnError(dataSource != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(mDataSource == nullptr, CHIP_ERROR_INCORRECT_STATE); + + mDac = [mDataSource + castingAppDidReceiveRequestForDeviceAttestationCredentials:@"MTRDeviceAttestationCredentialsProvider.Initialize()"]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::GetCertificationDeclaration( + chip::MutableByteSpan & outCertificationDeclaration) + { + VerifyOrReturnError(mDac != nullptr, CHIP_ERROR_INCORRECT_STATE); + + if (mDac.certificationDeclaration != nullptr && mDac.certificationDeclaration.length > 0) { + if (outCertificationDeclaration.size() >= mDac.certificationDeclaration.length) { + memcpy(outCertificationDeclaration.data(), mDac.certificationDeclaration.bytes, + mDac.certificationDeclaration.length); + outCertificationDeclaration.reduce_size(mDac.certificationDeclaration.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + } + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::GetFirmwareInformation(chip::MutableByteSpan & outFirmwareInformation) + { + VerifyOrReturnError(mDac != nullptr, CHIP_ERROR_INCORRECT_STATE); + + if (mDac.firmwareInformation != nullptr && mDac.firmwareInformation.length > 0) { + if (outFirmwareInformation.size() >= mDac.firmwareInformation.length) { + memcpy(outFirmwareInformation.data(), mDac.firmwareInformation.bytes, mDac.firmwareInformation.length); + outFirmwareInformation.reduce_size(mDac.firmwareInformation.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + } + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::GetDeviceAttestationCert( + chip::MutableByteSpan & outDeviceAttestationCert) + { + VerifyOrReturnError(mDac != nullptr, CHIP_ERROR_INCORRECT_STATE); + + if (mDac.deviceAttestationCert != nullptr && mDac.deviceAttestationCert.length > 0) { + if (outDeviceAttestationCert.size() >= mDac.deviceAttestationCert.length) { + memcpy(outDeviceAttestationCert.data(), mDac.deviceAttestationCert.bytes, mDac.deviceAttestationCert.length); + outDeviceAttestationCert.reduce_size(mDac.deviceAttestationCert.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + } + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::GetProductAttestationIntermediateCert( + chip::MutableByteSpan & outProductAttestationIntermediateCert) + { + VerifyOrReturnError(mDac != nullptr, CHIP_ERROR_INCORRECT_STATE); + + if (mDac.productAttestationIntermediateCert != nullptr && mDac.productAttestationIntermediateCert.length > 0) { + if (outProductAttestationIntermediateCert.size() >= mDac.productAttestationIntermediateCert.length) { + memcpy(outProductAttestationIntermediateCert.data(), mDac.productAttestationIntermediateCert.bytes, + mDac.productAttestationIntermediateCert.length); + outProductAttestationIntermediateCert.reduce_size(mDac.productAttestationIntermediateCert.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + } + return CHIP_NO_ERROR; + } + + CHIP_ERROR MTRDeviceAttestationCredentialsProvider::SignWithDeviceAttestationKey( + const chip::ByteSpan & messageToSign, chip::MutableByteSpan & outSignatureBuffer) + { + VerifyOrReturnError(mDataSource != nullptr, CHIP_ERROR_INCORRECT_STATE); + + __block NSData * signedData = nil; + NSData * csrData = [NSData dataWithBytes:messageToSign.data() length:messageToSign.size()]; + dispatch_sync(mDataSource.clientQueue, ^{ + signedData = [mDataSource castingApp:@"MTRDeviceAttestationCredentialsProvider.SignWithDeviceAttestationKey()" + didReceiveRequestToSignCertificateRequest:csrData]; + }); + + if (signedData != nil && outSignatureBuffer.size() >= signedData.length) { + memcpy(outSignatureBuffer.data(), signedData.bytes, signedData.length); + outSignatureBuffer.reduce_size(signedData.length); + } else { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + + return CHIP_NO_ERROR; + } + + }; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.h new file mode 100644 index 00000000000000..5f0b32a21b58e2 --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.h @@ -0,0 +1,46 @@ +/** + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "MTRDataSource.h" + +#include "core/Types.h" + +#ifndef MTRRotatingDeviceIdUniqueIdProvider_h +#define MTRRotatingDeviceIdUniqueIdProvider_h + +namespace matter { +namespace casting { +namespace support { + +class MTRRotatingDeviceIdUniqueIdProvider : public matter::casting::support::MutableByteSpanDataProvider +{ +public: + CHIP_ERROR Initialize(id dataSource); + chip::MutableByteSpan * Get(); + +private: + id mDataSource = nullptr; + + chip::MutableByteSpan mRotatingDeviceIdUniqueIdSpan; + uint8_t mRotatingDeviceIdUniqueId[chip::DeviceLayer::ConfigurationManager::kRotatingDeviceIDUniqueIDLength]; +}; + +}; // namespace support +}; // namespace casting +}; // namespace matter + +#endif /* MTRRotatingDeviceIdUniqueIdProvider_h */ diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.mm new file mode 100644 index 00000000000000..7db4ce55c91e7b --- /dev/null +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MTRRotatingDeviceIdUniqueIdProvider.mm @@ -0,0 +1,54 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "MTRRotatingDeviceIdUniqueIdProvider.h" + +#include "lib/support/logging/CHIPLogging.h" +#include +#include + +#import + +namespace matter { +namespace casting { + namespace support { + + CHIP_ERROR MTRRotatingDeviceIdUniqueIdProvider::Initialize(id dataSource) + { + VerifyOrReturnError(dataSource != nullptr, CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(mDataSource == nullptr, CHIP_ERROR_INCORRECT_STATE); + mDataSource = dataSource; + return CHIP_NO_ERROR; + } + + chip::MutableByteSpan * MTRRotatingDeviceIdUniqueIdProvider::Get() + { + ChipLogProgress(AppServer, "MTRRotatingDeviceIdUniqueIdProvider.Get() called"); + VerifyOrReturnValue(mDataSource != nil, nullptr, ChipLogError(AppServer, "mDataSource found nil!")); + + NSData * uniqueIdData = + [mDataSource castingAppDidReceiveRequestForRotatingDeviceIdUniqueId:@"MTRRotatingDeviceIdUniqueIdProvider.Get()"]; + if (uniqueIdData != nil) { + mRotatingDeviceIdUniqueIdSpan = chip::MutableByteSpan( + const_cast(reinterpret_cast(uniqueIdData.bytes)), uniqueIdData.length); + } + return &mRotatingDeviceIdUniqueIdSpan; + } + + }; // namespace support +}; // namespace casting +}; // namespace matter diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.h index ec018725294162..95aa22ebdd3577 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.h @@ -26,6 +26,10 @@ @property NSString * _Nullable message; +extern MatterError * _Nonnull MATTER_NO_ERROR; +extern MatterError * _Nonnull MATTER_ERROR_INCORRECT_STATE; +extern MatterError * _Nonnull MATTER_ERROR_INVALID_ARGUMENT; + - (MatterError * _Nonnull)initWithCode:(uint32_t)code message:(NSString * _Nullable)message; @end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.mm b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.mm index ce700e5a80338a..cbee1a455a51ca 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.mm +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterError.mm @@ -19,8 +19,19 @@ #import "MatterError.h" +#include + @implementation MatterError +MatterError * MATTER_NO_ERROR = [[MatterError alloc] initWithCode:0 message:nil]; + +MatterError * MATTER_ERROR_INCORRECT_STATE = + [[MatterError alloc] initWithCode:CHIP_ERROR_INCORRECT_STATE.AsInteger() + message:[NSString stringWithUTF8String:CHIP_ERROR_INCORRECT_STATE.AsString()]]; +MatterError * MATTER_ERROR_INVALID_ARGUMENT = + [[MatterError alloc] initWithCode:CHIP_ERROR_INVALID_ARGUMENT.AsInteger() + message:[NSString stringWithUTF8String:CHIP_ERROR_INVALID_ARGUMENT.AsString()]]; + - (MatterError *)initWithCode:(uint32_t)code message:(NSString * _Nullable)message { self = [super init]; @@ -36,4 +47,36 @@ - (NSString *)description return [NSString stringWithFormat:@"MatterError: code=%d message=%@", _code, _message]; } +- (BOOL)isEqualToMatterError:(MatterError *)other +{ + return self.code == other.code; +} + +- (BOOL)isEqual:(id)other +{ + if (other == nil) { + return NO; + } + + if (self == other) { + return YES; + } + + if (![other isKindOfClass:[MatterError class]]) { + return NO; + } + + return [self isEqualToMatterError:(MatterError *) other]; +} + +- (NSUInteger)hash +{ + const NSUInteger prime = 31; + NSUInteger result = 1; + + result = prime * result + self.code; + + return result; +} + @end diff --git a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h index 709740914e9ca8..9d12b964ce1c97 100644 --- a/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h +++ b/examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/MatterTvCastingBridge.h @@ -24,3 +24,9 @@ FOUNDATION_EXPORT double MatterTvCastingBridgeVersionNumber; FOUNDATION_EXPORT const unsigned char MatterTvCastingBridgeVersionString[]; #import "CastingServerBridge.h" + +// Add simplified casting API headers here +#import "MTRCastingApp.h" +#import "MTRCommissionableData.h" +#import "MTRDataSource.h" +#import "MTRDeviceAttestationCredentials.h" diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj index 68c5808353ab5a..567a0e205d1fc6 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 3C69204A2AA1368F00D0F613 /* MTRInitializationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C6920492AA1368F00D0F613 /* MTRInitializationExample.swift */; }; 3C81C75328F8C79E001CB9D1 /* StartFromCacheView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C75228F8C79E001CB9D1 /* StartFromCacheView.swift */; }; 3C81C75528F8C7B6001CB9D1 /* StartFromCacheViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C75428F8C7B6001CB9D1 /* StartFromCacheViewModel.swift */; }; 3C81C75728F8E418001CB9D1 /* ConnectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C81C75628F8E418001CB9D1 /* ConnectionView.swift */; }; @@ -46,6 +47,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 3C6920492AA1368F00D0F613 /* MTRInitializationExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MTRInitializationExample.swift; sourceTree = ""; }; 3C75075E284C1DF800D7DB3A /* TvCasting.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TvCasting.entitlements; sourceTree = ""; }; 3C7507AC285299DF00D7DB3A /* CommissionerDiscoveryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommissionerDiscoveryView.swift; sourceTree = ""; }; 3C7507AE28529A5F00D7DB3A /* CommissioningView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommissioningView.swift; sourceTree = ""; }; @@ -115,9 +117,10 @@ children = ( 3CC0E8FD2841DD3500EC6A18 /* Assets.xcassets */, 3C75075E284C1DF800D7DB3A /* TvCasting.entitlements */, + 3CC0E8F92841DD3400EC6A18 /* TvCastingApp.swift */, + 3C6920492AA1368F00D0F613 /* MTRInitializationExample.swift */, EAF14298296D561900E17793 /* CertTestView.swift */, EAF1429A296D57DF00E17793 /* CertTestViewModel.swift */, - 3CC0E8F92841DD3400EC6A18 /* TvCastingApp.swift */, 3CC0E8FB2841DD3400EC6A18 /* ContentView.swift */, 3C81C75228F8C79E001CB9D1 /* StartFromCacheView.swift */, 3C81C75428F8C7B6001CB9D1 /* StartFromCacheViewModel.swift */, @@ -236,6 +239,7 @@ 3C81C75928F8E42D001CB9D1 /* ConnectionViewModel.swift in Sources */, 3CA1CA7A28E281080023ED44 /* ClusterSelectorView.swift in Sources */, EAF14299296D561900E17793 /* CertTestView.swift in Sources */, + 3C69204A2AA1368F00D0F613 /* MTRInitializationExample.swift in Sources */, 3CCB8747286A5D0F00771BAD /* CommissioningView.swift in Sources */, 3CCB8748286A5D0F00771BAD /* CommissioningViewModel.swift in Sources */, 3CAC955B29BA948700BEA5C3 /* ExampleDAC.swift in Sources */, diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/xcshareddata/xcschemes/TvCasting Release.xcscheme b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/xcshareddata/xcschemes/TvCasting Release.xcscheme index bb32b8f700eee3..05333fbe6fe932 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/xcshareddata/xcschemes/TvCasting Release.xcscheme +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting.xcodeproj/xcshareddata/xcschemes/TvCasting Release.xcscheme @@ -50,6 +50,13 @@ ReferencedContainer = "container:TvCasting.xcodeproj"> + + + + + + + + DispatchQueue { + return DispatchQueue.main; + } + + func castingAppDidReceiveRequestForRotatingDeviceIdUniqueId(_ sender: Any) -> Data { + // dummy value, with at least 16 bytes (ConfigurationManager::kMinRotatingDeviceIDUniqueIDLength), for demonstration only + return "0123456789ABCDEF".data(using: .utf8)! + } + + func castingAppDidReceiveRequestForCommissionableData(_ sender: Any) -> MTRCommissionableData { + // dummy values for demonstration only + return MTRCommissionableData( + passcode: 20202021, + discriminator: 3874, + spake2pIterationCount: 1000, + spake2pVerifier: nil, + spake2pSalt: nil) + } + + // dummy DAC values for demonstration only + let kDevelopmentDAC_Cert_FFF1_8001: Data = Data(base64Encoded: "MIIB5zCCAY6gAwIBAgIIac3xDenlTtEwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwcTWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZGRjEwIBcNMjIwMjA1MDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMMHE1hdHRlciBEZXYgREFDIDB4RkZGMS8weDgwMDExFDASBgorBgEEAYKifAIBDARGRkYxMRQwEgYKKwYBBAGConwCAgwEODAwMTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABEY6xpNCkQoOVYj8b/Vrtj5i7M7LFI99TrA+5VJgFBV2fRalxmP3k+SRIyYLgpenzX58/HsxaznZjpDSk3dzjoKjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMB0GA1UdDgQWBBSI3eezADgpMs/3NMBGJIEPRBaKbzAfBgNVHSMEGDAWgBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNHADBEAiABJ6J7S0RhDuL83E0reIVWNmC8D3bxchntagjfsrPBzQIga1ngr0Xz6yqFuRnTVzFSjGAoxBUjlUXhCOTlTnCXE1M=")!; + + let kDevelopmentDAC_PrivateKey_FFF1_8001: Data = Data(base64Encoded: "qrYAroroqrfXNifCF7fCBHCcppRq9fL3UwgzpStE+/8=")!; + + let kDevelopmentDAC_PublicKey_FFF1_8001: Data = Data(base64Encoded: "BEY6xpNCkQoOVYj8b/Vrtj5i7M7LFI99TrA+5VJgFBV2fRalxmP3k+SRIyYLgpenzX58/HsxaznZjpDSk3dzjoI=")!; + + let KPAI_FFF1_8000_Cert_Array: Data = Data(base64Encoded: "MIIByzCCAXGgAwIBAgIIVq2CIq2UW2QwCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwPTWF0dGVyIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwERkZGMTAgFw0yMjAyMDUwMDAwMDBaGA85OTk5MTIzMTIzNTk1OVowPTElMCMGA1UEAwwcTWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZGRjEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAARBmpMVwhc+DIyHbQPM/JRIUmR/f+xeUIL0BZko7KiUxZQVEwmsYx5MsDOSr2hLC6+35ls7gWLC9Sv5MbjneqqCo2YwZDASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUY1QOR/ZLHDjROISkYtFsGV2P+zwwHwYDVR0jBBgwFoAUav0idx9RH+y/FkGXZxDc3DGhcX4wCgYIKoZIzj0EAwIDSAAwRQIhALLvJ/Sa6bUPuR7qyUxNC9u415KcbLiPrOUpNo0SBUwMAiBlXckrhr2QmIKmxiF3uCXX0F7b58Ivn+pxIg5+pwP4kQ==")!; + + let kCertificationDeclaration: Data = Data(base64Encoded: "MIICGQYJKoZIhvcNAQcCoIICCjCCAgYCAQMxDTALBglghkgBZQMEAgEwggFxBgkqhkiG9w0BBwGgggFiBIIBXhUkAAElAfH/NgIFAIAFAYAFAoAFA4AFBIAFBYAFBoAFB4AFCIAFCYAFCoAFC4AFDIAFDYAFDoAFD4AFEIAFEYAFEoAFE4AFFIAFFYAFFoAFF4AFGIAFGYAFGoAFG4AFHIAFHYAFHoAFH4AFIIAFIYAFIoAFI4AFJIAFJYAFJoAFJ4AFKIAFKYAFKoAFK4AFLIAFLYAFLoAFL4AFMIAFMYAFMoAFM4AFNIAFNYAFNoAFN4AFOIAFOYAFOoAFO4AFPIAFPYAFPoAFP4AFQIAFQYAFQoAFQ4AFRIAFRYAFRoAFR4AFSIAFSYAFSoAFS4AFTIAFTYAFToAFT4AFUIAFUYAFUoAFU4AFVIAFVYAFVoAFV4AFWIAFWYAFWoAFW4AFXIAFXYAFXoAFX4AFYIAFYYAFYoAFY4AYJAMWLAQTWklHMjAxNDJaQjMzMDAwMy0yNCQFACQGACUHlCYkCAAYMX0wewIBA4AUYvqCM1ms+qmWPhz6FArd9QTzcWAwCwYJYIZIAWUDBAIBMAoGCCqGSM49BAMCBEcwRQIgJOXR9Hp9ew0gaibvaZt8l1e3LUaQid4xkuZ4x0Xn9gwCIQD4qi+nEfy3m5fjl87aZnuuRk4r0//fw8zteqjKX0wafA==")!; + func castingAppDidReceiveRequestForDeviceAttestationCredentials(_ sender: Any) -> MTRDeviceAttestationCredentials { + return MTRDeviceAttestationCredentials( + certificationDeclaration: kCertificationDeclaration, + firmwareInformation: Data(), + deviceAttestationCert: kDevelopmentDAC_Cert_FFF1_8001, + productAttestationIntermediateCert: KPAI_FFF1_8000_Cert_Array) + } + + func castingApp(_ sender: Any, didReceiveRequestToSignCertificateRequest csrData: Data) -> Data { + var privateKey = Data() + privateKey.append(kDevelopmentDAC_PublicKey_FFF1_8001); + privateKey.append(kDevelopmentDAC_PrivateKey_FFF1_8001); + + let privateKeyRef: SecKey = SecKeyCreateWithData(privateKey as NSData, + [ + kSecAttrKeyType: kSecAttrKeyTypeECSECPrimeRandom, + kSecAttrKeyClass: kSecAttrKeyClassPrivate, + kSecAttrKeySizeInBits: 256 + ] as NSDictionary, nil)! + + let _:Unmanaged = Unmanaged.passRetained(privateKeyRef); + + return Data() // TODO: use SecKey above to sign csrData and return resulting value + } +} + +class MTRInitializationExample { + let Log = Logger(subsystem: "com.matter.casting", + category: "MTRInitializationExample") + + func initialize() -> MatterError { + if let castingApp = MTRCastingApp.getSharedInstance() + { + return castingApp.initialize(with: MTRAppParametersDataSource()) + } + else + { + return MATTER_ERROR_INCORRECT_STATE + } + } +} diff --git a/examples/tv-casting-app/darwin/TvCasting/TvCasting/TvCastingApp.swift b/examples/tv-casting-app/darwin/TvCasting/TvCasting/TvCastingApp.swift index f0d67cacee9cd5..2616ec0714f537 100644 --- a/examples/tv-casting-app/darwin/TvCasting/TvCasting/TvCastingApp.swift +++ b/examples/tv-casting-app/darwin/TvCasting/TvCasting/TvCastingApp.swift @@ -29,50 +29,90 @@ struct TvCastingApp: App { WindowGroup { ContentView() .onAppear(perform: { - if let castingServerBridge = CastingServerBridge.getSharedInstance() + if ProcessInfo.processInfo.environment["CHIP_CASTING_SIMPLIFIED"] == "1" { - let appParameters: AppParameters = AppParameters() + self.Log.info("CHIP_CASTING_SIMPLIFIED = 1") - var rotatingDeviceIdUniqueId: [UInt8] = [UInt8](repeating: 0, count: 16 ) - for i in (0...15) + let err: MatterError = MTRInitializationExample().initialize() + if !MATTER_NO_ERROR.isEqual(err) { - rotatingDeviceIdUniqueId[i] = UInt8.random(in: 0..<255) + self.Log.error("CastingApp initialization failed \(err)") + } + } + else + { + self.Log.info("CHIP_CASTING_SIMPLIFIED = 0") + + if let castingServerBridge = CastingServerBridge.getSharedInstance() + { + let appParameters: AppParameters = AppParameters() + + var rotatingDeviceIdUniqueId: [UInt8] = [UInt8](repeating: 0, count: 16 ) + for i in (0...15) + { + rotatingDeviceIdUniqueId[i] = UInt8.random(in: 0..<255) + } + appParameters.rotatingDeviceIdUniqueId = Data(rotatingDeviceIdUniqueId) + + let onboardingParameters: OnboardingPayload = OnboardingPayload() + onboardingParameters.setupPasscode = 20202021 + onboardingParameters.setupDiscriminator = 3840 + + appParameters.onboardingPayload = onboardingParameters + + let err = castingServerBridge.initializeApp(appParameters, clientQueue: DispatchQueue.main, initAppStatusHandler: { (result: Bool) -> () in + self.Log.info("initializeApp result \(result)") + }) + self.Log.info("initializeApp return value \(err)") } - appParameters.rotatingDeviceIdUniqueId = Data(rotatingDeviceIdUniqueId) - - let onboardingParameters: OnboardingPayload = OnboardingPayload() - onboardingParameters.setupPasscode = 20202021 - onboardingParameters.setupDiscriminator = 3840 - - appParameters.onboardingPayload = onboardingParameters - - let err = castingServerBridge.initializeApp(appParameters, clientQueue: DispatchQueue.main, initAppStatusHandler: { (result: Bool) -> () in - self.Log.info("initializeApp result \(result)") - }) - self.Log.info("initializeApp return value \(err)") } }) .onReceive(NotificationCenter.default.publisher(for: UIApplication.willResignActiveNotification)) { _ in self.Log.info("TvCastingApp: UIApplication.willResignActiveNotification") - if let castingServerBridge = CastingServerBridge.getSharedInstance() + if ProcessInfo.processInfo.environment["CHIP_CASTING_SIMPLIFIED"] == "1" + { + if let castingApp = MTRCastingApp.getSharedInstance() + { + let err: MatterError = castingApp.stop() + if !MATTER_NO_ERROR.isEqual(err) + { + self.Log.error("CastingApp stop failed \(err)") + } + } + } + else if let castingServerBridge = CastingServerBridge.getSharedInstance() { castingServerBridge.stopMatterServer() } } .onReceive(NotificationCenter.default.publisher(for: UIApplication.didBecomeActiveNotification)) { _ in self.Log.info("TvCastingApp: UIApplication.didBecomeActiveNotification") - if(!firstAppActivation) + if ProcessInfo.processInfo.environment["CHIP_CASTING_SIMPLIFIED"] == "1" { - if let castingServerBridge = CastingServerBridge.getSharedInstance() + if let castingApp = MTRCastingApp.getSharedInstance() { - castingServerBridge.startMatterServer(DispatchQueue.main, startMatterServerCompletionCallback: { (error: MatterError) -> () in - DispatchQueue.main.async { - self.Log.info("TvCastingApp.startMatterServerCompletionCallback called with \(error)") - } - }) + let err: MatterError = castingApp.start() + if !MATTER_NO_ERROR.isEqual(err) + { + self.Log.error("CastingApp start failed \(err)") + } + } + } + else + { + if(!firstAppActivation) + { + if let castingServerBridge = CastingServerBridge.getSharedInstance() + { + castingServerBridge.startMatterServer(DispatchQueue.main, startMatterServerCompletionCallback: { (error: MatterError) -> () in + DispatchQueue.main.async { + self.Log.info("TvCastingApp.startMatterServerCompletionCallback called with \(error)") + } + }) + } } + firstAppActivation = false } - firstAppActivation = false } .onReceive(NotificationCenter.default.publisher(for: UIApplication.didEnterBackgroundNotification)) { _ in self.Log.info("TvCastingApp: UIApplication.didEnterBackgroundNotification") diff --git a/examples/tv-casting-app/darwin/args.gni b/examples/tv-casting-app/darwin/args.gni index 6a8033ab8ac9d0..1158e98e5f2d99 100644 --- a/examples/tv-casting-app/darwin/args.gni +++ b/examples/tv-casting-app/darwin/args.gni @@ -20,8 +20,10 @@ chip_device_project_config_include = "" chip_project_config_include = "" chip_system_project_config_include = "" -chip_project_config_include_dirs += - [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ] +chip_project_config_include_dirs += [ + "${chip_root}/examples/tv-casting-app/tv-casting-common/include", + "${chip_root}/examples/tv-casting-app/tv-casting-common", +] chip_project_config_include_dirs += [ "${chip_root}/config/ios" ] chip_build_libshell = true diff --git a/examples/tv-casting-app/tv-casting-common/BUILD.gn b/examples/tv-casting-app/tv-casting-common/BUILD.gn index 8292d8366b06da..115a0b7e4bbfb0 100644 --- a/examples/tv-casting-app/tv-casting-common/BUILD.gn +++ b/examples/tv-casting-app/tv-casting-common/BUILD.gn @@ -111,8 +111,10 @@ chip_data_model("tv-casting-common") { public_configs = [ ":config" ] - include_dirs = - [ "${chip_root}/examples/tv-casting-app/tv-casting-common/include" ] + include_dirs = [ + "${chip_root}/examples/tv-casting-app/tv-casting-common/include", + "${chip_root}/examples/tv-casting-app/tv-casting-common", + ] is_server = true } diff --git a/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp b/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp index 3dd42d91d293bb..f8d66b03e0ac0c 100644 --- a/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp +++ b/examples/tv-casting-app/tv-casting-common/core/CastingApp.cpp @@ -60,9 +60,17 @@ CHIP_ERROR CastingApp::Initialize(const AppParameters & appParameters) #if CHIP_ENABLE_ROTATING_DEVICE_ID MutableByteSpanDataProvider * uniqueIdProvider = appParameters.GetRotatingDeviceIdUniqueIdProvider(); - if (uniqueIdProvider != nullptr && uniqueIdProvider->Get() != nullptr) + if (uniqueIdProvider != nullptr) { - ReturnErrorOnFailure(chip::DeviceLayer::ConfigurationMgr().SetRotatingDeviceIdUniqueId(*uniqueIdProvider->Get())); + chip::MutableByteSpan * uniqueId = uniqueIdProvider->Get(); + if (uniqueId != nullptr) + { + ReturnErrorOnFailure(chip::DeviceLayer::ConfigurationMgr().SetRotatingDeviceIdUniqueId(*uniqueId)); + } + else + { + return CHIP_ERROR_INVALID_ARGUMENT; + } } #endif // CHIP_ENABLE_ROTATING_DEVICE_ID From 741210db0a8cda73ae46aa0ad1f94723d64ca9fc Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 6 Sep 2023 12:44:36 -0400 Subject: [PATCH 022/134] Stop using dispatch_get_current_queue. (#29075) This function is deprecated. --- src/platform/Darwin/PlatformManagerImpl.cpp | 16 +++++++++++++++- src/platform/Darwin/PlatformManagerImpl.h | 12 +----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/platform/Darwin/PlatformManagerImpl.cpp b/src/platform/Darwin/PlatformManagerImpl.cpp index bf2dde3d4fe360..69a95c44673b05 100644 --- a/src/platform/Darwin/PlatformManagerImpl.cpp +++ b/src/platform/Darwin/PlatformManagerImpl.cpp @@ -163,9 +163,23 @@ bool PlatformManagerImpl::_IsChipStackLockedByCurrentThread() const }; #endif +static int sPlatformManagerKey; // We use pointer to this as key. + +dispatch_queue_t PlatformManagerImpl::GetWorkQueue() +{ + if (mWorkQueue == nullptr) + { + mWorkQueue = dispatch_queue_create(CHIP_CONTROLLER_QUEUE, DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + dispatch_suspend(mWorkQueue); + dispatch_queue_set_specific(mWorkQueue, &sPlatformManagerKey, this, nullptr); + mIsWorkQueueSuspended = true; + } + return mWorkQueue; +} + bool PlatformManagerImpl::IsWorkQueueCurrentQueue() const { - return dispatch_get_current_queue() == mWorkQueue; + return dispatch_get_specific(&sPlatformManagerKey) == this; } CHIP_ERROR PlatformManagerImpl::StartBleScan(BleScannerDelegate * delegate) diff --git a/src/platform/Darwin/PlatformManagerImpl.h b/src/platform/Darwin/PlatformManagerImpl.h index 79da67a4991d2f..2dfa9104e0dab3 100644 --- a/src/platform/Darwin/PlatformManagerImpl.h +++ b/src/platform/Darwin/PlatformManagerImpl.h @@ -45,17 +45,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener public: // ===== Platform-specific members that may be accessed directly by the application. - dispatch_queue_t GetWorkQueue() - { - if (mWorkQueue == nullptr) - { - mWorkQueue = dispatch_queue_create(CHIP_CONTROLLER_QUEUE, DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - dispatch_suspend(mWorkQueue); - mIsWorkQueueSuspended = true; - } - return mWorkQueue; - } - + dispatch_queue_t GetWorkQueue(); bool IsWorkQueueCurrentQueue() const; CHIP_ERROR StartBleScan(BleScannerDelegate * delegate = nullptr); From 26ae6484415d18d205c4f16ba42e3d43c0a959c4 Mon Sep 17 00:00:00 2001 From: sharad-patil24 <100128124+sharad-patil24@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:10:27 +0530 Subject: [PATCH 023/134] LWIP number of pools and pool size reduced for rs9116 (#29005) --- src/lwip/silabs/lwipopts-rs911x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lwip/silabs/lwipopts-rs911x.h b/src/lwip/silabs/lwipopts-rs911x.h index c4a7addb27f0fe..72dcd190896c39 100644 --- a/src/lwip/silabs/lwipopts-rs911x.h +++ b/src/lwip/silabs/lwipopts-rs911x.h @@ -81,7 +81,7 @@ #define LWIP_RAW 1 #define MEMP_NUM_RAW_PCB (4) -#define MEMP_NUM_UDP_PCB (7) +#define MEMP_NUM_UDP_PCB (6) #define LWIP_HAVE_LOOPIF (0) @@ -129,7 +129,7 @@ #define MEMP_SEPARATE_POOLS (1) #define LWIP_PBUF_FROM_CUSTOM_POOLS (0) #define MEMP_USE_CUSTOM_POOLS (0) -#define PBUF_POOL_SIZE (32) +#define PBUF_POOL_SIZE (16) #define PBUF_POOL_BUFSIZE (1280) // IPv6 path MTU #define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL) #define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE) From 0be1ae75eb3e76519cefdc611534b8c9b8243d99 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 6 Sep 2023 14:32:00 -0400 Subject: [PATCH 024/134] Fix slow test skipping in CI. (#29097) CI does "--exclude-tags SLOW", but it was not specifying any "--include-tags", so the harness overwrote the "--exclude-tags" value and we were in fact running the slow tests when we did not want to be. --- scripts/tests/run_test_suite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index dc126b4e471314..643f13ce4d92af 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -169,7 +169,7 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, # If just defaults specified, do not run manual and in development # Specific target basically includes everything - if 'all' in target and not include_tags: + if 'all' in target and not include_tags and not exclude_tags: exclude_tags = { TestTag.MANUAL, TestTag.IN_DEVELOPMENT, From b673df57950f3ed13911c041e927086bf235dc59 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Wed, 6 Sep 2023 14:39:47 -0400 Subject: [PATCH 025/134] Fix ICD Manager Init (#29088) --- src/app/server/Server.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index f7d8d24ab36d2f..81ac0b15a755ba 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -252,14 +252,15 @@ CHIP_ERROR Server::Init(const ServerInitParams & initParams) } #endif // CHIP_CONFIG_ENABLE_SERVER_IM_EVENT + // This initializes clusters, so should come after lower level initialization. + InitDataModelHandler(); + +// ICD Init needs to be after data model init #if CHIP_CONFIG_ENABLE_ICD_SERVER mICDManager.Init(mDeviceStorage, &GetFabricTable(), mReportScheduler); mICDEventManager.Init(&mICDManager); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER - // This initializes clusters, so should come after lower level initialization. - InitDataModelHandler(); - #if defined(CHIP_APP_USE_ECHO) err = InitEchoHandler(&mExchangeMgr); SuccessOrExit(err); From b94eb85ffcee1e6f493d95a02b0d2ee8334fb573 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 6 Sep 2023 18:54:19 +0000 Subject: [PATCH 026/134] Bump third_party/nanopb/repo from `d9ecc77` to `9c11463` (#29048) Bumps [third_party/nanopb/repo](https://github.com/nanopb/nanopb) from `d9ecc77` to `9c11463`. - [Commits](https://github.com/nanopb/nanopb/compare/d9ecc77395f09cd8cafd8b63cb82a27e6b02c04a...9c11463770beab0c6f244999e66676f9bca866fd) --- updated-dependencies: - dependency-name: third_party/nanopb/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/nanopb/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/nanopb/repo b/third_party/nanopb/repo index d9ecc77395f09c..9c11463770beab 160000 --- a/third_party/nanopb/repo +++ b/third_party/nanopb/repo @@ -1 +1 @@ -Subproject commit d9ecc77395f09cd8cafd8b63cb82a27e6b02c04a +Subproject commit 9c11463770beab0c6f244999e66676f9bca866fd From 0b9dfec117994815c56fe673c48be9352656dcb2 Mon Sep 17 00:00:00 2001 From: yzamstm <126248789+STYoannZamaron@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:05:35 +0200 Subject: [PATCH 027/134] [ST] Adding STM32 platform and lighting app example with STM32WB5MM-DK board (#28889) * add stm32cubewb submodule * move submodule stm32cubewb to tag v1.17.0 * fix align in gitmodules * add st in third_party * add builds and scripts to compile stm32 examples * add stm32 platform in matter source files and modifi gn files to use st as a third party * add stm32 lighting app example using stm32wb5mm-dk board * put chip_detail_logging to false to optimize the size of the flash * add support for st CI * typo fixs for ci * add st getting started readme * remove duplicate license * minor fixs in readme and stm32 getting started and add st getting started to the guides/readme * typo fix * mispells fix * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Restyled by prettier-markdown * Restyled by shellharden * Restyled by shfmt * Restyled by isort * Revert "Restyled by clang-format" This reverts commit 90c6d8f1f86763a3c8b254cc3c2532ee660489c7. * move otp to example and fix misspell and remove case sensitive in wordlist * remove unused defines and change return message for unused fonctions * Update docs/guides/stm32_getting_started_guide.md Co-authored-by: Boris Zbarsky * Update docs/guides/stm32_getting_started_guide.md Co-authored-by: Boris Zbarsky * Restyled by whitespace * convert windows to linux file * convert windows to linux files * Restyled by whitespace * Restyled by clang-format * add missing include * removed unused arguments * update shutdown to call the upper class --------- Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .github/.wordlist.txt | 4 + .github/workflows/examples-stm32.yaml | 71 ++ .gitmodules | 6 + BUILD.gn | 3 + build_overrides/stm32_sdk.gni | 18 + config/stm32/toolchain/BUILD.gn | 25 + docs/guides/README.md | 1 + docs/guides/stm32_getting_started_guide.md | 103 ++ examples/build_overrides/stm32_sdk.gni | 18 + examples/lighting-app/stm32/.gn | 28 + examples/lighting-app/stm32/BUILD.gn | 173 ++++ examples/lighting-app/stm32/README.md | 50 + examples/lighting-app/stm32/args.gni | 31 + examples/lighting-app/stm32/build_overrides | 1 + .../stm32/include/STM32WB5/AppEvent.h | 64 ++ .../stm32/include/STM32WB5/AppTask.h | 87 ++ .../include/STM32WB5/CHIPProjectConfig.h | 154 +++ .../stm32/include/STM32WB5/FreeRTOSConfig.h | 191 ++++ .../stm32/include/STM32WB5/LightingManager.h | 74 ++ .../stm32/src/STM32WB5/AppTask.cpp | 591 +++++++++++ .../stm32/src/STM32WB5/LightingManager.cpp | 140 +++ .../stm32/src/STM32WB5/ZclCallbacks.cpp | 47 + .../stm32/third_party/connectedhomeip | 1 + examples/platform/stm32/BUILD.gn | 82 ++ examples/platform/stm32/args.gni | 21 + .../common/STM32WB5MM-DK/Inc/app_common.h | 138 +++ .../stm32/common/STM32WB5MM-DK/Inc/app_conf.h | 667 ++++++++++++ .../common/STM32WB5MM-DK/Inc/app_entry.h | 57 ++ .../common/STM32WB5MM-DK/Inc/flash_driver.h | 181 ++++ .../stm32/common/STM32WB5MM-DK/Inc/flash_wb.h | 116 +++ .../stm32/common/STM32WB5MM-DK/Inc/hw_conf.h | 255 +++++ .../stm32/common/STM32WB5MM-DK/Inc/hw_if.h | 251 +++++ .../stm32/common/STM32WB5MM-DK/Inc/main.h | 65 ++ .../stm32/common/STM32WB5MM-DK/Inc/otp.h | 63 ++ .../common/STM32WB5MM-DK/Inc/stm32_lpm_if.h | 78 ++ .../STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h | 101 ++ .../STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h | 352 +++++++ .../common/STM32WB5MM-DK/Inc/stm32wbxx_it.h | 59 ++ .../common/STM32WB5MM-DK/Inc/stm_logging.h | 71 ++ .../common/STM32WB5MM-DK/Inc/utilities_conf.h | 66 ++ .../STM32WB5MM-DK/STM32_WPAN/App/app_ble.c | 958 ++++++++++++++++++ .../STM32WB5MM-DK/STM32_WPAN/App/app_ble.h | 88 ++ .../STM32WB5MM-DK/STM32_WPAN/App/app_matter.c | 236 +++++ .../STM32WB5MM-DK/STM32_WPAN/App/app_matter.h | 116 +++ .../STM32WB5MM-DK/STM32_WPAN/App/app_thread.c | 665 ++++++++++++ .../STM32WB5MM-DK/STM32_WPAN/App/app_thread.h | 132 +++ .../STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h | 68 ++ .../STM32_WPAN/App/ble_dbg_conf.h | 196 ++++ .../STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c | 261 +++++ .../STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h | 134 +++ .../STM32_WPAN/App/tl_dbg_conf.h | 123 +++ .../STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c | 667 ++++++++++++ .../common/STM32WB5MM-DK/Src/app_entry.cpp | 583 +++++++++++ .../STM32WB5MM-DK/Src/entropy_hardware_poll.c | 76 ++ .../common/STM32WB5MM-DK/Src/flash_driver.c | 322 ++++++ .../stm32/common/STM32WB5MM-DK/Src/flash_wb.c | 357 +++++++ .../common/STM32WB5MM-DK/Src/freertos_port.c | 322 ++++++ .../common/STM32WB5MM-DK/Src/hw_timerserver.c | 899 ++++++++++++++++ .../stm32/common/STM32WB5MM-DK/Src/hw_uart.c | 469 +++++++++ .../stm32/common/STM32WB5MM-DK/Src/main.cpp | 439 ++++++++ .../stm32/common/STM32WB5MM-DK/Src/otp.c | 49 + .../common/STM32WB5MM-DK/Src/stm32_lpm_if.c | 349 +++++++ .../STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c | 385 +++++++ .../Src/stm32wbxx_hal_timebase_tim.c | 149 +++ .../common/STM32WB5MM-DK/Src/stm32wbxx_it.c | 193 ++++ .../common/STM32WB5MM-DK/Src/stm_logging.c | 207 ++++ .../stm32/common/STM32WB5MM-DK/Src/syscalls.c | 156 +++ .../stm32/common/STM32WB5MM-DK/Src/sysmem.c | 57 ++ .../STM32WB5MM-DK/Src/system_stm32wbxx.c | 345 +++++++ .../config_files/STM32WB5/FreeRTOSConfig.h | 191 ++++ .../config_files/STM32WB5/matter_config.h | 139 +++ .../config_files/STM32WB5/threading_alt.h | 50 + .../stm32/ldscripts/STM32WB5MMGHX_FLASH.ld | 198 ++++ .../startup_files/startup_STM32WB5MMGHX.s | 443 ++++++++ scripts/build/build/targets.py | 18 + scripts/build/builders/stm32.py | 93 ++ .../build/testdata/all_targets_linux_x64.txt | 1 + scripts/checkout_submodules.py | 1 + scripts/examples/gn_stm32_example.sh | 198 ++++ scripts/flashing/stm32_firmware_utils.py | 124 +++ src/platform/BUILD.gn | 7 + src/platform/device.gni | 7 +- src/platform/stm32/BLEManagerImpl.cpp | 743 ++++++++++++++ src/platform/stm32/BLEManagerImpl.h | 191 ++++ src/platform/stm32/BUILD.gn | 112 ++ src/platform/stm32/BlePlatformConfig.h | 38 + src/platform/stm32/CHIPDevicePlatformConfig.h | 149 +++ src/platform/stm32/CHIPDevicePlatformEvent.h | 76 ++ src/platform/stm32/CHIPMem-Platform.cpp | 239 +++++ src/platform/stm32/CHIPPlatformConfig.h | 81 ++ .../stm32/ConfigurationManagerImpl.cpp | 168 +++ src/platform/stm32/ConfigurationManagerImpl.h | 89 ++ .../stm32/ConnectivityManagerImpl.cpp | 72 ++ src/platform/stm32/ConnectivityManagerImpl.h | 109 ++ .../stm32/DiagnosticDataProviderImpl.cpp | 63 ++ .../stm32/DiagnosticDataProviderImpl.h | 55 + src/platform/stm32/FactoryDataProvider.cpp | 394 +++++++ src/platform/stm32/FactoryDataProvider.h | 69 ++ src/platform/stm32/InetPlatformConfig.h | 41 + .../stm32/KeyValueStoreManagerImpl.cpp | 121 +++ src/platform/stm32/KeyValueStoreManagerImpl.h | 82 ++ src/platform/stm32/PlatformManagerImpl.cpp | 116 +++ src/platform/stm32/PlatformManagerImpl.h | 101 ++ src/platform/stm32/STM32Config.cpp | 105 ++ src/platform/stm32/STM32Config.h | 93 ++ src/platform/stm32/STM32FreeRtosHooks.cpp | 120 +++ src/platform/stm32/STM32FreeRtosHooks.h | 27 + src/platform/stm32/SystemPlatformConfig.h | 43 + src/platform/stm32/ThreadStackManagerImpl.cpp | 144 +++ src/platform/stm32/ThreadStackManagerImpl.h | 128 +++ src/platform/stm32/args.gni | 53 + src/system/BUILD.gn | 5 + third_party/st/BUILD.gn | 45 + .../FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper | 77 ++ third_party/st/FAMILY/stm32wb5_sdk.gn_helper | 173 ++++ third_party/st/STM32CubeWB | 1 + third_party/st/stm32_arm.gni | 23 + third_party/st/stm32_board.gni | 36 + third_party/st/stm32_executable.gni | 75 ++ third_party/st/stm32_sdk.gni | 182 ++++ 120 files changed, 19412 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/examples-stm32.yaml create mode 100644 build_overrides/stm32_sdk.gni create mode 100644 config/stm32/toolchain/BUILD.gn create mode 100644 docs/guides/stm32_getting_started_guide.md create mode 100644 examples/build_overrides/stm32_sdk.gni create mode 100644 examples/lighting-app/stm32/.gn create mode 100644 examples/lighting-app/stm32/BUILD.gn create mode 100644 examples/lighting-app/stm32/README.md create mode 100644 examples/lighting-app/stm32/args.gni create mode 120000 examples/lighting-app/stm32/build_overrides create mode 100644 examples/lighting-app/stm32/include/STM32WB5/AppEvent.h create mode 100644 examples/lighting-app/stm32/include/STM32WB5/AppTask.h create mode 100644 examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h create mode 100644 examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h create mode 100644 examples/lighting-app/stm32/include/STM32WB5/LightingManager.h create mode 100644 examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp create mode 100644 examples/lighting-app/stm32/src/STM32WB5/LightingManager.cpp create mode 100644 examples/lighting-app/stm32/src/STM32WB5/ZclCallbacks.cpp create mode 120000 examples/lighting-app/stm32/third_party/connectedhomeip create mode 100644 examples/platform/stm32/BUILD.gn create mode 100644 examples/platform/stm32/args.gni create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_common.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_entry.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_driver.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_wb.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_if.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/main.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/otp.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32_lpm_if.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_it.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm_logging.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Inc/utilities_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_dbg_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/tl_dbg_conf.h create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/app_entry.cpp create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/entropy_hardware_poll.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_driver.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_wb.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/freertos_port.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_timerserver.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_uart.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/main.cpp create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/otp.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32_lpm_if.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_timebase_tim.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_it.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/stm_logging.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/syscalls.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/sysmem.c create mode 100644 examples/platform/stm32/common/STM32WB5MM-DK/Src/system_stm32wbxx.c create mode 100644 examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h create mode 100644 examples/platform/stm32/config_files/STM32WB5/matter_config.h create mode 100644 examples/platform/stm32/config_files/STM32WB5/threading_alt.h create mode 100644 examples/platform/stm32/ldscripts/STM32WB5MMGHX_FLASH.ld create mode 100644 examples/platform/stm32/startup_files/startup_STM32WB5MMGHX.s create mode 100644 scripts/build/builders/stm32.py create mode 100755 scripts/examples/gn_stm32_example.sh create mode 100644 scripts/flashing/stm32_firmware_utils.py create mode 100644 src/platform/stm32/BLEManagerImpl.cpp create mode 100644 src/platform/stm32/BLEManagerImpl.h create mode 100644 src/platform/stm32/BUILD.gn create mode 100644 src/platform/stm32/BlePlatformConfig.h create mode 100644 src/platform/stm32/CHIPDevicePlatformConfig.h create mode 100644 src/platform/stm32/CHIPDevicePlatformEvent.h create mode 100644 src/platform/stm32/CHIPMem-Platform.cpp create mode 100644 src/platform/stm32/CHIPPlatformConfig.h create mode 100644 src/platform/stm32/ConfigurationManagerImpl.cpp create mode 100644 src/platform/stm32/ConfigurationManagerImpl.h create mode 100644 src/platform/stm32/ConnectivityManagerImpl.cpp create mode 100644 src/platform/stm32/ConnectivityManagerImpl.h create mode 100644 src/platform/stm32/DiagnosticDataProviderImpl.cpp create mode 100644 src/platform/stm32/DiagnosticDataProviderImpl.h create mode 100644 src/platform/stm32/FactoryDataProvider.cpp create mode 100644 src/platform/stm32/FactoryDataProvider.h create mode 100644 src/platform/stm32/InetPlatformConfig.h create mode 100644 src/platform/stm32/KeyValueStoreManagerImpl.cpp create mode 100644 src/platform/stm32/KeyValueStoreManagerImpl.h create mode 100644 src/platform/stm32/PlatformManagerImpl.cpp create mode 100644 src/platform/stm32/PlatformManagerImpl.h create mode 100644 src/platform/stm32/STM32Config.cpp create mode 100644 src/platform/stm32/STM32Config.h create mode 100644 src/platform/stm32/STM32FreeRtosHooks.cpp create mode 100644 src/platform/stm32/STM32FreeRtosHooks.h create mode 100644 src/platform/stm32/SystemPlatformConfig.h create mode 100644 src/platform/stm32/ThreadStackManagerImpl.cpp create mode 100644 src/platform/stm32/ThreadStackManagerImpl.h create mode 100644 src/platform/stm32/args.gni create mode 100644 third_party/st/BUILD.gn create mode 100644 third_party/st/FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper create mode 100644 third_party/st/FAMILY/stm32wb5_sdk.gn_helper create mode 160000 third_party/st/STM32CubeWB create mode 100644 third_party/st/stm32_arm.gni create mode 100644 third_party/st/stm32_board.gni create mode 100644 third_party/st/stm32_executable.gni create mode 100644 third_party/st/stm32_sdk.gni diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index e572827bac80d2..05a46e2da0395e 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1276,6 +1276,9 @@ StatusCode stderr stdout sterm +stmicroelectronics +stm +stlink storagepath str strcpy @@ -1352,6 +1355,7 @@ ThreadNetworkDiagnostics threadOperationalDataset ThreadStackManager ThreadStackManagerImpl +thread ths Thunderboard timedInteractionTimeoutMs diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml new file mode 100644 index 00000000000000..15f80dd84350be --- /dev/null +++ b/.github/workflows/examples-stm32.yaml @@ -0,0 +1,71 @@ +# Copyright (c) 2020-2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Build example - stm32 + +on: + push: + pull_request: + merge_group: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true + +env: + CHIP_NO_LOG_TIMESTAMPS: true + +jobs: + stm32: + name: stm32 + timeout-minutes: 60 + + env: + BUILD_TYPE: gn_stm32 + + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build:1 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: stm32 + + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} + + - name: Build stm32 example apps + timeout-minutes: 20 + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target stm32-STM32WB5MM-DK-light build \ + " + + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: stm32 + diff --git a/.gitmodules b/.gitmodules index f9050a0595cd6a..6a98ceb1c26ec4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -319,3 +319,9 @@ url = https://github.com/SiliconLabs/wiseconnect branch = master platforms = efr32 +[submodule "third_party/st/STM32CubeWB"] + path = third_party/st/STM32CubeWB + url = https://github.com/STMicroelectronics/STM32CubeWB.git + branch = v1.17.0 + platform = stm32 + diff --git a/BUILD.gn b/BUILD.gn index 5b3a9e480b6336..8c7c5bd4f32c7c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -276,6 +276,9 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { # Set this to true to enable genio builds by default. enable_genio_builds = false + + # Set this to true to enable stm32 builds by default. + enable_stm32_builds = false } # Pigweed does not provide a clang in some configurations. diff --git a/build_overrides/stm32_sdk.gni b/build_overrides/stm32_sdk.gni new file mode 100644 index 00000000000000..e9942b843942f1 --- /dev/null +++ b/build_overrides/stm32_sdk.gni @@ -0,0 +1,18 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +declare_args() { + # Root directory for stm32 SDK build files. + stm32_sdk_build_root = "//third_party/st" +} diff --git a/config/stm32/toolchain/BUILD.gn b/config/stm32/toolchain/BUILD.gn new file mode 100644 index 00000000000000..8ce717c45ea888 --- /dev/null +++ b/config/stm32/toolchain/BUILD.gn @@ -0,0 +1,25 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +import("${build_root}/toolchain/arm_gcc/arm_toolchain.gni") + +arm_toolchain("stm32_lighting_app") { + toolchain_args = { + current_os = "freertos" + import("${chip_root}/examples/lighting-app/stm32/args.gni") + } +} diff --git a/docs/guides/README.md b/docs/guides/README.md index 552f3a30772327..da96c5a8eb7b20 100644 --- a/docs/guides/README.md +++ b/docs/guides/README.md @@ -22,6 +22,7 @@ - [Silicon Labs - Documentation](https://github.com/SiliconLabs/matter#readme) - [Silicon Labs - Building](./silabs_efr32_building.md) - [Silicon Labs - Software Update](./silabs_efr32_software_update.md) +- [STMicroelectronics (STM32)](./stm32_getting_started_guide.md) - [TI - Platform Overview](./ti_platform_overview.md) - [Open IoT SDK - Platform Overview](./openiotsdk_platform_overview.md) - [Open IoT SDK - Examples](./openiotsdk_examples.md) diff --git a/docs/guides/stm32_getting_started_guide.md b/docs/guides/stm32_getting_started_guide.md new file mode 100644 index 00000000000000..55f856cbc0e872 --- /dev/null +++ b/docs/guides/stm32_getting_started_guide.md @@ -0,0 +1,103 @@ +# STM32 Getting Started Guide + +The stm32 platform uses +[Matter](https://github.com/project-chip/connectedhomeip) sdk with FreeRTOS. + +--- + +- [stm32 Getting Started Guide](#stm32-getting-started-guide) + - [Supported Chips](#supported-chips) + - [Matter Example Applications](#matter-example-applications) + - [Building the Example Application](#building-the-example-application) + - [Commissioning](#commissioning) + - [BLE-Thread mode](#ble-thread-mode) + +--- + +## Supported Chips + +The stm32 platform is supported on: + +- [STM32WB5MM-DK](https://www.st.com/en/evaluation-tools/stm32wb5mm-dk.html) + +## Matter Example Applications + +Sample Matter applications are provided for the stm32 platform. They can be used +to speed up development. You can find them in the samples with `/stm32` +subfolder. + +## Building the Example Application + +- [Set Up Matter Environment](./BUILDING.md) + +- Set up STLINK tools + + ``` + apt-get install stlink-tools + ``` + +- Building the Application + + If the lighting example is to be built: + + ``` + ./scripts/build/build_examples.py --target stm32-$stm32_BOARD-lighting build + ``` + +- The output image files are stored in the subdirectories under `out`, the + subdirectory name is the same as the argument specified after the option + `--target` when build the examples. + +- After building the application, `ST-LINK` tool is used to flash it to the + board. Before flashing the application, you will need to flash the fuse and + the co processor binary. The co processor binary and fuse are available + [here](https://github.com/stm32-hotspot/stm32wb-matter-device-over-thread/tree/main/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x) + Dynamic Concurrent Mode BLE Thread for Matter (Supports Full BLE Stack 5.2 + certified and Minimal Thread Device ready v1.3) + + ``` + sudo st-flash write chip-stm32-lighting-example.bin 0x08000000 + + ``` + +## Commissioning + +There is one commissioning modes supported by stm32 platform: + +### BLE-Thread mode + +1. Build and Flash +2. The example will run automatically after booting the stm32 board. +3. Restore factory settings using B1 button by pressing at least 10 seconds +4. Commissioning with + [Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool),for + example: + + ``` + ./chip-tool pairing ble-thread + ``` + +### Bluetooth LE advertising + +In this example, to commission the device onto a Matter network, it must be +discoverable over Bluetooth LE. After powering up the device, the device will +advertise automatically for 30 seconds. After this delay, you will need to reset +the device to start the commissioning procedure. + +### Bluetooth LE rendezvous + +In Matter, the commissioning procedure is done over Bluetooth LE between a +Matter device and the Matter controller(, where the controller has the +commissioner role. + +To start the rendezvous, the controller must get the commissioning information +from the Matter device. The data payload is encoded within a QR code, printed to +the UART console. + +### Thread provisioning + +The provisioning operation, which is the Last part of the rendezvous procedure, +involves sending the Thread network credentials from the Matter controller to +the Matter device. As a result, the device joins the Thread network via a +OpenThread border Router (OTBR) and can communicate with other devices in the +network. diff --git a/examples/build_overrides/stm32_sdk.gni b/examples/build_overrides/stm32_sdk.gni new file mode 100644 index 00000000000000..f9b5048472f6cb --- /dev/null +++ b/examples/build_overrides/stm32_sdk.gni @@ -0,0 +1,18 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +declare_args() { + # Root directory for stm32 SDK. + stm32_sdk_build_root = "//third_party/connectedhomeip/third_party/st" +} diff --git a/examples/lighting-app/stm32/.gn b/examples/lighting-app/stm32/.gn new file mode 100644 index 00000000000000..3d48789e30ab3d --- /dev/null +++ b/examples/lighting-app/stm32/.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + target_cpu = "arm" + target_os = "freertos" + + import("//args.gni") +} diff --git a/examples/lighting-app/stm32/BUILD.gn b/examples/lighting-app/stm32/BUILD.gn new file mode 100644 index 00000000000000..6adecf2d04c1f5 --- /dev/null +++ b/examples/lighting-app/stm32/BUILD.gn @@ -0,0 +1,173 @@ +# # Copyright (c) 2023 Project CHIP Authors +# # +# # Licensed under the Apache License, Version 2.0 (the "License"); +# # you may not use this file except in compliance with the License. +# # You may obtain a copy of the License at +# # +# # http://www.apache.org/licenses/LICENSE-2.0 +# # +# # Unless required by applicable law or agreed to in writing, software +# # distributed under the License is distributed on an "AS IS" BASIS, +# # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# # See the License for the specific language governing permissions and +# # limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("//build_overrides/stm32_sdk.gni") + +import("${build_root}/config/defaults.gni") +import("${chip_root}/src/platform/device.gni") +import("${stm32_sdk_build_root}/stm32_executable.gni") +import("${stm32_sdk_build_root}/stm32_sdk.gni") + +assert(current_os == "freertos") + +stm32_project_dir = "${chip_root}/examples/lighting-app/stm32" +examples_plat_dir = "${chip_root}/examples/platform/stm32" +stm32_board_src = "${chip_root}/examples/platform/stm32/common/STM32WB5MM-DK" + +declare_args() { + # Dump memory usage at link time. + chip_print_memory_usage = false + + # PIN code for PASE session establishment. + setupPinCode = 20202021 + setupDiscriminator = 3840 + + # Monitor & log memory usage at runtime. + enable_heap_monitoring = false + + # Enable Sleepy end device + enable_sleepy_device = false + + # OTA timeout in seconds + OTA_periodic_query_timeout = 86400 +} + +# Sanity check +assert(!(chip_enable_wifi && chip_enable_openthread)) + +# ThunderBoards and Explorer Kit +if (stm32_board == "STM32WB5MM-DK") { + chip_enable_openthread = true +} + +stm32_sdk("sdk") { + if (stm32_board == "STM32WB5MM-DK") { + sources = [ + "${examples_plat_dir}/config_files/STM32WB5/FreeRTOSConfig.h", + "${examples_plat_dir}/config_files/STM32WB5/matter_config.h", + "${stm32_project_dir}/include/STM32WB5/CHIPProjectConfig.h", + ] + } + + include_dirs = [ + "${chip_root}/src/platform/stm32", + "${examples_plat_dir}", + "${chip_root}/src/lib", + ] + + if (stm32_board == "STM32WB5MM-DK") { + include_dirs += [ + "${stm32_project_dir}/include/STM32WB5", + "${examples_plat_dir}/config_files/STM32WB5", + "${chip_root}/src/include", + ] + } + + defines = [ + "BOARD_ID=${stm32_board}", + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}", + "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setupDiscriminator}", + "OTA_PERIODIC_TIMEOUT=${OTA_periodic_query_timeout}", + "STM32STORE_MAX_KEY_SIZE=75", + ] +} + +stm32_executable("lighting_app") { + if (stm32_board == "STM32WB5MM-DK") { + output_name = "chip-stm32-lighting-example.elf" + include_dirs = [ + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/", + "${chip_root}/examples/platform/stm32/common/STM32WB5MM-DK/Inc", + "${chip_root}/src/include/", + ] + defines = [] + + sources = [ + "${stm32_board_src}/STM32_WPAN/App/app_ble.c", + "${stm32_board_src}/STM32_WPAN/App/app_matter.c", + "${stm32_board_src}/STM32_WPAN/App/app_thread.c", + "${stm32_board_src}/STM32_WPAN/App/custom_stm.c", + "${stm32_board_src}/Src/app_entry.cpp", + "${stm32_board_src}/Src/main.cpp", + "src/STM32WB5/AppTask.cpp", + "src/STM32WB5/LightingManager.cpp", + "src/STM32WB5/ZclCallbacks.cpp", + ] + } + + # Add the startup file to the target + sources += [ "${examples_plat_dir}/startup_files/startup_${stm32_mcu}.s" ] + + deps = [ + ":sdk", + "${chip_root}/examples/lighting-app/lighting-common", + "${chip_root}/examples/providers:device_info_provider", + "${chip_root}/src/lib", + "${chip_root}/src/setup_payload", + ] + + defines += [ + "DEBUG", + "USE_HAL_DRIVER", + ] + + # OpenThread Settings + if (chip_enable_openthread) { + deps += [ + "${chip_root}/third_party/openthread:openthread", + "${chip_root}/third_party/openthread:openthread-platform", + ] + } + + if (chip_enable_ota_requestor) { + defines += [ "STM32_OTA_ENABLED" ] + sources += [ "${examples_plat_dir}/OTAConfig.cpp" ] + } + + ldscript = "${examples_plat_dir}/ldscripts/${stm32_mcu}_FLASH.ld" + + inputs = [ ldscript ] + + ldflags = [ + "-T" + rebase_path(ldscript, root_build_dir), + + # other linker flags ... + "-static", + "-Wl,--cref", + "-Wl,--start-group", + "-lc", + "-lm", + "-lstdc++", + "-lsupc++", + "-Wl,--no-warn-rwx-segments", + "-Wl,--end-group", + ] + if (chip_print_memory_usage) { + ldflags += [ + "-Wl,--print-memory-usage", + "-fstack-usage", + ] + } + + output_dir = root_out_dir +} +group("stm32") { + deps = [ ":lighting_app" ] +} + +group("default") { + deps = [ ":stm32" ] +} diff --git a/examples/lighting-app/stm32/README.md b/examples/lighting-app/stm32/README.md new file mode 100644 index 00000000000000..26a6051d1a963e --- /dev/null +++ b/examples/lighting-app/stm32/README.md @@ -0,0 +1,50 @@ +# Matter STM32 Lighting Example over thread + +This example demonstrates the Matter Lighting application on stm32 platform. + +--- + +- [Matter STM32 Lighting Example over thread](#matter-stm32-lighting-example-over-thread) + - [Building and Commissioning](#building-and-commissioning) + - [Cluster Control](#cluster-control) + - [Indicate current state of lightbulb](#indicate-current-state-of-lightbulb) + +--- + +## Building and Commissioning + +Please refer +[Building and Commissioning](../../../docs/guides/stm32_getting_started_guide.md#building-the-example-application) +guides to get started + +``` +./scripts/build/build_examples.py --target stm32-$stm32_BOARD-lighting build +``` + +## Cluster Control + +After successful commissioning, use `chip-tool` to control the board + +- OnOff Cluster + ``` + ./chip-tool onoff on 1 + ./chip-tool onoff off 1 + ./chip-tool onoff toggle 1 + ``` +- LevelControl Cluster + + ``` + ./chip-tool levelcontrol move-to-level 128 10 0 0 1 + ``` + +- ColorControl Cluster + ``` + ./chip-tool colorcontrol move-to-hue-and-saturation 240 100 0 0 0 1 + ``` + +## Indicate current state of lightbulb + +The LCD screen displays "BLE connected" when the BLE rendezvous started. The LCD +screen displays "Network Join" when the board joins thread network. The LCD +screen displays "LED ON" + the light level when the controller enable the light +ON and the line is erased when the controller disable the light. diff --git a/examples/lighting-app/stm32/args.gni b/examples/lighting-app/stm32/args.gni new file mode 100644 index 00000000000000..3fb288dbacef01 --- /dev/null +++ b/examples/lighting-app/stm32/args.gni @@ -0,0 +1,31 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("${chip_root}/config/standalone/args.gni") +import("${chip_root}/src/platform/stm32/args.gni") + +stm32_sdk_target = get_label_info(":sdk", "label_no_toolchain") + +# Size Optimizations +optimize_debug_level = "s" + +chip_enable_ota_requestor = false +chip_project_config_include_dirs = + [ "${chip_root}/examples/lighting-app/stm32/include/STM32WB5" ] +chip_enable_openthread = true +chip_enable_ble = true +chip_config_enable_arg_parser = false +chip_openthread_ftd = false +chip_detail_logging = false diff --git a/examples/lighting-app/stm32/build_overrides b/examples/lighting-app/stm32/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/lighting-app/stm32/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/lighting-app/stm32/include/STM32WB5/AppEvent.h b/examples/lighting-app/stm32/include/STM32WB5/AppEvent.h new file mode 100644 index 00000000000000..ccb5c3fa9a5b20 --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/AppEvent.h @@ -0,0 +1,64 @@ +/* + * + * Copyright (c) 2018 Nest Labs, Inc. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include + +#ifndef APP_EVENT_H +#define APP_EVENT_H + +struct AppEvent; +typedef void (*EventHandler)(AppEvent *); + +struct AppEvent +{ + enum AppEventTypes + { + kEventType_Button = 0, + kEventType_Timer, + kEventType_Level, + kEventType_Install, + }; + + uint16_t Type; + + union + { + struct + { + uint8_t ButtonIdx; + uint8_t Action; + } ButtonEvent; + struct + { + void * Context; + } TimerEvent; + struct + { + uint8_t Action; + int32_t Color; + } LightingEvent; + }; + + EventHandler Handler; +}; + +#endif // APP_EVENT_H diff --git a/examples/lighting-app/stm32/include/STM32WB5/AppTask.h b/examples/lighting-app/stm32/include/STM32WB5/AppTask.h new file mode 100644 index 00000000000000..5c0344cc8c687a --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/AppTask.h @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef APP_TASK_H +#define APP_TASK_H + +#include +#include + +#include "AppEvent.h" +#include "LightingManager.h" +#include "app_entry.h" + +#include +#include +#define APP_NAME "Lighting-app" + +class AppTask +{ + +public: + CHIP_ERROR StartAppTask(); + CHIP_ERROR Init(); + static void AppTaskMain(void * pvParameter); + void PostLightActionRequest(int32_t aActor, LightingManager::Action_t aAction); + void PostEvent(const AppEvent * event); + void UpdateClusterState(); + CHIP_ERROR InitMatter(void); + static void ButtonEventHandler(Push_Button_st * Button); + +protected: + TaskHandle_t mAppTask = NULL; + +private: + friend AppTask & GetAppTask(void); + static void ActionInitiated(LightingManager::Action_t aAction); + static void ActionCompleted(LightingManager::Action_t aAction); + void CancelTimer(void); + void DispatchEvent(AppEvent * event); + static void FunctionHandler(AppEvent * aEvent); + static void LightingActionEventHandler(AppEvent * aEvent); + static void TimerEventHandler(TimerHandle_t xTimer); + static void DelayNvmHandler(TimerHandle_t xTimer); + static void MatterEventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg); + static void UpdateLCD(void); + static void UpdateNvmEventHandler(AppEvent * aEvent); + + enum Function_t + { + kFunction_NoneSelected = 0, + kFunction_SoftwareUpdate = 0, + kFunction_Joiner = 1, + kFunction_SaveNvm = 2, + kFunction_FactoryReset = 3, + + kFunction_Invalid + } Function; + + Function_t mFunction; + bool mFunctionTimerActive; + bool mSyncClusterToButtonAction; + // chip::Ble::BLEEndPoint * mBLEEndPoint; + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} + +#endif // APP_TASK_H diff --git a/examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h b/examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h new file mode 100644 index 00000000000000..a911c565e95a1b --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/CHIPProjectConfig.h @@ -0,0 +1,154 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * CHIP project configuration for stm32wb builds. + * + */ +#ifndef CHIPPROJECTCONFIG_H +#define CHIPPROJECTCONFIG_H + +// Use a default pairing code if one hasn't been provisioned in flash. +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#endif + +#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID + * + * 0xFFF1: Test vendor + */ +#define CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID 0xFFF1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID + * + * 0x8004: example lighting app + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID 0x8004 + +/* define Device type based on the application */ +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 257 // 0x0101 Dimmable Bulb + +/** + * CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER + * + * Enables the use of a hard-coded default serial number if none + * is found in Chip NV storage. + */ +#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER "TEST_SN" + +/** + * CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS + * + * Enable recording UTC timestamps. + */ +#define CHIP_CONFIG_EVENT_LOGGING_UTC_TIMESTAMPS 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote Chip Time service + * using the Chip Time Sync protocol. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING + * + * A string identifying the software version running on the device. + * CHIP service currently expects the software version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING "1.1" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION + * + * The product revision number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software revisions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_REVISION 1 + +/** + * CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING + * + * A string identifying the firmware revision running on the device. + * CHIP service currently expects the firmware version to be in the format + * {MAJOR_VERSION}.0d{MINOR_VERSION} + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING +#define CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_REVISION_STRING "1.17" +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION + * + * The hardware version number assigned to device or product by the device vendor. This + * number is scoped to the device product id, and typically corresponds to a revision of the + * physical device, a change to its packaging, and/or a change to its marketing presentation. + * This value is generally *not* incremented for device software versions. + */ +#define CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION 1 + +/** + * CHIP_DETAIL_LOGGING + * + * Show detail log in terminal + */ +#define CHIP_DETAIL_LOGGING 0 + +/** + * CHIP_ERROR_LOGGING + * + * Show error log in terminal + */ +#define CHIP_ERROR_LOGGING 1 + +/** + * CHIP_PROGRESS_LOGGING + * + * Show progress log in terminal + */ +#define CHIP_PROGRESS_LOGGING 1 + +/** + * CHIP_AUTOMATION_LOGGING + * + * Show automation log in terminal + */ +#define CHIP_AUTOMATION_LOGGING 1 + +#define CHIP_DEVICE_CONFIG_MAX_DISCOVERED_IP_ADDRESSES 5 +/** + * HIGHWATERMARK + * + * define freertos marker + */ +#define HIGHWATERMARK 0 + +#endif /* CHIPPROJECTCONFIG_H */ diff --git a/examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h b/examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h new file mode 100644 index 00000000000000..5423994ea0bc12 --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/FreeRTOSConfig.h @@ -0,0 +1,191 @@ +/* USER CODE BEGIN Header */ +/* + * FreeRTOS Kernel V10.0.1 + * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ +/* USER CODE END Header */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * These parameters and more are described within the 'configuration' section of the + * FreeRTOS API documentation available on the FreeRTOS.org web site. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +/* USER CODE BEGIN Includes */ +/* Section where include file can be added */ +/* USER CODE END Includes */ + +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) +#include +extern uint32_t SystemCoreClock; +#endif +#ifndef CMSIS_device_header +#define CMSIS_device_header "stm32wbxx.h" +#endif /* CMSIS_device_header */ + +#define configENABLE_FPU 0 +#define configENABLE_MPU 0 + +#define configUSE_PREEMPTION 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ (SystemCoreClock) +#define configTICK_RATE_HZ ((TickType_t) 1000) +#define configMAX_PRIORITIES (56) +#define configMINIMAL_STACK_SIZE ((uint16_t) 128) +#define configTOTAL_HEAP_SIZE ((size_t) 1024 * 25) +#define configMAX_TASK_NAME_LEN (32) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 +#define configUSE_TICKLESS_IDLE 0 +/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ +/* Defaults to size_t for backward compatibility, but can be changed + if lengths will always be less than the number of bytes in a size_t. */ +#define configMESSAGE_BUFFER_LENGTH_TYPE size_t +/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES (2) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY (2) +#define configTIMER_QUEUE_LENGTH 10 +#define configTIMER_TASK_STACK_DEPTH 256 + +/* CMSIS-RTOS V2 flags */ +#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 +#define configUSE_OS2_THREAD_ENUMERATE 1 +#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 +#define configUSE_OS2_THREAD_FLAGS 1 +#define configUSE_OS2_TIMER 1 +#define configUSE_OS2_MUTEX 1 + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xQueueGetMutexHolder 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_eTaskGetState 1 + +/* + * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used + * by the application thus the correct define need to be enabled below + */ +#define USE_FreeRTOS_HEAP_4 + +/* Cortex-M specific definitions. */ +#ifdef __NVIC_PRIO_BITS +/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ +#define configPRIO_BITS __NVIC_PRIO_BITS +#else +#define configPRIO_BITS 4 +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +/* USER CODE BEGIN 1 */ +#define configASSERT(x) \ + if ((x) == 0) \ + { \ + taskDISABLE_INTERRUPTS(); \ + for (;;) \ + ; \ + } +/* USER CODE END 1 */ + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler + +/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ + +#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 0 + +/* USER CODE BEGIN Defines */ +/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ +//#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */ +#define configGENERATE_RUN_TIME_STATS 1 + +#if (configGENERATE_RUN_TIME_STATS == 1) + +extern void RTOS_AppConfigureTimerForRuntimeStats(); + +extern uint32_t RTOS_AppGetRuntimeCounterValueFromISR(); + +#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_AppConfigureTimerForRuntimeStats() + +#define portGET_RUN_TIME_COUNTER_VALUE() RTOS_AppGetRuntimeCounterValueFromISR() + +#endif + +/* USER CODE END Defines */ + +#endif /* FREERTOS_CONFIG_H */ diff --git a/examples/lighting-app/stm32/include/STM32WB5/LightingManager.h b/examples/lighting-app/stm32/include/STM32WB5/LightingManager.h new file mode 100644 index 00000000000000..ae3222ce045433 --- /dev/null +++ b/examples/lighting-app/stm32/include/STM32WB5/LightingManager.h @@ -0,0 +1,74 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include + +#include + +class LightingManager +{ +public: + enum Action_t + { + ON_ACTION = 0, + OFF_ACTION, + LEVEL_ACTION, + COLOR_ACTION_XY, + COLOR_ACTION_HSV, + INVALID_ACTION + } Action; + + enum State_t + { + kState_On = 0, + kState_Off, + } State; + + CHIP_ERROR Init(); + bool IsTurnedOn(); + uint8_t GetLevel(); + bool InitiateAction(Action_t aAction, int32_t aActor, uint16_t size, uint8_t * value); + + using LightingCallback_fn = std::function; + + void SetCallbacks(LightingCallback_fn aActionInitiated_CB, LightingCallback_fn aActionCompleted_CB); + +private: + friend LightingManager & LightingMgr(void); + State_t mState; + uint8_t mLevel; + + LightingCallback_fn mActionInitiated_CB; + LightingCallback_fn mActionCompleted_CB; + + void Set(bool aOn); + void SetLevel(uint8_t aLevel); + void UpdateLight(); + + static LightingManager sLight; +}; + +inline LightingManager & LightingMgr(void) +{ + return LightingManager::sLight; +} diff --git a/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp b/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp new file mode 100644 index 00000000000000..4b9d5427adc8f4 --- /dev/null +++ b/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp @@ -0,0 +1,591 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*STM32 includes*/ +#include "AppTask.h" +#include "AppEvent.h" +#include "app_common.h" +#include "app_thread.h" +#include "cmsis_os.h" +#include "dbg_trace.h" +#include "flash_wb.h" +#include "ssd1315.h" +#include "stm32_lcd.h" +#include "stm32_lpm.h" +#include "stm32wb5mm_dk_lcd.h" + +#include "stm_logging.h" +#if HIGHWATERMARK +#include "memory_buffer_alloc.h" +#endif + +/*Matter includes*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if CHIP_ENABLE_OPENTHREAD +#include +#include +#endif + +using namespace ::chip; +using namespace ::chip::app; +using namespace chip::TLV; +using namespace chip::Credentials; +using namespace chip::DeviceLayer; +using namespace ::chip::Platform; +using namespace ::chip::Credentials; +using namespace ::chip::app::Clusters; +using chip::DeviceLayer::PersistedStorage::KeyValueStoreMgr; + +AppTask AppTask::sAppTask; +chip::DeviceLayer::FactoryDataProvider mFactoryDataProvider; + +#define APP_FUNCTION_BUTTON BUTTON_USER1 +#define STM32ThreadDataSet "STM32DataSet" +#define APP_EVENT_QUEUE_SIZE 10 +#define NVM_TIMEOUT 1000 // timer to handle PB to save data in nvm or do a factory reset +#define DELAY_NVM 5000 // save data in nvm after commissioning with a delay of 5 sec +#define STM32_LIGHT_ENDPOINT_ID 1 + +static QueueHandle_t sAppEventQueue; +TimerHandle_t sPushButtonTimeoutTimer; +TimerHandle_t DelayNvmTimer; +const osThreadAttr_t AppTask_attr = { .name = APPTASK_NAME, + .attr_bits = APP_ATTR_BITS, + .cb_mem = APP_CB_MEM, + .cb_size = APP_CB_SIZE, + .stack_mem = APP_STACK_MEM, + .stack_size = APP_STACK_SIZE, + .priority = APP_PRIORITY }; + +static bool sIsThreadProvisioned = false; +static bool sIsThreadEnabled = false; +static bool sHaveBLEConnections = false; +static bool sFabricNeedSaved = false; +static bool sFailCommissioning = false; +static bool sHaveFabric = false; +static uint8_t NvmTimerCpt = 0; +static uint8_t NvmButtonStateCpt = 0; + +CHIP_ERROR AppTask::StartAppTask() +{ + sAppEventQueue = xQueueCreate(APP_EVENT_QUEUE_SIZE, sizeof(AppEvent)); + if (sAppEventQueue == NULL) + { + APP_DBG("Failed to allocate app event queue"); + return CHIP_ERROR_NO_MEMORY; + } + + // Start App task. + osThreadNew(AppTaskMain, NULL, &AppTask_attr); + + return CHIP_NO_ERROR; +} + +void LockOpenThreadTask(void) +{ + chip::DeviceLayer::ThreadStackMgr().LockThreadStack(); +} + +void UnlockOpenThreadTask(void) +{ + chip::DeviceLayer::ThreadStackMgr().UnlockThreadStack(); +} + +CHIP_ERROR AppTask::Init() +{ + + CHIP_ERROR err = CHIP_NO_ERROR; + ChipLogProgress(NotSpecified, "Current Software Version: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING); + + // Setup button handler + APP_ENTRY_PBSetReceiveCallback(ButtonEventHandler); + + // Create FreeRTOS sw timer for Push button timeouts. + sPushButtonTimeoutTimer = xTimerCreate("PushButtonTimer", // Just a text name, not used by the RTOS kernel + pdMS_TO_TICKS(NVM_TIMEOUT), // == default timer period (mS) + true, // no timer reload (==one-shot) + (void *) this, // init timer id + TimerEventHandler // timer callback handler + ); + + DelayNvmTimer = xTimerCreate("Delay_NVM", // Just a text name, not used by the RTOS kernel + DELAY_NVM, // == default timer period (mS) + pdFALSE, // timer reload + 0, // init timer + DelayNvmHandler // timer callback handler + ); + + ThreadStackMgr().InitThreadStack(); + + ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router); + + PlatformMgr().AddEventHandler(MatterEventHandler, 0); + + err = LightingMgr().Init(); + if (err != CHIP_NO_ERROR) + { + APP_DBG("LightingMgr().Init() failed"); + return err; + } + LightingMgr().SetCallbacks(ActionInitiated, ActionCompleted); + +#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY + chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(extDiscTimeoutSecs); +#endif + + // Init ZCL Data Model + static chip::CommonCaseDeviceServerInitParams initParams; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + ReturnErrorOnFailure(mFactoryDataProvider.Init()); + SetDeviceInstanceInfoProvider(&mFactoryDataProvider); + SetCommissionableDataProvider(&mFactoryDataProvider); + SetDeviceAttestationCredentialsProvider(&mFactoryDataProvider); + + chip::Inet::EndPointStateOpenThread::OpenThreadEndpointInitParam nativeParams; + nativeParams.lockCb = LockOpenThreadTask; + nativeParams.unlockCb = UnlockOpenThreadTask; + nativeParams.openThreadInstancePtr = chip::DeviceLayer::ThreadStackMgrImpl().OTInstance(); + initParams.endpointNativeParams = static_cast(&nativeParams); + chip::Server::GetInstance().Init(initParams); + + ConfigurationMgr().LogDeviceConfig(); + + // Open commissioning after boot if no fabric was available + if (chip::Server::GetInstance().GetFabricTable().FabricCount() == 0) + { + PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)); + // Enable BLE advertisements + chip::Server::GetInstance().GetCommissioningWindowManager().OpenBasicCommissioningWindow(); + APP_DBG("BLE advertising started. Waiting for Pairing."); + } + else + { // try to attach to the thread network + uint8_t datasetBytes[Thread::kSizeOperationalDataset]; + size_t datasetLength = 0; + char Message[20]; + snprintf(Message, sizeof(Message), "Fabric Found: %d", chip::Server::GetInstance().GetFabricTable().FabricCount()); + APP_BLE_Init_Dyn_3(); + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) Message, LEFT_MODE); + BSP_LCD_Refresh(0); + CHIP_ERROR error = KeyValueStoreMgr().Get(STM32ThreadDataSet, datasetBytes, sizeof(datasetBytes), &datasetLength); + if (error == CHIP_NO_ERROR) + { + ThreadStackMgr().SetThreadProvision(ByteSpan(datasetBytes, datasetLength)); + ThreadStackMgr().SetThreadEnabled(true); + } + else + { + APP_DBG("Thread network Data set was not found"); + } + } + + err = PlatformMgr().StartEventLoopTask(); + if (err != CHIP_NO_ERROR) + { + APP_DBG("PlatformMgr().StartEventLoopTask() failed"); + } + + return err; +} + +CHIP_ERROR AppTask::InitMatter() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + err = chip::Platform::MemoryInit(); + if (err != CHIP_NO_ERROR) + { + APP_DBG("Platform::MemoryInit() failed"); + } + else + { + APP_DBG("Init CHIP stack"); + err = PlatformMgr().InitChipStack(); + if (err != CHIP_NO_ERROR) + { + APP_DBG("PlatformMgr().InitChipStack() failed"); + } + } + return err; +} + +void AppTask::AppTaskMain(void * pvParameter) +{ + AppEvent event; + + CHIP_ERROR err = sAppTask.Init(); +#if HIGHWATERMARK + UBaseType_t uxHighWaterMark; + HeapStats_t HeapStatsInfo; + size_t max_used; + size_t max_blocks; +#endif // endif HIGHWATERMARK + if (err != CHIP_NO_ERROR) + { + APP_DBG("App task init failled "); + } + + APP_DBG("App Task started"); + while (true) + { + + BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, pdMS_TO_TICKS(10)); + while (eventReceived == pdTRUE) + { + sAppTask.DispatchEvent(&event); + eventReceived = xQueueReceive(sAppEventQueue, &event, 0); + } +#if HIGHWATERMARK + uxHighWaterMark = uxTaskGetStackHighWaterMark(NULL); + vPortGetHeapStats(&HeapStatsInfo); + mbedtls_memory_buffer_alloc_max_get(&max_used, &max_blocks); + +#endif // endif HIGHWATERMARK + } +} + +void AppTask::LightingActionEventHandler(AppEvent * aEvent) +{ + LightingManager::Action_t action; + + if (aEvent->Type == AppEvent::kEventType_Button) + { + // Toggle light + if (LightingMgr().IsTurnedOn()) + { + action = LightingManager::OFF_ACTION; + } + else + { + action = LightingManager::ON_ACTION; + } + + sAppTask.mSyncClusterToButtonAction = true; + LightingMgr().InitiateAction(action, 0, 0, 0); + } + if (aEvent->Type == AppEvent::kEventType_Level && aEvent->ButtonEvent.Action != 0) + { + // Toggle Dimming of light between 2 fixed levels + uint8_t val = 0x0; + val = LightingMgr().GetLevel() == 0x7f ? 0x1 : 0x7f; + action = LightingManager::LEVEL_ACTION; + + sAppTask.mSyncClusterToButtonAction = true; + LightingMgr().InitiateAction(action, 0, 1, &val); + } +} + +void AppTask::ButtonEventHandler(Push_Button_st * Button) +{ + + AppEvent button_event = {}; + button_event.Type = AppEvent::kEventType_Button; + button_event.ButtonEvent.ButtonIdx = Button->Pushed_Button; + button_event.ButtonEvent.Action = Button->State; + + if (Button->Pushed_Button == APP_FUNCTION_BUTTON) + { + // Hand off to Functionality handler - depends on duration of press + button_event.Handler = FunctionHandler; + } + else + { + return; + } + + sAppTask.PostEvent(&button_event); +} + +void AppTask::TimerEventHandler(TimerHandle_t xTimer) +{ + + NvmTimerCpt++; + if (BSP_PB_GetState(BUTTON_USER1) == 0) + { + NvmButtonStateCpt++; + } + if (NvmTimerCpt >= 10) + { + xTimerStop(sPushButtonTimeoutTimer, 0); + if (NvmButtonStateCpt >= 9) + { + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = UpdateNvmEventHandler; + sAppTask.mFunction = kFunction_FactoryReset; + sAppTask.PostEvent(&event); + } + } + else if ((NvmTimerCpt > NvmButtonStateCpt) && (NvmTimerCpt <= 2)) + { + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = UpdateNvmEventHandler; + xTimerStop(sPushButtonTimeoutTimer, 0); + sAppTask.mFunction = kFunction_SaveNvm; + sAppTask.PostEvent(&event); + } +} + +void AppTask::FunctionHandler(AppEvent * aEvent) +{ + if (xTimerIsTimerActive(sPushButtonTimeoutTimer) == 0) + { + xTimerStart(sPushButtonTimeoutTimer, 0); + NvmTimerCpt = 0; + NvmButtonStateCpt = 0; + } +} + +void AppTask::ActionInitiated(LightingManager::Action_t aAction) +{ + // Placeholder for light action + UTIL_LCD_ClearStringLine(2); + if (aAction == LightingManager::ON_ACTION) + { + APP_DBG("Light goes on"); + char Message[11]; + snprintf(Message, sizeof(Message), "LED ON %d", LightingMgr().GetLevel()); + UTIL_LCD_DisplayStringAt(0, LINE(2), (uint8_t *) Message, CENTER_MODE); + } + else if (aAction == LightingManager::OFF_ACTION) + { + APP_DBG("Light goes off "); + UTIL_LCD_ClearStringLine(2); + } + else if (aAction == LightingManager::LEVEL_ACTION) + { + if (LightingMgr().IsTurnedOn()) + { + char Message[11]; + snprintf(Message, sizeof(Message), "LED ON %d", LightingMgr().GetLevel()); + UTIL_LCD_DisplayStringAt(0, LINE(2), (uint8_t *) Message, CENTER_MODE); + APP_DBG("Update level control %d", LightingMgr().GetLevel()); + } + } + BSP_LCD_Refresh(0); +} + +void AppTask::ActionCompleted(LightingManager::Action_t aAction) +{ + // Placeholder for light action completed + if (aAction == LightingManager::ON_ACTION) + { + APP_DBG("Light action on completed"); + } + else if (aAction == LightingManager::OFF_ACTION) + { + APP_DBG("Light action off completed"); + } + if (sAppTask.mSyncClusterToButtonAction) + { + sAppTask.UpdateClusterState(); + sAppTask.mSyncClusterToButtonAction = false; + } +} + +void AppTask::PostEvent(const AppEvent * aEvent) +{ + if (sAppEventQueue != NULL) + { + if (!xQueueSend(sAppEventQueue, aEvent, 1)) + { + ChipLogError(NotSpecified, "Failed to post event to app task event queue"); + } + } + else + { + ChipLogError(NotSpecified, "Event Queue is NULL should never happen"); + } +} + +void AppTask::DispatchEvent(AppEvent * aEvent) +{ + if (aEvent->Handler) + { + aEvent->Handler(aEvent); + } + else + { + ChipLogError(NotSpecified, "Event received with no handler. Dropping event."); + } +} + +/** + * Update cluster status after application level changes + */ +void AppTask::UpdateClusterState(void) +{ + ChipLogProgress(NotSpecified, "UpdateClusterState"); + // Write the new on/off value + EmberAfStatus status = Clusters::OnOff::Attributes::OnOff::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().IsTurnedOn()); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: updating on/off %x", status); + } + + // Write new level value + status = Clusters::LevelControl::Attributes::CurrentLevel::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().GetLevel()); + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(NotSpecified, "ERR: updating level %x", status); + } +} + +void AppTask::DelayNvmHandler(TimerHandle_t xTimer) +{ + AppEvent event; + event.Type = AppEvent::kEventType_Timer; + event.Handler = UpdateNvmEventHandler; + sAppTask.mFunction = kFunction_SaveNvm; + sAppTask.PostEvent(&event); +} + +void AppTask::UpdateLCD(void) +{ + if (sIsThreadProvisioned && sIsThreadEnabled) + { + UTIL_LCD_DisplayStringAt(0, LINE(4), (uint8_t *) "Network Joined", LEFT_MODE); + } + else if ((sIsThreadProvisioned == false) || (sIsThreadEnabled == false)) + { + UTIL_LCD_ClearStringLine(4); + } + if (sHaveBLEConnections) + { + UTIL_LCD_ClearStringLine(1); + BSP_LCD_Refresh(0); + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) "BLE Connected", LEFT_MODE); + } + if (sHaveFabric) + { + UTIL_LCD_ClearStringLine(1); + BSP_LCD_Refresh(0); + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) "Fabric Created", LEFT_MODE); + } + if (sFailCommissioning == true) + { + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) "", LEFT_MODE); + BSP_LCD_Refresh(0); + UTIL_LCD_DisplayStringAt(0, LINE(1), (uint8_t *) "Fabric Failed", LEFT_MODE); + } + BSP_LCD_Refresh(0); +} + +void AppTask::UpdateNvmEventHandler(AppEvent * aEvent) +{ + uint8_t err = 0; + + if (sAppTask.mFunction == kFunction_SaveNvm) + { + if (sIsThreadProvisioned && sIsThreadEnabled) + { + chip::Thread::OperationalDataset dataset{}; + DeviceLayer::ThreadStackMgrImpl().GetThreadProvision(dataset); + ByteSpan datasetbyte = dataset.AsByteSpan(); + KeyValueStoreMgr().Put(STM32ThreadDataSet, datasetbyte.data(), datasetbyte.size()); + } + err = NM_Dump(); + if (err == 0) + { + APP_DBG("SAVE NVM"); + } + else + { + APP_DBG("Failed to SAVE NVM"); + // restart timer to save nvm later + xTimerStart(DelayNvmTimer, 0); + } + } + else if (sAppTask.mFunction == kFunction_FactoryReset) + { + APP_DBG("FACTORY RESET"); + NM_ResetFactory(); + } +} + +void AppTask::MatterEventHandler(const ChipDeviceEvent * event, intptr_t) +{ + switch (event->Type) + { + case DeviceEventType::kServiceProvisioningChange: { + sIsThreadProvisioned = event->ServiceProvisioningChange.IsServiceProvisioned; + UpdateLCD(); + break; + } + + case DeviceEventType::kThreadConnectivityChange: { + sIsThreadEnabled = (event->ThreadConnectivityChange.Result == kConnectivity_Established); + UpdateLCD(); + break; + } + + case DeviceEventType::kCHIPoBLEConnectionEstablished: { + sHaveBLEConnections = true; + APP_DBG("kCHIPoBLEConnectionEstablished"); + UpdateLCD(); + break; + } + + case DeviceEventType::kCHIPoBLEConnectionClosed: { + sHaveBLEConnections = false; + APP_DBG("kCHIPoBLEConnectionClosed"); + UpdateLCD(); + if (sFabricNeedSaved) + { + APP_DBG("Start timer to save nvm after commissioning finish"); + // timer is used to avoid to much traffic on m0 side after the end of a commissioning + xTimerStart(DelayNvmTimer, 0); + sFabricNeedSaved = false; + } + break; + } + + case DeviceEventType::kCommissioningComplete: { + sFabricNeedSaved = true; + sHaveFabric = true; + // check if ble is on, since before save in nvm we need to stop m0, Better to write in nvm when m0 is less busy + if (sHaveBLEConnections == false) + { + APP_DBG("Start timer to save nvm after commissioning finish"); + xTimerStart(DelayNvmTimer, 0); + sFabricNeedSaved = false; // put to false to avoid save in nvm 2 times + } + UpdateLCD(); + break; + } + case DeviceEventType::kFailSafeTimerExpired: { + UpdateLCD(); + sFailCommissioning = true; + break; + } + default: + break; + } +} diff --git a/examples/lighting-app/stm32/src/STM32WB5/LightingManager.cpp b/examples/lighting-app/stm32/src/STM32WB5/LightingManager.cpp new file mode 100644 index 00000000000000..4b8018d7252cfb --- /dev/null +++ b/examples/lighting-app/stm32/src/STM32WB5/LightingManager.cpp @@ -0,0 +1,140 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "LightingManager.h" +#include + +// default initialization value for the light level after start +constexpr uint8_t kDefaultLevel = 64; + +LightingManager LightingManager::sLight; + +CHIP_ERROR LightingManager::Init() +{ + mState = kState_Off; + mLevel = kDefaultLevel; + + return CHIP_NO_ERROR; +} + +bool LightingManager::IsTurnedOn() +{ + return mState == kState_On; +} + +uint8_t LightingManager::GetLevel() +{ + return mLevel; +} + +void LightingManager::SetCallbacks(LightingCallback_fn aActionInitiated_CB, LightingCallback_fn aActionCompleted_CB) +{ + mActionInitiated_CB = aActionInitiated_CB; + mActionCompleted_CB = aActionCompleted_CB; +} + +bool LightingManager::InitiateAction(Action_t aAction, int32_t aActor, uint16_t size, uint8_t * value) +{ + bool action_initiated = false; + State_t new_state = kState_Off; + + switch (aAction) + { + case ON_ACTION: + ChipLogProgress(NotSpecified, "LightMgr:ON: %s->ON", mState == kState_On ? "ON" : "OFF"); + break; + case OFF_ACTION: + ChipLogProgress(NotSpecified, "LightMgr:OFF: %s->OFF", mState == kState_On ? "ON" : "OFF"); + break; + case LEVEL_ACTION: + ChipLogProgress(NotSpecified, "LightMgr:LEVEL: lev:%u->%u", mLevel, *value); + break; + default: + ChipLogProgress(NotSpecified, "LightMgr:Unknown"); + break; + } + + // Initiate On/Off Action only when the previous one is complete. + if (mState == kState_Off && aAction == ON_ACTION) + { + action_initiated = true; + new_state = kState_On; + } + else if (mState == kState_On && aAction == OFF_ACTION) + { + action_initiated = true; + new_state = kState_Off; + } + else if (aAction == LEVEL_ACTION && *value != mLevel) + { + action_initiated = true; + if (*value == 0) + { + new_state = kState_Off; + } + else + { + new_state = kState_On; + } + } + if (aAction == LEVEL_ACTION) + { + SetLevel(*value); + } + else + { + Set(new_state == kState_On); + } + if (action_initiated) + { + if (mActionInitiated_CB) + { + mActionInitiated_CB(aAction); + } + + if (mActionCompleted_CB) + { + mActionCompleted_CB(aAction); + } + } + + return action_initiated; +} + +void LightingManager::SetLevel(uint8_t aLevel) +{ + mLevel = aLevel; + + UpdateLight(); +} + +void LightingManager::Set(bool aOn) +{ + if (aOn) + { + mState = kState_On; + } + else + { + mState = kState_Off; + } + UpdateLight(); +} + +void LightingManager::UpdateLight() {} diff --git a/examples/lighting-app/stm32/src/STM32WB5/ZclCallbacks.cpp b/examples/lighting-app/stm32/src/STM32WB5/ZclCallbacks.cpp new file mode 100644 index 00000000000000..762ad402274cf6 --- /dev/null +++ b/examples/lighting-app/stm32/src/STM32WB5/ZclCallbacks.cpp @@ -0,0 +1,47 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2019 Google LLC. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppTask.h" +#include "LightingManager.h" + +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app::Clusters; + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + ClusterId clusterId = attributePath.mClusterId; + AttributeId attributeId = attributePath.mAttributeId; + + if (clusterId == OnOff::Id && attributeId == OnOff::Attributes::OnOff::Id) + { + LightingMgr().InitiateAction(*value ? LightingManager::ON_ACTION : LightingManager::OFF_ACTION, 0, size, value); + } + else if (clusterId == LevelControl::Id && attributeId == LevelControl::Attributes::CurrentLevel::Id) + { + LightingMgr().InitiateAction(LightingManager::LEVEL_ACTION, 0, size, value); + } +} + +void emberAfOnOffClusterInitCallback(EndpointId endpoint) {} diff --git a/examples/lighting-app/stm32/third_party/connectedhomeip b/examples/lighting-app/stm32/third_party/connectedhomeip new file mode 120000 index 00000000000000..c866b86874994d --- /dev/null +++ b/examples/lighting-app/stm32/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/examples/platform/stm32/BUILD.gn b/examples/platform/stm32/BUILD.gn new file mode 100644 index 00000000000000..cd843ec196c2df --- /dev/null +++ b/examples/platform/stm32/BUILD.gn @@ -0,0 +1,82 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/stm32_sdk.gni") +import("${chip_root}/src/lib/lib.gni") +import("${chip_root}/src/platform/device.gni") +import("${srm32_sdk_build_root}/stm32_board.gni") +import("${stm32_sdk_build_root}/stm32_sdk.gni") + +config("chip_examples_project_config") { + include_dirs = [ "project_include" ] + + # Link options that provide a replacement for dynamic memory operations in standard + # library with the FreeRTOS malloc in platform code. + ldflags = [ + # memory allocation -- these must be re-entrant and do locking + #"-Wl,--wrap=malloc", + #"-Wl,--wrap=free", + #"-Wl,--wrap=realloc", + #"-Wl,--wrap=calloc", + #"-Wl,--wrap=MemoryAlloc", + # Wrap these in case internal newlib call them (e.g. strdup will) + # directly call _malloc_r) + #"-Wl,--wrap=_malloc_r", + #"-Wl,--wrap=_realloc_r", + #"-Wl,--wrap=_free_r", + #"-Wl,--wrap=_calloc_r", + ] +} + +source_set("openthread_core_config_stm32_chip_examples") { + if (chip_enable_openthread) { + sources = [ + # "project_include/OpenThreadConfig.h" + ] + + public_deps = [ "${stm32_sdk_build_root}:stm32_sdk" ] + + if (use_st_thread_lib) { + public_deps += [ "${stm32_sdk_build_root}:openthread_core_config_stm32" ] + } else { + public_deps += [ "${chip_root}/third_party/openthread/platforms/stm32:openthread_core_config_stm32" ] + } + + public_configs = [ ":chip_examples_project_config" ] + } +} + +config("attestation-credentials-config") { + include_dirs = [ "${chip_root}" ] + + defines = [ + # Set to 1 to enable stm32 attestation credentials + "STM32_ATTESTATION_CREDENTIALS", + ] +} + +source_set("stm32-attestation-credentials") { + sources = [ + # "stm32DeviceAttestationCreds.cpp", + # "stm32DeviceAttestationCreds.h", + ] + + public_deps = [ + "${chip_root}/src/credentials", + "${chip_root}/src/platform:platform_base", + ] + + public_configs = [ ":attestation-credentials-config" ] +} diff --git a/examples/platform/stm32/args.gni b/examples/platform/stm32/args.gni new file mode 100644 index 00000000000000..53604116cd174f --- /dev/null +++ b/examples/platform/stm32/args.gni @@ -0,0 +1,21 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +chip_ble_project_config_include = "" +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_inet_project_config_include = "" +chip_system_project_config_include = "" diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_common.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_common.h new file mode 100644 index 00000000000000..63b2af6ae8a23b --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_common.h @@ -0,0 +1,138 @@ +/** + ****************************************************************************** + * @file app_common.h + * @author MCD Application Team + * @brief Common + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __APP_COMMON_H +#define __APP_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "app_conf.h" +#include "stm_logging.h" +#include +#include +#include +#include +#include + +/* -------------------------------- * + * Basic definitions * + * -------------------------------- */ + +#undef NULL +#define NULL 0 + +#undef FALSE +#define FALSE 0 + +#undef TRUE +#define TRUE (!0) + +/*SECTION*/ + +#define section_text __attribute__((section(".extendtext"), noinline)) + +/* -------------------------------- * + * Critical Section definition * + * -------------------------------- */ +#define BACKUP_PRIMASK() uint32_t primask_bit = __get_PRIMASK() +#define DISABLE_IRQ() __disable_irq() +#define RESTORE_PRIMASK() __set_PRIMASK(primask_bit) + +/* -------------------------------- * + * Macro delimiters * + * -------------------------------- */ + +#define M_BEGIN \ + do \ + { + +#define M_END \ + } \ + while (0) + +/* -------------------------------- * + * Some useful macro definitions * + * -------------------------------- */ + +#ifndef MAX +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) +#endif + +#ifndef MIN +#define MIN(x, y) (((x) < (y)) ? (x) : (y)) +#endif + +#define MODINC(a, m) \ + M_BEGIN(a)++; \ + if ((a) >= (m)) \ + (a) = 0; \ + M_END + +#define MODDEC(a, m) \ + M_BEGIN if ((a) == 0)(a) = (m); \ + (a)--; \ + M_END + +#define MODADD(a, b, m) \ + M_BEGIN(a) += (b); \ + if ((a) >= (m)) \ + (a) -= (m); \ + M_END + +#define MODSUB(a, b, m) MODADD(a, (m) - (b), m) + +#define PAUSE(t) \ + M_BEGIN \ + volatile int _i; \ + for (_i = t; _i > 0; _i--) \ + ; \ + M_END + +#define DIVF(x, y) ((x) / (y)) + +#define DIVC(x, y) (((x) + (y) -1) / (y)) + +#define DIVR(x, y) (((x) + ((y) / 2)) / (y)) + +#define SHRR(x, n) ((((x) >> ((n) -1)) + 1) >> 1) + +#define BITN(w, n) (((w)[(n) / 32] >> ((n) % 32)) & 1) + +#define BITNSET(w, n, b) \ + M_BEGIN(w)[(n) / 32] |= ((U32)(b)) << ((n) % 32); \ + M_END + +/* -------------------------------- * + * Compiler * + * -------------------------------- */ +#define PLACE_IN_SECTION(__x__) __attribute__((section(__x__))) + +#ifdef WIN32 +#define ALIGN(n) +#else +#define ALIGN(n) __attribute__((aligned(n))) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*__APP_COMMON_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_conf.h new file mode 100644 index 00000000000000..fe6e3b2aa16a29 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_conf.h @@ -0,0 +1,667 @@ +/** + ****************************************************************************** + * File Name : app_conf.h + * Description : Application configuration file for STM32WPAN middleWare. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef APP_CONF_H +#define APP_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "hw.h" +#include "hw_conf.h" +#include "hw_if.h" + +/****************************************************************************** + * Application Config + ******************************************************************************/ + +/**< generic parameters */ + +/** + * + * Define Tx Power + */ +#define CFG_TX_POWER (0x18) /**< 0dbm */ + +/** + * Define Advertising parameters + */ +#define CFG_ADV_BD_ADDRESS (0x7257acd87a6c) +#define CFG_FAST_CONN_ADV_INTERVAL_MIN (0x80) /**< 80ms */ +#define CFG_FAST_CONN_ADV_INTERVAL_MAX (0xa0) /**< 100ms */ +#define CFG_LP_CONN_ADV_INTERVAL_MIN (0x640) /**< 1s */ +#define CFG_LP_CONN_ADV_INTERVAL_MAX (0xfa0) /**< 2.5s */ + +/** + * Define IO Authentication + */ +#define CFG_BONDING_MODE (1) +#define CFG_FIXED_PIN (111111) +#define CFG_USED_FIXED_PIN (0) +#define CFG_ENCRYPTION_KEY_SIZE_MAX (16) +#define CFG_ENCRYPTION_KEY_SIZE_MIN (8) + +/** + * Define IO capabilities + */ +#define CFG_IO_CAPABILITY_DISPLAY_ONLY (0x00) +#define CFG_IO_CAPABILITY_DISPLAY_YES_NO (0x01) +#define CFG_IO_CAPABILITY_KEYBOARD_ONLY (0x02) +#define CFG_IO_CAPABILITY_NO_INPUT_NO_OUTPUT (0x03) +#define CFG_IO_CAPABILITY_KEYBOARD_DISPLAY (0x04) + +#define CFG_IO_CAPABILITY CFG_IO_CAPABILITY_DISPLAY_YES_NO + +/** + * Define MITM modes + */ +#define CFG_MITM_PROTECTION_NOT_REQUIRED (0x00) +#define CFG_MITM_PROTECTION_REQUIRED (0x01) + +#define CFG_MITM_PROTECTION CFG_MITM_PROTECTION_REQUIRED + +/** + * Define PHY + */ +#define ALL_PHYS_PREFERENCE 0x00 +#define RX_2M_PREFERRED 0x02 +#define TX_2M_PREFERRED 0x02 +#define TX_1M 0x01 +#define TX_2M 0x02 +#define RX_1M 0x01 +#define RX_2M 0x02 + +/* freertos defines */ +#define CFG_SHCI_USER_EVT_PROCESS_NAME "SHCI_USER_EVT_PROCESS" +#define CFG_SHCI_USER_EVT_PROCESS_ATTR_BITS (0) +#define CFG_SHCI_USER_EVT_PROCESS_CB_MEM (0) +#define CFG_SHCI_USER_EVT_PROCESS_CB_SIZE (0) +#define CFG_SHCI_USER_EVT_PROCESS_STACK_MEM (0) +#define CFG_SHCI_USER_EVT_PROCESS_PRIORITY osPriorityNormal +#define CFG_SHCI_USER_EVT_PROCESS_STACK_SIZE (128 * 20) + +#define CFG_PUSH_BUTTON_EVT_PROCESS_NAME "PUSH_BUTTON_EVT_PROCESS" +#define CFG_PUSH_BUTTON_EVT_PROCESS_ATTR_BITS (0) +#define CFG_PUSH_BUTTON_EVT_PROCESS_CB_MEM (0) +#define CFG_PUSH_BUTTON_EVT_PROCESS_CB_SIZE (0) +#define CFG_PUSH_BUTTON_EVT_PROCESS_STACK_MEM (0) +#define CFG_PUSH_BUTTON_EVT_PROCESS_PRIORITY osPriorityNormal +#define CFG_PUSH_BUTTON_EVT_PROCESS_STACK_SIZE (128 * 4) + +#define CFG_SEND_COAP_NAME "SEND_COAP_EVT_PROCESS" + +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_NAME "SWITCH_PROTCOL_EVT_PROCESS" +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_ATTR_BITS (0) +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_CB_MEM (0) +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_CB_SIZE (0) +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_STACK_MEM (0) +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_PRIORITY osPriorityNormal +#define CFG_SWITCH_PROTOCOL_EVT_PROCESS_STACK_SIZE (128 * 8) + +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_NAME "THREAD_MSG_M0_TO_M4_PROCESS" +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_ATTR_BITS (0) +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_CB_MEM (0) +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_CB_SIZE (0) +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_STACK_MEM (0) +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_PRIORITY osPriorityNormal +#define CFG_THREAD_MSG_M0_TO_M4_PROCESS_STACK_SIZE (128 * 8) + +#define CFG_THREAD_CLI_PROCESS_NAME "THREAD_CLI_PROCESS" +#define CFG_THREAD_CLI_PROCESS_ATTR_BITS (0) +#define CFG_THREAD_CLI_PROCESS_CB_MEM (0) +#define CFG_THREAD_CLI_PROCESS_CB_SIZE (0) +#define CFG_THREAD_CLI_PROCESS_STACK_MEM (0) +#define CFG_THREAD_CLI_PROCESS_PRIORITY osPriorityNormal +#define CFG_THREAD_CLI_PROCESS_STACK_SIZE (128 * 8) + +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_NAME "THREAD_SEND_COAP_MSG_PROCESS" +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_ATTR_BITS (0) +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_CB_MEM (0) +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_CB_SIZE (0) +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_STACK_MEM (0) +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_PRIORITY osPriorityNormal +#define CFG_THREAD_SEND_COAP_MSG_PROCESS_STACk_SIZE (128 * 8) + +#define CFG_THREAD_SET_SED_MODE_PROCESS_NAME "THREAD_SET_SED_MODE_PROCESS" +#define CFG_THREAD_SET_SED_MODE_PROCESS_ATTR_BITS (0) +#define CFG_THREAD_SET_SED_MODE_PROCESS_CB_MEM (0) +#define CFG_THREAD_SET_SED_MODE_PROCESS_CB_SIZE (0) +#define CFG_THREAD_SET_SED_MODE_PROCESS_STACK_MEM (0) +#define CFG_THREAD_SET_SED_MODE_PROCESS_PRIORITY osPriorityNormal +#define CFG_THREAD_SET_SED_MODE_PROCESS_STACk_SIZE (128 * 8) + +#define CFG_HCI_USER_EVT_PROCESS_NAME "HCI_USER_EVT_PROCESS" +#define CFG_HCI_USER_EVT_PROCESS_ATTR_BITS (0) +#define CFG_HCI_USER_EVT_PROCESS_CB_MEM (0) +#define CFG_HCI_USER_EVT_PROCESS_CB_SIZE (0) +#define CFG_HCI_USER_EVT_PROCESS_STACK_MEM (0) +#define CFG_HCI_USER_EVT_PROCESS_PRIORITY osPriorityNormal +#define CFG_HCI_USER_EVT_PROCESS_STACK_SIZE (128 * 40) + +#define CFG_ADV_UPDATE_PROCESS_NAME "ADV_UPDATE_PROCESS" +#define CFG_ADV_UPDATE_PROCESS_ATTR_BITS (0) +#define CFG_ADV_UPDATE_PROCESS_CB_MEM (0) +#define CFG_ADV_UPDATE_PROCESS_CB_SIZE (0) +#define CFG_ADV_UPDATE_PROCESS_STACK_MEM (0) +#define CFG_ADV_UPDATE_PROCESS_PRIORITY osPriorityNormal +#define CFG_ADV_UPDATE_PROCESS_STACK_SIZE (128 * 20) + +#define CFG_P2P_SERVER_PROCESS_NAME "P2P_SERVER_PROCESS" +#define CFG_P2P_SERVER_PROCESS_ATTR_BITS (0) +#define CFG_P2P_SERVER_PROCESS_CB_MEM (0) +#define CFG_P2P_SERVER_PROCESS_CB_SIZE (0) +#define CFG_P2P_SERVER_PROCESS_STACK_MEM (0) +#define CFG_P2P_SERVER_PROCESS_PRIORITY osPriorityNormal +#define CFG_P2P_SERVER_PROCESS_STACK_SIZE (128 * 20) + +#define LED_PROCESS_NAME "LED_CUBE_PROCESS" +#define LED_PROCESS_ATTR_BITS (0) +#define LED_PROCESS_CB_MEM (0) +#define LED_PROCESS_CB_SIZE (0) +#define LED_PROCESS_STACK_MEM (0) +#define LED_PROCESS_PRIORITY osPriorityNormal +#define LED_PROCESS_STACK_SIZE (128 * 10) + +#define APPTASK_NAME "APPTASK" +#define APP_ATTR_BITS (0) +#define APP_CB_MEM (0) +#define APP_CB_SIZE (0) +#define APP_STACK_MEM (0) +#define APP_PRIORITY osPriorityNormal +#define APP_STACK_SIZE (1024 * 6) + +/** + * Identity root key used to derive LTK and CSRK + */ +#define CFG_BLE_IRK \ + { \ + 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 \ + } + +/** + * Encryption root key used to derive LTK and CSRK + */ +#define CFG_BLE_ERK \ + { \ + 0xfe, 0xdc, 0xba, 0x09, 0x87, 0x65, 0x43, 0x21, 0xfe, 0xdc, 0xba, 0x09, 0x87, 0x65, 0x43, 0x21 \ + } + +/* USER CODE BEGIN Generic_Parameters */ +/** + * SMPS supply + * SMPS not used when Set to 0 + * SMPS used when Set to 1 + */ +#define CFG_USE_SMPS 1 +/* USER CODE END Generic_Parameters */ + +/**< specific parameters */ +/*****************************************************/ +#define PUSH_BUTTON_SW1_EXTI_IRQHandler EXTI4_IRQHandler +#define PUSH_BUTTON_SW2_EXTI_IRQHandler EXTI0_IRQHandler +#define PUSH_BUTTON_SW3_EXTI_IRQHandler EXTI1_IRQHandler + +#define P2P_SERVER1 1 /*1 = Device is Peripherique*/ + +#define CFG_DEV_ID_P2P_SERVER1 (0x83) + +#define RADIO_ACTIVITY_EVENT 1 /* 1 for OOB Demo */ + +/** + * AD Element - Group B Feature + */ +/* LSB - First Byte */ +#define CFG_FEATURE_THREAD_SWITCH (0x40) + +/* LSB - Second Byte */ +#define CFG_FEATURE_OTA_REBOOT (0x20) + +#define CONN_L(x) ((int) ((x) / 0.625f)) +#define CONN_P(x) ((int) ((x) / 1.25f)) + +/* L2CAP Connection Update request parameters used for test only with smart Phone */ +#define L2CAP_REQUEST_NEW_CONN_PARAM 1 + +#define L2CAP_INTERVAL_MIN CONN_P(1000) /* 1s */ +#define L2CAP_INTERVAL_MAX CONN_P(1000) /* 1s */ +#define L2CAP_SLAVE_LATENCY 0x0000 +#define L2CAP_TIMEOUT_MULTIPLIER 0x1F4 + +/****************************************************************************** + * BLE Stack + ******************************************************************************/ +/** + * Maximum number of simultaneous connections that the device will support. + * Valid values are from 1 to 8 + */ +#define CFG_BLE_NUM_LINK 8 + +/** + * Maximum number of Services that can be stored in the GATT database. + * Note that the GAP and GATT services are automatically added so this parameter should be 2 plus the number of user services + */ +#define CFG_BLE_NUM_GATT_SERVICES 8 + +/** + * Maximum number of Attributes + * (i.e. the number of characteristic + the number of characteristic values + the number of descriptors, excluding the services) + * that can be stored in the GATT database. + * Note that certain characteristics and relative descriptors are added automatically during device initialization + * so this parameters should be 9 plus the number of user Attributes + */ +#define CFG_BLE_NUM_GATT_ATTRIBUTES 68 + +/** + * Maximum supported ATT_MTU size + */ +#define CFG_BLE_MAX_ATT_MTU (251) + +/** + * Size of the storage area for Attribute values + * This value depends on the number of attributes used by application. In particular the sum of the following quantities (in + * octets) should be made for each attribute: + * - attribute value length + * - 5, if UUID is 16 bit; 19, if UUID is 128 bit + * - 2, if server configuration descriptor is used + * - 2*DTM_NUM_LINK, if client configuration descriptor is used + * - 2, if extended properties is used + * The total amount of memory needed is the sum of the above quantities for each attribute. + */ +#define CFG_BLE_ATT_VALUE_ARRAY_SIZE (1344) + +/** + * Prepare Write List size in terms of number of packet with ATT_MTU=23 bytes + */ +#define CFG_BLE_PREPARE_WRITE_LIST_SIZE BLE_PREP_WRITE_X_ATT(CFG_BLE_MAX_ATT_MTU) + +/** + * Number of allocated memory blocks + */ +#define CFG_BLE_MBLOCK_COUNT (BLE_MBLOCKS_CALC(CFG_BLE_PREPARE_WRITE_LIST_SIZE, CFG_BLE_MAX_ATT_MTU, CFG_BLE_NUM_LINK)) + +/** + * Enable or disable the Extended Packet length feature. Valid values are 0 or 1. + */ +#define CFG_BLE_DATA_LENGTH_EXTENSION 1 + +/** + * Sleep clock accuracy in Slave mode (ppm value) + */ +#define CFG_BLE_SLAVE_SCA 500 + +/** + * Sleep clock accuracy in Master mode + * 0 : 251 ppm to 500 ppm + * 1 : 151 ppm to 250 ppm + * 2 : 101 ppm to 150 ppm + * 3 : 76 ppm to 100 ppm + * 4 : 51 ppm to 75 ppm + * 5 : 31 ppm to 50 ppm + * 6 : 21 ppm to 30 ppm + * 7 : 0 ppm to 20 ppm + */ +#define CFG_BLE_MASTER_SCA 0 + +/** + * Source for the 32 kHz slow speed clock + * 1 : internal RO + * 0 : external crystal ( no calibration ) + */ +#define CFG_BLE_LSE_SOURCE 0 + +/** + * Start up time of the high speed (16 or 32 MHz) crystal oscillator in units of 625/256 us (~2.44 us) + */ +#define CFG_BLE_HSE_STARTUP_TIME 0x148 + +/** + * Maximum duration of the connection event when the device is in Slave mode in units of 625/256 us (~2.44 us) + */ +#define CFG_BLE_MAX_CONN_EVENT_LENGTH (0xFFFFFFFF) + +/** + * Viterbi Mode + * 1 : enabled + * 0 : disabled + */ +#define CFG_BLE_VITERBI_MODE 1 + +/** + * BLE stack Options flags to be configured with: + * - SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY + * - SHCI_C2_BLE_INIT_OPTIONS_LL_HOST + * - SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC + * - SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC + * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO + * - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW + * - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1 + * - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3 + * which are used to set following configuration bits: + * (bit 0): 1: LL only + * 0: LL + host + * (bit 1): 1: no service change desc. + * 0: with service change desc. + * (bit 2): 1: device name Read-Only + * 0: device name R/W + * (bit 7): 1: LE Power Class 1 + * 0: LE Power Class 2-3 + * other bits: reserved (shall be set to 0) + */ +#define CFG_BLE_OPTIONS SHCI_C2_BLE_INIT_OPTIONS_LL_HOST + +#define CFG_BLE_MAX_COC_INITIATOR_NBR (32) + +#define CFG_BLE_MIN_TX_POWER (0) + +#define CFG_BLE_MAX_TX_POWER (0) +/****************************************************************************** + * Transport Layer + ******************************************************************************/ +/** + * Queue length of BLE Event + * This parameter defines the number of asynchronous events that can be stored in the HCI layer before + * being reported to the application. When a command is sent to the BLE core coprocessor, the HCI layer + * is waiting for the event with the Num_HCI_Command_Packets set to 1. The receive queue shall be large + * enough to store all asynchronous events received in between. + * When CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE is set to 27, this allow to store three 255 bytes long asynchronous events + * between the HCI command and its event. + * This parameter depends on the value given to CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE. When the queue size is to small, + * the system may hang if the queue is full with asynchronous events and the HCI layer is still waiting + * for a CC/CS event, In that case, the notification TL_BLE_HCI_ToNot() is called to indicate + * to the application a HCI command did not receive its command event within 30s (Default HCI Timeout). + */ +#define CFG_TLBLE_EVT_QUEUE_LENGTH 5 + +/** + * This parameter should be set to fit most events received by the HCI layer. It defines the buffer size of each element + * allocated in the queue of received events and can be used to optimize the amount of RAM allocated by the Memory Manager. + * It should not exceed 255 which is the maximum HCI packet payload size (a greater value is a lost of memory as it will + * never be used) + * It shall be at least 4 to receive the command status event in one frame. + * The default value is set to 27 to allow receiving an event of MTU size in a single buffer. This value maybe reduced + * further depending on the application. + * + */ +#define CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE 255 /**< Set to 255 with the memory manager and the mailbox */ + +#define TL_BLE_EVENT_FRAME_SIZE (TL_EVT_HDR_SIZE + CFG_TLBLE_MOST_EVENT_PAYLOAD_SIZE) + +/****************************************************************************** + * UART interfaces + ******************************************************************************/ +#define CFG_DEBUG_TRACE_UART hw_uart1 +#define CFG_CLI_UART hw_lpuart1 + +/****************************************************************************** + * USB interface + ******************************************************************************/ + +/** + * Enable/Disable USB interface + */ +#define CFG_USB_INTERFACE_ENABLE 0 + +/****************************************************************************** + * Low Power + * + * When CFG_FULL_LOW_POWER is set to 1, the system is configured in full + * low power mode. It means that all what can have an impact on the consumptions + * are powered down.(For instance LED, Access to Debugger, Etc.) + * + * When CFG_FULL_LOW_POWER is set to 0, the low power mode is not activated + * + ******************************************************************************/ + +#define CFG_FULL_LOW_POWER 0 + +#if (CFG_FULL_LOW_POWER == 1) +#undef CFG_LPM_SUPPORTED +#define CFG_LPM_SUPPORTED 1 +#endif /* CFG_FULL_LOW_POWER */ + +/* FOR DEBUGGING ONLY ! */ +//#define CFG_LPM_SUPPORTED 1 + +/****************************************************************************** + * Timer Server + ******************************************************************************/ +/** + * CFG_RTC_WUCKSEL_DIVIDER: This sets the RTCCLK divider to the wakeup timer. + * The higher is the value, the better is the power consumption and the accuracy of the timerserver + * The lower is the value, the finest is the granularity + * + * CFG_RTC_ASYNCH_PRESCALER: This sets the asynchronous prescaler of the RTC. It should as high as possible ( to output + * clock as low as possible) but the output clock should be equal or higher frequency compare to the clock feeding + * the wakeup timer. A lower clock speed would impact the accuracy of the timer server. + * + * CFG_RTC_SYNCH_PRESCALER: This sets the synchronous prescaler of the RTC. + * When the 1Hz calendar clock is required, it shall be sets according to other settings + * When the 1Hz calendar clock is not needed, CFG_RTC_SYNCH_PRESCALER should be set to 0x7FFF (MAX VALUE) + * + * CFG_RTCCLK_DIVIDER_CONF: + * Shall be set to either 0,2,4,8,16 + * When set to either 2,4,8,16, the 1Hhz calendar is supported + * When set to 0, the user sets its own configuration + * + * The following settings are computed with LSI as input to the RTC + */ +#define CFG_RTCCLK_DIVIDER_CONF 0 + +#if (CFG_RTCCLK_DIVIDER_CONF == 0) +/** + * Custom configuration + * It does not support 1Hz calendar + * It divides the RTC CLK by 16 + */ +#define CFG_RTCCLK_DIV (16) +#define CFG_RTC_WUCKSEL_DIVIDER (0) +#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1) +#define CFG_RTC_SYNCH_PRESCALER (0x7FFF) + +#else + +#if (CFG_RTCCLK_DIVIDER_CONF == 2) +/** + * It divides the RTC CLK by 2 + */ +#define CFG_RTC_WUCKSEL_DIVIDER (3) +#endif + +#if (CFG_RTCCLK_DIVIDER_CONF == 4) +/** + * It divides the RTC CLK by 4 + */ +#define CFG_RTC_WUCKSEL_DIVIDER (2) +#endif + +#if (CFG_RTCCLK_DIVIDER_CONF == 8) +/** + * It divides the RTC CLK by 8 + */ +#define CFG_RTC_WUCKSEL_DIVIDER (1) +#endif + +#if (CFG_RTCCLK_DIVIDER_CONF == 16) +/** + * It divides the RTC CLK by 16 + */ +#define CFG_RTC_WUCKSEL_DIVIDER (0) +#endif + +#define CFG_RTCCLK_DIV CFG_RTCCLK_DIVIDER_CONF +#define CFG_RTC_ASYNCH_PRESCALER (CFG_RTCCLK_DIV - 1) +#define CFG_RTC_SYNCH_PRESCALER (DIVR(LSE_VALUE, (CFG_RTC_ASYNCH_PRESCALER + 1)) - 1) + +#endif + +/** tick timer value in us */ +#define CFG_TS_TICK_VAL DIVR((CFG_RTCCLK_DIV * 1000000), LSE_VALUE) + +typedef enum +{ + CFG_TIM_PROC_ID_ISR, +} CFG_TimProcID_t; + +/****************************************************************************** + * Debug + ******************************************************************************/ +/** + * When set, this resets some hw resources to set the device in the same state than the power up + * The FW resets only register that may prevent the FW to run properly + * + * This shall be set to 0 in a final product + * + */ +#define CFG_HW_RESET_BY_FW 1 + +/** + * keep debugger enabled while in any low power mode when set to 1 + * should be set to 0 in production + */ +#define CFG_DEBUGGER_SUPPORTED 1 + +#if (CFG_FULL_LOW_POWER == 1) +#undef CFG_DEBUGGER_SUPPORTED +#define CFG_DEBUGGER_SUPPORTED 0 +#endif /* CFG_FULL_LOW_POWER */ + +/***************************************************************************** + * Traces + * Enable or Disable traces in application + * When CFG_DEBUG_TRACE is set, traces are activated + * + * Note : Refer to utilities_conf.h file in order to details + * the level of traces : CFG_DEBUG_TRACE_FULL or CFG_DEBUG_TRACE_LIGHT + *****************************************************************************/ + +/** + * When set to 1, the traces are enabled in the BLE services + */ +#define CFG_DEBUG_BLE_TRACE 1 + +/** + * Enable or Disable traces in application + */ +#define CFG_DEBUG_APP_TRACE 1 + +#if (CFG_DEBUG_APP_TRACE != 0) +#define APP_DBG_MSG PRINT_MESG_DBG +#else +#define APP_DBG_MSG PRINT_NO_MESG +#endif +#if ((CFG_DEBUG_BLE_TRACE != 0) || (CFG_DEBUG_APP_TRACE != 0)) +#define CFG_DEBUG_TRACE 1 +#endif + +#if (CFG_FULL_LOW_POWER == 1) +#undef CFG_DEBUG_TRACE +#define CFG_DEBUG_TRACE 0 +#endif /* CFG_FULL_LOW_POWER */ + +/** + * When CFG_DEBUG_TRACE_FULL is set to 1, the trace are output with the API name, the file name and the line number + * When CFG_DEBUG_TRACE_LIGHT is set to 1, only the debug message is output + * + * When both are set to 0, no trace are output + * When both are set to 1, CFG_DEBUG_TRACE_FULL is selected + */ +#define CFG_DEBUG_TRACE_LIGHT 1 +#define CFG_DEBUG_TRACE_FULL 0 + +#if ((CFG_DEBUG_TRACE != 0) && (CFG_DEBUG_TRACE_LIGHT == 0) && (CFG_DEBUG_TRACE_FULL == 0)) +#undef CFG_DEBUG_TRACE_FULL +#undef CFG_DEBUG_TRACE_LIGHT +#define CFG_DEBUG_TRACE_FULL 0 +#define CFG_DEBUG_TRACE_LIGHT 1 +#endif + +#if (CFG_DEBUG_TRACE == 0) +#undef CFG_DEBUG_TRACE_FULL +#undef CFG_DEBUG_TRACE_LIGHT +#define CFG_DEBUG_TRACE_FULL 0 +#define CFG_DEBUG_TRACE_LIGHT 0 +#endif + +/** + * When not set, the traces is looping on sending the trace over UART + */ +#define DBG_TRACE_USE_CIRCULAR_QUEUE 1 + +/** + * max buffer Size to queue data traces and max data trace allowed. + * Only Used if DBG_TRACE_USE_CIRCULAR_QUEUE is defined + */ +#define DBG_TRACE_MSG_QUEUE_SIZE (1024 * 5) +#define MAX_DBG_TRACE_MSG_SIZE 1024 + +/****************************************************************************** + * Configure Log level for Application + ******************************************************************************/ +#define APPLI_CONFIG_LOG_LEVEL LOG_LEVEL_INFO +#define APPLI_PRINT_FILE_FUNC_LINE 0 + +/* USER CODE BEGIN Defines */ +/****************************************************************************** + * User interaction + * When CFG_LED_SUPPORTED is set, LEDS are activated if requested + * When CFG_BUTTON_SUPPORTED is set, the push button are activated if requested + ******************************************************************************/ +#if (CFG_FULL_LOW_POWER == 1) +#define CFG_LED_SUPPORTED 0 +#define CFG_BUTTON_SUPPORTED 0 +#else +#define CFG_LED_SUPPORTED 1 +#define CFG_BUTTON_SUPPORTED 1 +#endif /* CFG_FULL_LOW_POWER */ +/* USER CODE END Defines */ + +/****************************************************************************** + * LOW POWER + ******************************************************************************/ +/** + * Supported requester to the MCU Low Power Manager - can be increased up to 32 + * It lists a bit mapping of all user of the Low Power Manager + */ +typedef enum +{ + CFG_LPM_APP, + CFG_LPM_APP_BLE, + CFG_LPM_APP_THREAD + /* USER CODE BEGIN CFG_LPM_Id_t */ + + /* USER CODE END CFG_LPM_Id_t */ +} CFG_LPM_Id_t; + +/****************************************************************************** + * OTP manager + ******************************************************************************/ +#define CFG_OTP_BASE_ADDRESS OTP_AREA_BASE + +#define CFG_OTP_END_ADDRESS OTP_AREA_END_ADDR + +typedef enum +{ + BUTTON_1 = 0x1, +} button_type_t; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* APP_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_entry.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_entry.h new file mode 100644 index 00000000000000..9d0378c18792c1 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/app_entry.h @@ -0,0 +1,57 @@ + +/** + ****************************************************************************** + * @file app_entry.h + * @author MCD Application Team + * @brief Interface to the application + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __APP_ENTRY_H +#define __APP_ENTRY_H + +#include "stm32wbxx_hal.h" +#include "tl.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* External variables --------------------------------------------------------*/ +typedef struct +{ + uint8_t Pushed_Button; + uint8_t State; // 1 pushed +} Push_Button_st; + +typedef void (*PushButtonCallback)(Push_Button_st * aMessage); + +/* Exported macros -----------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ +void APPE_Init(void); +void APP_ENTRY_RegisterCmdBuffer(TL_CmdPacket_t * p_buffer); +void APP_ENTRY_ProcessMsgM0ToM4(void); +void APP_ENTRY_Init_CFG_CLI_UART(void); +void APP_ENTRY_TL_THREAD_INIT(void); +void APP_ENTRY_PBSetReceiveCallback(PushButtonCallback aCallback); +void APP_ENTRY_LedBlink(uint8_t LedStatus); + +#ifdef __cplusplus +} +#endif + +#endif /* __APP_ENTRY_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_driver.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_driver.h new file mode 100644 index 00000000000000..24f4cfc6253572 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_driver.h @@ -0,0 +1,181 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file flash_driver.h + * @author MCD Application Team + * @brief Dual core Flash driver interface + ****************************************************************************** + * @attention + * + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef FLASH_DRIVER_H +#define FLASH_DRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +typedef enum +{ + SINGLE_FLASH_OPERATION_DONE, + SINGLE_FLASH_OPERATION_NOT_EXECUTED, +} SingleFlashOperationStatus_t; + +typedef enum +{ + WAITED_SEM_BUSY, + WAITED_SEM_FREE, +} WaitedSemStatus_t; + +typedef enum +{ + WAIT_FOR_SEM_BLOCK_FLASH_REQ_BY_CPU1, + WAIT_FOR_SEM_BLOCK_FLASH_REQ_BY_CPU2, +} WaitedSemId_t; + +typedef enum +{ + ReadyToWrite, + NotReadyToWrite, + +} StatusReadyToWrite; +/* Exported functions ------------------------------------------------------- */ + +/** + * @brief Implements the Dual core algorithm to erase multiple sectors in flash with CPU1 + * It calls for each sector to be erased the API FD_EraseSingleSector() + * + * @param FirstSector: The first sector to be erased + * This parameter must be a value between 0 and (SFSA - 1) + * @param NbrOfSectors: The number of sectors to erase + * This parameter must be a value between 1 and (SFSA - FirstSector) + * @retval Number of sectors not erased: + * Depending on the implementation of FD_WaitForSemAvailable(), + * it may still have some sectors not erased when the timing protection has been + * enabled by either CPU1 or CPU2. When the value returned is not 0, the application + * should wait until both timing protection before retrying to erase the last missing sectors. + * + * In addition, When the returned value is not 0: + * - The Sem2 is NOT released + * - The FLASH is NOT locked + * - SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_OFF) is NOT called + * It is expected that the user will call one more time this function to finish the process + */ +uint32_t FD_EraseSectors(uint32_t FirstSector, uint32_t NbrOfSectors); + +/** + * @brief Implements the Dual core algorithm to write multiple 64bits data in flash with CPU1 + * The user shall first make sure the location to be written has been first erase. + * Otherwise, the API will loop for ever as it will be not able to write in flash + * The only value that can be written even though the destination is not erased is 0. + * It calls for each 64bits to be written the API FD_WriteSingleData() + * + * @param DestAddress: Address of the flash to write the first data. It shall be 64bits aligned + * @param pSrcBuffer: Address of the buffer holding the 64bits data to be written in flash + * @param NbrOfData: Number of 64bits data to be written + * @retval Number of 64bits data not written: + * Depending on the implementation of FD_WaitForSemAvailable(), + * it may still have 64bits data not written when the timing protection has been + * enabled by either CPU1 or CPU2. When the value returned is not 0, the application + * should wait until both timing protection before retrying to write the last missing 64bits data. + * + * In addition, When the returned value is not 0: + * - The Sem2 is NOT released + * - The FLASH is NOT locked + * It is expected that the user will call one more time this function to finish the process + */ +uint32_t FD_WriteData(uint32_t DestAddress, uint64_t * pSrcBuffer, uint32_t NbrOfData); + +/** + * @brief Implements the Dual core algorithm to erase one sector in flash with CPU1 + * + * It expects the following point before calling this API: + * - The Sem2 is taken + * - The FLASH is unlocked + * - SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_ON) has been called + * It expects the following point to be done when no more sectors need to be erased + * - The Sem2 is released + * - The FLASH is locked + * - SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_OFF) is called + * + * The two point above are implemented in FD_EraseSectors() + * This API needs to be used instead of FD_EraseSectors() in case a provided library is taking + * care of these two points and request only a single operation. + * + * @param FirstSector: The sector to be erased + * This parameter must be a value between 0 and (SFSA - 1) + * @retval: SINGLE_FLASH_OPERATION_DONE -> The data has been written + * SINGLE_FLASH_OPERATION_NOT_EXECUTED -> The data has not been written due to timing protection + * from either CPU1 or CPU2. On a failure status, the user should check + * both timing protection before retrying. + */ +SingleFlashOperationStatus_t FD_EraseSingleSector(uint32_t SectorNumber); + +/** + * @brief Implements the Dual core algorithm to write one 64bits data in flash with CPU1 + * The user shall first make sure the location to be written has been first erase. + * Otherwise, the API will loop for ever as it will be not able to write in flash + * The only value that can be written even though the destination is not erased is 0. + * + * It expects the following point before calling this API: + * - The Sem2 is taken + * - The FLASH is unlocked + * It expects the following point to be done when no more sectors need to be erased + * - The Sem2 is released + * - The FLASH is locked + * + * The two point above are implemented in FD_WriteData() + * This API needs to be used instead of FD_WriteData() in case a provided library is taking + * care of these two points and request only a single operation. + * + * @param DestAddress: Address of the flash to write the data. It shall be 64bits aligned + * @param Data: 64bits Data to be written + * @retval: SINGLE_FLASH_OPERATION_DONE -> The data has been written + * SINGLE_FLASH_OPERATION_NOT_EXECUTED -> The data has not been written due to timing protection + * from either CPU1 or CPU2. On a failure status, the user should check + * both timing protection before retrying. + */ +SingleFlashOperationStatus_t FD_WriteSingleData(uint32_t DestAddress, uint64_t Data); + +/** + * By default, this function is implemented weakly in flash_driver.c to return WAITED_SEM_BUSY. + * When the semaphore is busy, this will result in either FD_WriteSingleData() or FD_EraseSingleSector() + * to loop until the semaphore is free. + * + * This function may be implemented so that when using either an OS or the UTIL_SEQ_WaitEvt() API from the sequencer, + * it could possible to run other tasks or enter idle mode until the waited semaphore is free. + * This function shall not take the waited semaphore but just return when it is free. + * + * @param WaitedSemId: The semaphore ID this function should not return until it is free + * @retval: WAITED_SEM_BUSY -> The function returned before waiting for the semaphore to be free. This will exit the loop + * from either FD_EraseSingleSector() or FD_WriteSingleData() and the number of actions left to + * be processed are reported to the user + * WAITED_SEM_FREE -> The semaphore has been checked as free. Both FD_EraseSingleSector() and FD_WriteSingleData() + * try again to process one more time the flash. + */ +WaitedSemStatus_t FD_WaitForSemAvailable(WaitedSemId_t WaitedSemId); + +#ifdef __cplusplus +} +#endif + +#endif /*FLASH_DRIVER_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_wb.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_wb.h new file mode 100644 index 00000000000000..5a866b3edf7fbe --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/flash_wb.h @@ -0,0 +1,116 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file flash_wb.h + * @author MCD Application Team + * @brief Header file for flash_wb.c + ****************************************************************************** + * @attention + * + * Copyright (c) 2023 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef FLASH_NVM_H +#define FLASH_NVM_H + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum +{ + NVM_OK, + NVM_KEY_NOT_FOUND, + NVM_WRITE_FAILED, + NVM_READ_FAILED, + NVM_DELETE_FAILED, + NVM_SIZE_FULL, + NVM_BLOCK_SIZE_OVERFLOW, + NVM_ERROR_BLOCK_ALIGN, + NVM_FLASH_CORRUPTION, + NVM_BUFFER_TOO_SMALL +} NVM_StatusTypeDef; + +typedef enum +{ + SECTOR_DEFAULT = 0, + SECTOR_NO_SECURE, + SECTOR_SECURE + +} NVM_Sector; + +/* Exported functions ------------------------------------------------------- */ + +/** + * @brief Copy Flash to RAM NVM + */ + +void NM_Init(void); + +/** + * @brief Copy RAM NVM to Flash + */ +NVM_StatusTypeDef NM_Dump(void); + +/** + * @brief check the nvm if it s corrupted or not + * @retval return NVM_OK if nvm is empty or NVM_FLASH_CORRUPTION if it s not empty + */ +NVM_StatusTypeDef NM_Check_Validity(void); + +/** + * @brief Get KeyName in RAM NVM and return the value of Key in KeyValue + * + * @param KeyValue: Address of the buffer changed in this function if the key found + * @param KeyName: Name of Key needed + * @param KeySize: size of KeyValue + * @param read_by_size: return size of KeyValue found + * @retval return state of function + */ +NVM_StatusTypeDef NM_GetKeyValue(void * KeyValue, const char * KeyName, uint32_t KeySize, size_t * read_by_size, NVM_Sector sector); + +/** + * @brief Set KeyName and value in RAM NVM + * + * @param KeyValue: Address of the buffer + * @param KeyName: Name of Key needed + * @param KeyAddr: TODO DELETED this param + * @param KeySize: size of KeyValue + * @param read_by_size: return size of KeyValue found + * @retval return state of function + */ + +NVM_StatusTypeDef NM_SetKeyValue(char * KeyValue, char * KeyName, uint32_t KeySize, NVM_Sector sector); + +/** + * @brief Delete Key in RAM NVM + * @param KeyName: Name of Key needed + * @retval return state of function + */ + +NVM_StatusTypeDef NM_DeleteKey(const char * Keyname, NVM_Sector sector); + +/** + * @brief Erase all persistent and reboot program + */ + +void NM_ResetFactory(void); +void NM_FullErase(void); + +#ifdef __cplusplus +} +#endif + +#endif /*FLASH_NVM_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_conf.h new file mode 100644 index 00000000000000..109084d298637f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_conf.h @@ -0,0 +1,255 @@ +/** + ****************************************************************************** + * @file hw_conf.h + * @author MCD Application Team + * @brief Configuration of hardware interface + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __HW_CONF_H +#define __HW_CONF_H + +/****************************************************************************** + * Semaphores + * THIS SHALL NO BE CHANGED AS THESE SEMAPHORES ARE USED AS WELL ON THE CM0+ + *****************************************************************************/ +/** + * Index of the semaphore used by CPU2 to prevent the CPU1 to either write or erase data in flash + * The CPU1 shall not either write or erase in flash when this semaphore is taken by the CPU2 + * When the CPU1 needs to either write or erase in flash, it shall first get the semaphore and release it just + * after writing a raw (64bits data) or erasing one sector. + * On v1.4.0 and older CPU2 wireless firmware, this semaphore is unused and CPU2 is using PES bit. + * By default, CPU2 is using the PES bit to protect its timing. The CPU1 may request the CPU2 to use the semaphore + * instead of the PES bit by sending the system command SHCI_C2_SetFlashActivityControl() + */ +#define CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID 7 + +/** + * Index of the semaphore used by CPU1 to prevent the CPU2 to either write or erase data in flash + * In order to protect its timing, the CPU1 may get this semaphore to prevent the CPU2 to either + * write or erase in flash (as this will stall both CPUs) + * The PES bit shall not be used as this may stall the CPU2 in some cases. + */ +#define CFG_HW_BLOCK_FLASH_REQ_BY_CPU1_SEMID 6 + +/** + * Index of the semaphore used to manage the CLK48 clock configuration + * When the USB is required, this semaphore shall be taken before configuring te CLK48 for USB + * and should be released after the application switch OFF the clock when the USB is not used anymore + * When using the RNG, it is good enough to use CFG_HW_RNG_SEMID to control CLK48. + * More details in AN5289 + */ +#define CFG_HW_CLK48_CONFIG_SEMID 5 + +/* Index of the semaphore used to manage the entry Stop Mode procedure */ +#define CFG_HW_ENTRY_STOP_MODE_SEMID 4 + +/* Index of the semaphore used to access the RCC */ +#define CFG_HW_RCC_SEMID 3 + +/* Index of the semaphore used to access the FLASH */ +#define CFG_HW_FLASH_SEMID 2 + +/* Index of the semaphore used to access the PKA */ +#define CFG_HW_PKA_SEMID 1 + +/* Index of the semaphore used to access the RNG */ +#define CFG_HW_RNG_SEMID 0 + +/****************************************************************************** + * HW TIMER SERVER + *****************************************************************************/ +/** + * The user may define the maximum number of virtual timers supported. + * It shall not exceed 255 + */ +#define CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER 6 + +/** + * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the + * wakeup timer. + * This setting is the preemptpriority part of the NVIC. + */ +#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO 3 + +/** + * The user may define the priority in the NVIC of the RTC_WKUP interrupt handler that is used to manage the + * wakeup timer. + * This setting is the subpriority part of the NVIC. It does not exist on all processors. When it is not supported + * on the CPU, the setting is ignored + */ +#define CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO 0 + +/** + * Define a critical section in the Timer server + * The Timer server does not support the API to be nested + * The Application shall either: + * a) Ensure this will never happen + * b) Define the critical section + * The default implementations is masking all interrupts using the PRIMASK bit + * The TimerServer driver uses critical sections to avoid context corruption. This is achieved with the macro + * TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION. When CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION is set + * to 1, all STM32 interrupts are masked with the PRIMASK bit of the CortexM CPU. It is possible to use the BASEPRI + * register of the CortexM CPU to keep allowed some interrupts with high priority. In that case, the user shall + * re-implement TIMER_ENTER_CRITICAL_SECTION and TIMER_EXIT_CRITICAL_SECTION and shall make sure that no TimerServer + * API are called when the TIMER critical section is entered + */ +#define CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION 1 + +/** + * This value shall reflect the maximum delay there could be in the application between the time the RTC interrupt + * is generated by the Hardware and the time when the RTC interrupt handler is called. This time is measured in + * number of RTCCLK ticks. + * A relaxed timing would be 10ms + * When the value is too short, the timerserver will not be able to count properly and all timeout may be random. + * When the value is too long, the device may wake up more often than the most optimal configuration. However, the + * impact on power consumption would be marginal (unless the value selected is extremely too long). It is strongly + * recommended to select a value large enough to make sure it is not too short to ensure reliability of the system + * as this will have marginal impact on low power mode + */ +#define CFG_HW_TS_RTC_HANDLER_MAX_DELAY (10 * (LSI_VALUE / 1000)) + +/** + * Interrupt ID in the NVIC of the RTC Wakeup interrupt handler + * It shall be type of IRQn_Type + */ +#define CFG_HW_TS_RTC_WAKEUP_HANDLER_ID RTC_WKUP_IRQn + +/****************************************************************************** + * HW UART + *****************************************************************************/ +/* For release: set to 1 CFG_HW_LPUART1_ENABLED and CFG_HW_LPUART1_DMA_TX_SUPPORTED */ +#define CFG_HW_LPUART1_ENABLED 1 +#define CFG_HW_LPUART1_DMA_TX_SUPPORTED 1 + +#define CFG_HW_USART1_ENABLED 1 +#define CFG_HW_USART1_DMA_TX_SUPPORTED 1 + +/** + * LPUART1 + */ +#define CFG_HW_LPUART1_PREEMPTPRIORITY 0x0F +#define CFG_HW_LPUART1_SUBPRIORITY 0 + +/** < The application shall check the selected source clock is enable */ +#define CFG_HW_LPUART1_SOURCE_CLOCK RCC_LPUART1CLKSOURCE_SYSCLK + +#define CFG_HW_LPUART1_BAUDRATE 115200 +#define CFG_HW_LPUART1_WORDLENGTH UART_WORDLENGTH_8B +#define CFG_HW_LPUART1_STOPBITS UART_STOPBITS_1 +#define CFG_HW_LPUART1_PARITY UART_PARITY_NONE +#define CFG_HW_LPUART1_HWFLOWCTL UART_HWCONTROL_NONE +#define CFG_HW_LPUART1_MODE UART_MODE_TX_RX +#define CFG_HW_LPUART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT +#define CFG_HW_LPUART1_OVERSAMPLING UART_OVERSAMPLING_8 + +#define CFG_HW_LPUART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define CFG_HW_LPUART1_TX_PORT GPIOA +#define CFG_HW_LPUART1_TX_PIN GPIO_PIN_2 +#define CFG_HW_LPUART1_TX_MODE GPIO_MODE_AF_PP +#define CFG_HW_LPUART1_TX_PULL GPIO_NOPULL +#define CFG_HW_LPUART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_LPUART1_TX_ALTERNATE GPIO_AF8_LPUART1 + +#define CFG_HW_LPUART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define CFG_HW_LPUART1_RX_PORT GPIOA +#define CFG_HW_LPUART1_RX_PIN GPIO_PIN_3 +#define CFG_HW_LPUART1_RX_MODE GPIO_MODE_AF_PP +#define CFG_HW_LPUART1_RX_PULL GPIO_NOPULL +#define CFG_HW_LPUART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_LPUART1_RX_ALTERNATE GPIO_AF8_LPUART1 + +#define CFG_HW_LPUART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define CFG_HW_LPUART1_CTS_PORT GPIOA +#define CFG_HW_LPUART1_CTS_PIN GPIO_PIN_6 +#define CFG_HW_LPUART1_CTS_MODE GPIO_MODE_AF_PP +#define CFG_HW_LPUART1_CTS_PULL GPIO_PULLDOWN +#define CFG_HW_LPUART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_LPUART1_CTS_ALTERNATE GPIO_AF8_LPUART1 + +#define CFG_HW_LPUART1_DMA_TX_PREEMPTPRIORITY 0x0F +#define CFG_HW_LPUART1_DMA_TX_SUBPRIORITY 0 + +#define CFG_HW_LPUART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE +#define CFG_HW_LPUART1_DMA_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE +#define CFG_HW_LPUART1_TX_DMA_REQ DMA_REQUEST_LPUART1_TX +#define CFG_HW_LPUART1_TX_DMA_CHANNEL DMA1_Channel4 +#define CFG_HW_LPUART1_TX_DMA_IRQn DMA1_Channel4_IRQn +#define CFG_HW_LPUART1_DMA_TX_IRQHandler DMA1_Channel4_IRQHandler + +/** + * UART1 + */ +#define CFG_HW_USART1_PREEMPTPRIORITY 0x0F +#define CFG_HW_USART1_SUBPRIORITY 0 + +/** < The application shall check the selected source clock is enable */ +#define CFG_HW_USART1_SOURCE_CLOCK RCC_USART1CLKSOURCE_SYSCLK + +#define CFG_HW_USART1_BAUDRATE 115200 +#define CFG_HW_USART1_WORDLENGTH UART_WORDLENGTH_8B +#define CFG_HW_USART1_STOPBITS UART_STOPBITS_1 +#define CFG_HW_USART1_PARITY UART_PARITY_NONE +#define CFG_HW_USART1_HWFLOWCTL UART_HWCONTROL_NONE +#define CFG_HW_USART1_MODE UART_MODE_TX_RX +#define CFG_HW_USART1_ADVFEATUREINIT UART_ADVFEATURE_NO_INIT +#define CFG_HW_USART1_OVERSAMPLING UART_OVERSAMPLING_8 + +#define CFG_HW_USART1_TX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE +#define CFG_HW_USART1_TX_PORT GPIOB +#define CFG_HW_USART1_TX_PIN GPIO_PIN_6 +#define CFG_HW_USART1_TX_MODE GPIO_MODE_AF_PP +#define CFG_HW_USART1_TX_PULL GPIO_NOPULL +#define CFG_HW_USART1_TX_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_USART1_TX_ALTERNATE GPIO_AF7_USART1 + +#define CFG_HW_USART1_RX_PORT_CLK_ENABLE __HAL_RCC_GPIOB_CLK_ENABLE +#define CFG_HW_USART1_RX_PORT GPIOB +#define CFG_HW_USART1_RX_PIN GPIO_PIN_7 +#define CFG_HW_USART1_RX_MODE GPIO_MODE_AF_PP +#define CFG_HW_USART1_RX_PULL GPIO_NOPULL +#define CFG_HW_USART1_RX_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_USART1_RX_ALTERNATE GPIO_AF7_USART1 + +#define CFG_HW_USART1_CTS_PORT_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE +#define CFG_HW_USART1_CTS_PORT GPIOA +#define CFG_HW_USART1_CTS_PIN GPIO_PIN_11 +#define CFG_HW_USART1_CTS_MODE GPIO_MODE_AF_PP +#define CFG_HW_USART1_CTS_PULL GPIO_PULLDOWN +#define CFG_HW_USART1_CTS_SPEED GPIO_SPEED_FREQ_VERY_HIGH +#define CFG_HW_USART1_CTS_ALTERNATE GPIO_AF7_USART1 + +#define CFG_HW_USART1_DMA_TX_PREEMPTPRIORITY 0x0F +#define CFG_HW_USART1_DMA_TX_SUBPRIORITY 0 + +#define CFG_HW_USART1_DMAMUX_CLK_ENABLE __HAL_RCC_DMAMUX1_CLK_ENABLE +#define CFG_HW_USART1_DMA_CLK_ENABLE __HAL_RCC_DMA2_CLK_ENABLE +#define CFG_HW_USART1_TX_DMA_REQ DMA_REQUEST_USART1_TX +#define CFG_HW_USART1_TX_DMA_CHANNEL DMA2_Channel4 +#define CFG_HW_USART1_TX_DMA_IRQn DMA2_Channel4_IRQn +#define CFG_HW_USART1_DMA_TX_IRQHandler DMA2_Channel4_IRQHandler + +/****************************************************************************** + * External PA + *****************************************************************************/ +#define CFG_HW_EXTPA_ENABLED 0 + +// External PA enable pin is chosen by user +#define GPIO_EXT_PA_EN_PIN GPIO_PIN_9 +#define GPIO_EXT_PA_EN_PORT GPIOB + +// External PA TX/RX pin is fixed by the chip +#define GPIO_EXT_PA_TX_PIN GPIO_PIN_0 +#define GPIO_EXT_PA_TX_PORT GPIOB +#endif /*__HW_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_if.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_if.h new file mode 100644 index 00000000000000..b2a79590e9238a --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/hw_if.h @@ -0,0 +1,251 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file hw_if.h + * @author MCD Application Team + * @brief Hardware Interface + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef HW_IF_H +#define HW_IF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx.h" +#include "stm32wbxx_ll_bus.h" +#include "stm32wbxx_ll_cortex.h" +#include "stm32wbxx_ll_exti.h" +#include "stm32wbxx_ll_gpio.h" +#include "stm32wbxx_ll_hsem.h" +#include "stm32wbxx_ll_ipcc.h" +#include "stm32wbxx_ll_pwr.h" +#include "stm32wbxx_ll_rcc.h" +#include "stm32wbxx_ll_rtc.h" +#include "stm32wbxx_ll_system.h" +#include "stm32wbxx_ll_utils.h" + +#ifdef USE_STM32WBXX_USB_DONGLE +#include "stm32wbxx_usb_dongle.h" +#endif +#ifdef USE_STM32WBXX_NUCLEO +#include "stm32wbxx_nucleo.h" +#endif +#ifdef USE_X_NUCLEO_EPD +#include "x_nucleo_epd.h" +#endif +#ifdef USE_STM32WB5M_DK +#include "stm32wb5mm_dk.h" +#endif + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/****************************************************************************** + * HW UART + ******************************************************************************/ +typedef enum +{ + hw_uart1, + hw_uart2, + hw_lpuart1, +} hw_uart_id_t; + +typedef enum +{ + hw_uart_ok, + hw_uart_error, + hw_uart_busy, + hw_uart_to, +} hw_status_t; + +void HW_UART_Init(hw_uart_id_t hw_uart_id); +void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t * pData, uint16_t Size, void (*Callback)(void)); +void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t * pData, uint16_t Size, void (*Callback)(void)); +hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, uint32_t timeout); +hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, void (*Callback)(void)); +void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id); +void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id); + +/****************************************************************************** + * HW TimerServer + ******************************************************************************/ +/* Exported types ------------------------------------------------------------*/ +/** + * This setting is used when standby mode is supported. + * hw_ts_InitMode_Limited should be used when the device restarts from Standby Mode. In that case, the Timer Server does + * not re-initialized its context. Only the Hardware register which content has been lost is reconfigured + * Otherwise, hw_ts_InitMode_Full should be requested (Start from Power ON) and everything is re-initialized. + */ +typedef enum +{ + hw_ts_InitMode_Full, + hw_ts_InitMode_Limited, +} HW_TS_InitMode_t; + +/** + * When a Timer is created as a SingleShot timer, it is not automatically restarted when the timeout occurs. However, + * the timer is kept reserved in the list and could be restarted at anytime with HW_TS_Start() + * + * When a Timer is created as a Repeated timer, it is automatically restarted when the timeout occurs. + */ +typedef enum +{ + hw_ts_SingleShot, + hw_ts_Repeated +} HW_TS_Mode_t; + +/** + * hw_ts_Successful is returned when a Timer has been successfully created with HW_TS_Create(). Otherwise, hw_ts_Failed + * is returned. When hw_ts_Failed is returned, that means there are not enough free slots in the list to create a + * Timer. In that case, CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER should be increased + */ +typedef enum +{ + hw_ts_Successful, + hw_ts_Failed, +} HW_TS_ReturnStatus_t; + +typedef void (*HW_TS_pTimerCb_t)(void); + +/** + * @brief Initialize the timer server + * This API shall be called by the application before any timer is requested to the timer server. It + * configures the RTC module to be connected to the LSI input clock. + * + * @param TimerInitMode: When the device restarts from Standby, it should request hw_ts_InitMode_Limited so that the + * Timer context is not re-initialized. Otherwise, hw_ts_InitMode_Full should be requested + * @param hrtc: RTC Handle + * @retval None + */ +void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef * hrtc); + +/** + * @brief Interface to create a virtual timer + * The user shall call this API to create a timer. Once created, the timer is reserved to the module until it + * has been deleted. When creating a timer, the user shall specify the mode (single shot or repeated), the + * callback to be notified when the timer expires and a module ID to identify in the timer interrupt handler + * which module is concerned. In return, the user gets a timer ID to handle it. + * + * @param TimerProcessID: This is an identifier provided by the user and returned in the callback to allow + * identification of the requester + * @param pTimerId: Timer Id returned to the user to request operation (start, stop, delete) + * @param TimerMode: Mode of the virtual timer (Single shot or repeated) + * @param pTimerCallBack: Callback when the virtual timer expires + * @retval HW_TS_ReturnStatus_t: Return whether the creation is successful or not + */ +HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t * pTimerId, HW_TS_Mode_t TimerMode, + HW_TS_pTimerCb_t pTimerCallBack); + +/** + * @brief Stop a virtual timer + * This API may be used to stop a running timer. A timer which is stopped is move to the pending state. + * A pending timer may be restarted at any time with a different timeout value but the mode cannot be changed. + * Nothing is done when it is called to stop a timer which has been already stopped + * + * @param TimerID: Id of the timer to stop + * @retval None + */ +void HW_TS_Stop(uint8_t TimerID); + +/** + * @brief Start a virtual timer + * This API shall be used to start a timer. The timeout value is specified and may be different each time. + * When the timer is in the single shot mode, it will move to the pending state when it expires. The user may + * restart it at any time with a different timeout value. When the timer is in the repeated mode, it always + * stay in the running state. When the timer expires, it will be restarted with the same timeout value. + * This API shall not be called on a running timer. + * + * @param TimerID: The ID Id of the timer to start + * @param timeout_ticks: Number of ticks of the virtual timer (Maximum value is (0xFFFFFFFF-0xFFFF = 0xFFFF0000) + * @retval None + */ +void HW_TS_Start(uint8_t TimerID, uint32_t timeout_ticks); + +/** + * @brief Delete a virtual timer from the list + * This API should be used when a timer is not needed anymore by the user. A deleted timer is removed from + * the timer list managed by the timer server. It cannot be restarted again. The user has to go with the + * creation of a new timer if required and may get a different timer id + * + * @param TimerID: The ID of the timer to remove from the list + * @retval None + */ +void HW_TS_Delete(uint8_t TimerID); + +/** + * @brief Schedule the timer list on the timer interrupt handler + * This interrupt handler shall be called by the application in the RTC interrupt handler. This handler takes + * care of clearing all status flag required in the RTC and EXTI peripherals + * + * @param None + * @retval None + */ +void HW_TS_RTC_Wakeup_Handler(void); + +/** + * @brief Return the number of ticks to count before the interrupt + * This API returns the number of ticks left to be counted before an interrupt is generated by the + * Timer Server. This API may be used by the application for power management optimization. When the system + * enters low power mode, the mode selection is a tradeoff between the wakeup time where the CPU is running + * and the time while the CPU will be kept in low power mode before next wakeup. The deeper is the + * low power mode used, the longer is the wakeup time. The low power mode management considering wakeup time + * versus time in low power mode is implementation specific + * When the timer is disabled (No timer in the list), it returns 0xFFFF + * + * @param None + * @retval The number of ticks left to count + */ +uint16_t HW_TS_RTC_ReadLeftTicksToCount(void); + +/** + * @brief Notify the application that a registered timer has expired + * This API shall be implemented by the user application. + * This API notifies the application that a timer expires. This API is running in the RTC Wakeup interrupt + * context. The application may implement an Operating System to change the context priority where the timer + * callback may be handled. This API provides the module ID to identify which module is concerned and to allow + * sending the information to the correct task + * + * @param TimerProcessID: The TimerProcessId associated with the timer when it has been created + * @param TimerID: The TimerID of the expired timer + * @param pTimerCallBack: The Callback associated with the timer when it has been created + * @retval None + */ +void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack); + +/** + * @brief Notify the application that the wakeupcounter has been updated + * This API should be implemented by the user application + * This API notifies the application that the counter has been updated. This is expected to be used along + * with the HW_TS_RTC_ReadLeftTicksToCount () API. It could be that the counter has been updated since the + * last call of HW_TS_RTC_ReadLeftTicksToCount () and before entering low power mode. This notification + * provides a way to the application to solve that race condition to reevaluate the counter value before + * entering low power mode + * + * @param None + * @retval None + */ +void HW_TS_RTC_CountUpdated_AppNot(void); + +#ifdef __cplusplus +} +#endif + +#endif /*HW_IF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/main.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/main.h new file mode 100644 index 00000000000000..6ea2f076e6a8ae --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/main.h @@ -0,0 +1,65 @@ +/** + ****************************************************************************** + * @file main.h + * @author MCD Application Team + * @brief Header for main.c module + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __MAIN_H +#define __MAIN_H + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +#ifdef USE_STM32WBXX_USB_DONGLE +#include "stm32wbxx_usb_dongle.h" +#endif +#ifdef USE_STM32WBXX_NUCLEO +#include "stm32wbxx_nucleo.h" +#endif +#ifdef USE_X_NUCLEO_EPD +#include "x_nucleo_epd.h" +#endif +#ifdef USE_STM32WB5M_DK +#include "./../../../../../Drivers/BSP/STM32WB5MM-DK/stm32wb5mm_dk.h" + +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Exported variables --------------------------------------------------------*/ +extern RTC_HandleTypeDef hrtc; /**< RTC handler declaration */ +extern RNG_HandleTypeDef hrng; + +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void Error_Handler(void); + +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +/* Private defines -----------------------------------------------------------*/ +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +#endif /* __MAIN_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/otp.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/otp.h new file mode 100644 index 00000000000000..d6b24d42b93bc1 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/otp.h @@ -0,0 +1,63 @@ +/** + ****************************************************************************** + * @file otp.h + * @author MCD Application Team + * @brief OTP manager interface + ****************************************************************************** + * @attention + * + * Copyright (c) 2018-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __OTP_H +#define __OTP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "utilities_common.h" + +/* Exported types ------------------------------------------------------------*/ +typedef PACKED_STRUCT +{ + uint8_t bd_address[6]; + uint8_t hse_tuning; + uint8_t id; +} +OTP_ID0_t; + +/* Exported constants --------------------------------------------------------*/ +/* External variables --------------------------------------------------------*/ +/* Exported macros -----------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ + +/** + * @brief This API return the address (64 bits aligned) of the ID parameter in the OTP + * It returns the first ID declaration found from the higher address down to the base address + * The user shall fill the OTP from the base address to the top of the OTP so that the more recent + * declaration is returned by the API + * The OTP manager handles only 64bits parameter + * | Id | Parameter | + * | 8bits | 58bits | + * | MSB | LSB | + * + * @param id: ID of the parameter to read from OTP + * @retval Address of the ID in the OTP - returns 0 when no ID found + */ +uint8_t * OTP_Read(uint8_t id); + +#ifdef __cplusplus +} +#endif + +#endif /*__OTP_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32_lpm_if.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32_lpm_if.h new file mode 100644 index 00000000000000..6c5dacb2f8c15c --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32_lpm_if.h @@ -0,0 +1,78 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32_lpm_if.h + * @brief Header for stm32_lpm_if.c module (device specific LP management) + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32_LPM_IF_H +#define __STM32_LPM_IF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ + +/** + * @brief Enters Low Power Off Mode + * @param none + * @retval none + */ +void PWR_EnterOffMode(void); +/** + * @brief Exits Low Power Off Mode + * @param none + * @retval none + */ +void PWR_ExitOffMode(void); + +/** + * @brief Enters Low Power Stop Mode + * @note ARM exists the function when waking up + * @param none + * @retval none + */ +void PWR_EnterStopMode(void); +/** + * @brief Exits Low Power Stop Mode + * @note Enable the pll at 32MHz + * @param none + * @retval none + */ +void PWR_ExitStopMode(void); + +/** + * @brief Enters Low Power Sleep Mode + * @note ARM exits the function when waking up + * @param none + * @retval none + */ +void PWR_EnterSleepMode(void); + +/** + * @brief Exits Low Power Sleep Mode + * @note ARM exits the function when waking up + * @param none + * @retval none + */ +void PWR_ExitSleepMode(void); + +#ifdef __cplusplus +} +#endif + +#endif /*__STM32_LPM_IF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h new file mode 100644 index 00000000000000..7c387dd27e1bb8 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wb5mm_dk_conf.h @@ -0,0 +1,101 @@ +/** + ****************************************************************************** + * @file stm32wb5mm_dk_conf_template.h + * @author MCD Application Team + * @brief configuration file. + * This file should be copied to the application folder and renamed + * to stm32wb5mm_dk_conf.h + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef STM32WB5MM_DK_CONF_H +#define STM32WB5MM_DK_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" + +/* Environmental Sensors usage */ +#define USE_ENV_SENSOR_HTS221_0 0U +#define USE_ENV_SENSOR_LPS22HH_0 0U + +/* Motion Sensors usage */ +#define USE_MOTION_SENSOR_ISM330DLC_0 0U +#define USE_MOTION_SENSOR_IIS2MDC_0 0U + +/* COM port usage */ +#define USE_BSP_COM_FEATURE 0U +#define USE_COM_LOG 0U + +#define USE_LCD_CTRL_SSD1315 1U +#define ENV_TEMPERATURE 0U +#define USE_MOTION_SENSOR_ISM330DHCX_0 0U +#define ENV_PRESSURE 0U +#define ENV_HUMIDITY 0U + +/* IRQ priorities */ +#define BSP_BUTTON_USERx_IT_PRIORITY 0x05UL +#define PWM_LED_CLOCK_IT_PRIORITY 0x03UL + +/* I2C3 Frequency in Hz */ +#define BUS_I2C3_FREQUENCY 100000UL /* Frequency of I2C3 = 100 KHz*/ + +/* Indicates whether or not TCXO is supported by the board + * 0: TCXO not supported + * 1: TCXO supported + */ +#define IS_TCXO_SUPPORTED 0U + +/* Indicates whether or not DCDC is supported by the board + * 0: DCDC not supported + * 1: DCDC supported + */ +#define IS_DCDC_SUPPORTED 1U + +#define STM32WB5MM_DK_I2C_Init BSP_I2C3_Init +#define STM32WB5MM_DK_I2C_DeInit BSP_I2C3_DeInit +#define STM32WB5MM_DK_I2C_ReadReg BSP_I2C3_ReadReg +#define STM32WB5MM_DK_I2C_WriteReg BSP_I2C3_WriteReg + +#define STM32WB5MM_DK_GetTick BSP_GetTick + +/*Number of millisecond of audio at each DMA interrupt*/ +#define N_MS_PER_INTERRUPT (20U) + +#define AUDIO_IN_CHANNELS 1 +#define AUDIO_IN_SAMPLING_FREQUENCY 16000 + +#define AUDIO_CHANNELS_OUT 1 +#define AUDIO_OUT_SAMPLING_FREQUENCY 16000 + +#define AUDIO_IN_BUFFER_SIZE DEFAULT_AUDIO_IN_BUFFER_SIZE + +#if (AUDIO_IN_SAMPLING_FREQUENCY == 8000) +#define MAX_DECIMATION_FACTOR 160 +#else +#define MAX_DECIMATION_FACTOR 128 +#endif + +#define MAX_MIC_FREQ 1280 /*kHz - Maximum PDM clock */ +#define MAX_AUDIO_IN_CHANNEL_NBR_PER_IF 1 /* Maximum number of microphones channels for peripheral interface */ +#define MAX_AUDIO_IN_CHANNEL_NBR_TOTAL 1 + +#ifdef __cplusplus +} +#endif + +#endif /* STM32WB5MM_DK_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h new file mode 100644 index 00000000000000..4a78560dcf6a2f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_hal_conf.h @@ -0,0 +1,352 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_hal_conf.h + * @author MCD Application Team + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_HAL_CONF_H +#define __STM32WBxx_HAL_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ +#define HAL_MODULE_ENABLED +/*#define HAL_ADC_MODULE_ENABLED */ +/*#define HAL_CRYP_MODULE_ENABLED */ +/*#define HAL_COMP_MODULE_ENABLED */ +/*#define HAL_CRC_MODULE_ENABLED */ +#define HAL_HSEM_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_IPCC_MODULE_ENABLED +/*#define HAL_IRDA_MODULE_ENABLED */ +/*#define HAL_IWDG_MODULE_ENABLED */ +/*#define HAL_LCD_MODULE_ENABLED */ +/*#define HAL_LPTIM_MODULE_ENABLED */ +/*#define HAL_PCD_MODULE_ENABLED */ +/*#define HAL_PKA_MODULE_ENABLED */ +#define HAL_QSPI_MODULE_ENABLED +#define HAL_RNG_MODULE_ENABLED +#define HAL_RTC_MODULE_ENABLED +/*#define HAL_SAI_MODULE_ENABLED */ +/*#define HAL_SMBUS_MODULE_ENABLED */ +/*#define HAL_SMARTCARD_MODULE_ENABLED */ +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +/*#define HAL_TSC_MODULE_ENABLED */ +#define HAL_UART_MODULE_ENABLED +/*#define HAL_USART_MODULE_ENABLED */ +/*#define HAL_WWDG_MODULE_ENABLED */ +#define HAL_EXTI_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_GPIO_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED + +#define USE_HAL_ADC_REGISTER_CALLBACKS 0u +#define USE_HAL_COMP_REGISTER_CALLBACKS 0u +#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u +#define USE_HAL_I2C_REGISTER_CALLBACKS 0u +#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u +#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u +#define USE_HAL_PCD_REGISTER_CALLBACKS 0u +#define USE_HAL_PKA_REGISTER_CALLBACKS 0u +#define USE_HAL_QSPI_REGISTER_CALLBACKS 0u +#define USE_HAL_RNG_REGISTER_CALLBACKS 0u +#define USE_HAL_RTC_REGISTER_CALLBACKS 0u +#define USE_HAL_SAI_REGISTER_CALLBACKS 0u +#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u +#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u +#define USE_HAL_SPI_REGISTER_CALLBACKS 0u +#define USE_HAL_TIM_REGISTER_CALLBACKS 0u +#define USE_HAL_TSC_REGISTER_CALLBACKS 0u +#define USE_HAL_UART_REGISTER_CALLBACKS 0u +#define USE_HAL_USART_REGISTER_CALLBACKS 0u +#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined(HSE_VALUE) +#define HSE_VALUE 32000000U /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined(HSE_STARTUP_TIMEOUT) +#define HSE_STARTUP_TIMEOUT ((uint32_t) 100) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined(MSI_VALUE) +#define MSI_VALUE ((uint32_t) 4000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined(HSI_VALUE) +#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI1) value. + */ +#if !defined(LSI1_VALUE) +#define LSI1_VALUE ((uint32_t) 32000) /*!< LSI1 Typical Value in Hz*/ +#endif /* LSI1_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ + The real value may vary depending on the variations \ + in voltage and temperature.*/ +/** + * @brief Internal Low Speed oscillator (LSI2) value. + */ +#if !defined(LSI2_VALUE) +#define LSI2_VALUE ((uint32_t) 32000) /*!< LSI2 Typical Value in Hz*/ +#endif /* LSI2_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ + The real value may vary depending on the variations \ + in voltage and temperature.*/ + +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined(LSE_VALUE) +#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @brief Internal Multiple Speed oscillator (HSI48) default value. + * This value is the default HSI48 range value after Reset. + */ +#if !defined(HSI48_VALUE) +#define HSI48_VALUE ((uint32_t) 48000000) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI48_VALUE */ + +#if !defined(LSE_STARTUP_TIMEOUT) +#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/** + * @brief External clock source for SAI1 peripheral + * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source + * frequency. + */ +#if !defined(EXTERNAL_SAI1_CLOCK_VALUE) +#define EXTERNAL_SAI1_CLOCK_VALUE ((uint32_t) 2097000) /*!< Value of the SAI1 External clock source in Hz*/ +#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ + +#define VDD_VALUE 3300U /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 1U +#define INSTRUCTION_CACHE_ENABLE 1U +#define DATA_CACHE_ENABLE 1U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1U */ + +/* ################## SPI peripheral configuration ########################## */ + +/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver + * Activated: CRC code is present inside driver + * Deactivated: CRC code cleaned from driver + */ + +#define USE_SPI_CRC 0U + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ +#ifdef HAL_DMA_MODULE_ENABLED +#include "stm32wbxx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED +#include "stm32wbxx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED +#include "stm32wbxx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED +#include "stm32wbxx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED +#include "stm32wbxx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED +#include "stm32wbxx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_EXTI_MODULE_ENABLED +#include "stm32wbxx_hal_exti.h" +#endif /* HAL_EXTI_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED +#include "stm32wbxx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED +#include "stm32wbxx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_HSEM_MODULE_ENABLED +#include "stm32wbxx_hal_hsem.h" +#endif /* HAL_HSEM_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED +#include "stm32wbxx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_IPCC_MODULE_ENABLED +#include "stm32wbxx_hal_ipcc.h" +#endif /* HAL_IPCC_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED +#include "stm32wbxx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED +#include "stm32wbxx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED +#include "stm32wbxx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32wbxx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED +#include "stm32wbxx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +#ifdef HAL_PKA_MODULE_ENABLED +#include "stm32wbxx_hal_pka.h" +#endif /* HAL_PKA_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED +#include "stm32wbxx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_QSPI_MODULE_ENABLED +#include "stm32wbxx_hal_qspi.h" +#endif /* HAL_QSPI_MODULE_ENABLED */ + +#ifdef HAL_RCC_MODULE_ENABLED +#include "stm32wbxx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED +#include "stm32wbxx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED +#include "stm32wbxx_hal_rtc.h" +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SAI_MODULE_ENABLED +#include "stm32wbxx_hal_sai.h" +#endif /* HAL_SAI_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED +#include "stm32wbxx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED +#include "stm32wbxx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED +#include "stm32wbxx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED +#include "stm32wbxx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED +#include "stm32wbxx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED +#include "stm32wbxx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED +#include "stm32wbxx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED +#include "stm32wbxx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ +#define assert_param(expr) ((expr) ? (void) 0U : assert_failed((uint8_t *) __FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ +void assert_failed(uint8_t * file, uint32_t line); +#else +#define assert_param(expr) ((void) 0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_HAL_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_it.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_it.h new file mode 100644 index 00000000000000..fbba7c4af75667 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm32wbxx_it.h @@ -0,0 +1,59 @@ +/** + ****************************************************************************** + * @file stm32wbxx_it.h + * @author MCD Application Team + * @brief This file contains the headers of the interrupt handlers. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32WBxx_IT_H +#define __STM32WBxx_IT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ +/* Exported macro ------------------------------------------------------------*/ +/* Exported functions ------------------------------------------------------- */ + +void NMI_Handler(void); +void HardFault_Handler(void); +void MemManage_Handler(void); +void BusFault_Handler(void); +void UsageFault_Handler(void); +void SVC_Handler(void); +void DebugMon_Handler(void); +void PendSV_Handler(void); +void SysTick_Handler(void); +void IPCC_C1_RX_IRQHandler(void); +void IPCC_C1_TX_IRQHandler(void); +void EXTI4_IRQHandler(void); +void EXTI0_IRQHandler(void); +void EXTI1_IRQHandler(void); +void USART1_IRQHandler(void); +void DMA2_Channel4_IRQHandler(void); +void CFG_HW_USART1_DMA_TX_IRQHandler(void); +void RTC_WKUP_IRQHandler(void); +void LPUART1_IRQHandler(void); +void DMA1_Channel4_IRQHandler(void); +void QUADSPI_IRQHandler(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32WBxx_IT_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm_logging.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm_logging.h new file mode 100644 index 00000000000000..21400abd1df463 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/stm_logging.h @@ -0,0 +1,71 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : stm_logging.h + * Description : Application header file for logging + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +#ifndef STM_LOGGING_H_ +#define STM_LOGGING_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#define LOG_LEVEL_NONE 0 /* None */ +#define LOG_LEVEL_CRIT 1U /* Critical */ +#define LOG_LEVEL_WARN 2U /* Warning */ +#define LOG_LEVEL_INFO 3U /* Info */ +#define LOG_LEVEL_DEBG 4U /* Debug */ + +#define APP_DBG_FULL(level, region, ...) \ + { \ + if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \ + { \ + printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \ + } \ + logApplication(level, region, __VA_ARGS__); \ + } + +#define APP_DBG(...) \ + { \ + if (APPLI_PRINT_FILE_FUNC_LINE == 1U) \ + { \ + printf("\r\n[%s][%s][%d] ", DbgTraceGetFileName(__FILE__), __FUNCTION__, __LINE__); \ + } \ + logApplication(LOG_LEVEL_NONE, APPLI_LOG_REGION_GENERAL, __VA_ARGS__); \ + } + +/** + * This enumeration represents log regions. + * + */ +typedef enum +{ + APPLI_LOG_REGION_GENERAL = 1U, /* General */ + APPLI_LOG_REGION_OPENTHREAD_API = 2U, /* OpenThread API */ + APPLI_LOG_REGION_OT_API_LINK = 3U, /* OpenThread Link API */ + APPLI_LOG_REGION_OT_API_INSTANCE = 4U, /* OpenThread Instance API */ + APPLI_LOG_REGION_OT_API_MESSAGE = 5U /* OpenThread Message API */ +} appliLogRegion_t; + +typedef uint8_t appliLogLevel_t; + +void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char * aFormat, ...); + +#ifdef __cplusplus +} /* extern "C" */ +#endif +#endif /* STM_LOGGING_H_ */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Inc/utilities_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/utilities_conf.h new file mode 100644 index 00000000000000..8fb35a2edc5d0f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Inc/utilities_conf.h @@ -0,0 +1,66 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : utilities_conf.h + * Description : Configuration file for STM32 Utilities. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef UTILITIES_CONF_H +#define UTILITIES_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "cmsis_compiler.h" +#include "string.h" + +/****************************************************************************** + * common + ******************************************************************************/ +#define UTILS_ENTER_CRITICAL_SECTION() \ + uint32_t primask_bit = __get_PRIMASK(); \ + __disable_irq() + +#define UTILS_EXIT_CRITICAL_SECTION() __set_PRIMASK(primask_bit) + +#define UTILS_MEMSET8(dest, value, size) memset(dest, value, size); + +/****************************************************************************** + * tiny low power manager + * (any macro that does not need to be modified can be removed) + ******************************************************************************/ +#define UTIL_LPM_INIT_CRITICAL_SECTION() +#define UTIL_LPM_ENTER_CRITICAL_SECTION() UTILS_ENTER_CRITICAL_SECTION() +#define UTIL_LPM_EXIT_CRITICAL_SECTION() UTILS_EXIT_CRITICAL_SECTION() + +/****************************************************************************** + * sequencer + * (any macro that does not need to be modified can be removed) + ******************************************************************************/ +#define UTIL_SEQ_INIT_CRITICAL_SECTION() +#define UTIL_SEQ_ENTER_CRITICAL_SECTION() UTILS_ENTER_CRITICAL_SECTION() +#define UTIL_SEQ_EXIT_CRITICAL_SECTION() UTILS_EXIT_CRITICAL_SECTION() +#define UTIL_SEQ_CONF_TASK_NBR (32) +#define UTIL_SEQ_CONF_PRIO_NBR (2) +#define UTIL_SEQ_MEMSET8(dest, value, size) UTILS_MEMSET8(dest, value, size) + +#ifdef __cplusplus +} +#endif + +#endif /*UTILITIES_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.c new file mode 100644 index 00000000000000..65b870a9ba1e5e --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.c @@ -0,0 +1,958 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file app_ble.c + * @author MCD Application Team + * @brief BLE Application + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" + +#include "app_ble.h" +#include "ble.h" +#include "dbg_trace.h" +#include "tl.h" + +#include "app_matter.h" +#include "cmsis_os.h" +#include "otp.h" +#include "shci.h" +#include "stm32_lpm.h" +#include "timers.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ + +/** + * security parameters structure + */ +typedef struct _tSecurityParams +{ + /** + * IO capability of the device + */ + uint8_t ioCapability; + + /** + * Authentication requirement of the device + * Man In the Middle protection required? + */ + uint8_t mitm_mode; + + /** + * bonding mode of the device + */ + uint8_t bonding_mode; + + /** + * Flag to tell whether OOB data has + * to be used during the pairing process + */ + uint8_t OOB_Data_Present; + + /** + * OOB data to be used in the pairing process if + * OOB_Data_Present is set to TRUE + */ + uint8_t OOB_Data[16]; + + /** + * this variable indicates whether to use a fixed pin + * during the pairing process or a passkey has to be + * requested to the application during the pairing process + * 0 implies use fixed pin and 1 implies request for passkey + */ + uint8_t Use_Fixed_Pin; + + /** + * minimum encryption key size requirement + */ + uint8_t encryptionKeySizeMin; + + /** + * maximum encryption key size requirement + */ + uint8_t encryptionKeySizeMax; + + /** + * fixed pin to be used in the pairing process if + * Use_Fixed_Pin is set to 1 + */ + uint32_t Fixed_Pin; + + /** + * this flag indicates whether the host has to initiate + * the security, wait for pairing or does not have any security + * requirements.\n + * 0x00 : no security required + * 0x01 : host should initiate security by sending the slave security + * request command + * 0x02 : host need not send the clave security request but it + * has to wait for paiirng to complete before doing any other + * processing + */ + uint8_t initiateSecurity; +} tSecurityParams; + +/** + * global context + * contains the variables common to all + * services + */ +typedef struct _tBLEProfileGlobalContext +{ + + /** + * security requirements of the host + */ + tSecurityParams bleSecurityParam; + + /** + * gap service handle + */ + uint16_t gapServiceHandle; + + /** + * device name characteristic handle + */ + uint16_t devNameCharHandle; + + /** + * appearance characteristic handle + */ + uint16_t appearanceCharHandle; + + /** + * connection handle of the current active connection + * When not in connection, the handle is set to 0xFFFF + */ + uint16_t connectionHandle; + + /** + * length of the UUID list to be used while advertising + */ + uint8_t advtServUUIDlen; + + /** + * the UUID list to be used while advertising + */ + uint8_t advtServUUID[100]; + +} BleGlobalContext_t; + +typedef struct +{ + BleGlobalContext_t BleApplicationContext_legacy; + APP_BLE_ConnStatus_t Device_Connection_Status; + /** + * ID of the Advertising Timeout + */ + uint8_t Advertising_mgr_timer_Id; + + uint8_t SwitchOffGPIO_timer_Id; +} BleApplicationContext_t; +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private defines -----------------------------------------------------------*/ +#define APPBLE_GAP_DEVICE_NAME_LENGTH 7 +#define FAST_ADV_TIMEOUT (30 * 1000 * 1000 / CFG_TS_TICK_VAL) /**< 30s */ +#define INITIAL_ADV_TIMEOUT (60 * 1000 * 1000 / CFG_TS_TICK_VAL) /**< 60s */ + +#define BD_ADDR_SIZE_LOCAL 6 + +/* USER CODE BEGIN PD */ +#define LED_ON_TIMEOUT (0.005 * 1000 * 1000 / CFG_TS_TICK_VAL) /**< 5ms */ +/* USER CODE END PD */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +osMutexId_t MtxHciId; +osSemaphoreId_t SemHciId; +osThreadId_t HciUserEvtProcessId; +// FreeeRTOS sw timer +TimerHandle_t sbleWorkaroundAdvTimeoutTimer; + +const osThreadAttr_t HciUserEvtProcess_attr = { .name = CFG_HCI_USER_EVT_PROCESS_NAME, + .attr_bits = CFG_HCI_USER_EVT_PROCESS_ATTR_BITS, + .cb_mem = CFG_HCI_USER_EVT_PROCESS_CB_MEM, + .cb_size = CFG_HCI_USER_EVT_PROCESS_CB_SIZE, + .stack_mem = CFG_HCI_USER_EVT_PROCESS_STACK_MEM, + .priority = CFG_HCI_USER_EVT_PROCESS_PRIORITY, + .stack_size = CFG_HCI_USER_EVT_PROCESS_STACK_SIZE }; + +/* Private variables ---------------------------------------------------------*/ +PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_CmdPacket_t BleCmdBuffer; + +static const uint8_t M_bd_addr[BD_ADDR_SIZE_LOCAL] = { + (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000000000FF)), (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00000000FF00) >> 8), + (uint8_t)((CFG_ADV_BD_ADDRESS & 0x000000FF0000) >> 16), (uint8_t)((CFG_ADV_BD_ADDRESS & 0x0000FF000000) >> 24), + (uint8_t)((CFG_ADV_BD_ADDRESS & 0x00FF00000000) >> 32), (uint8_t)((CFG_ADV_BD_ADDRESS & 0xFF0000000000) >> 40) +}; +static uint8_t bd_addr_udn[BD_ADDR_SIZE_LOCAL]; + +/** + * Identity root key used to derive LTK and CSRK + */ +static const uint8_t BLE_CFG_IR_VALUE[16] = CFG_BLE_IRK; + +/** + * Encryption root key used to derive LTK and CSRK + */ +static const uint8_t BLE_CFG_ER_VALUE[16] = CFG_BLE_ERK; + +PLACE_IN_SECTION("BLE_APP_CONTEXT") static BleApplicationContext_t BleApplicationContext; +PLACE_IN_SECTION("BLE_APP_CONTEXT") static uint16_t AdvIntervalMin, AdvIntervalMax; + +MATTER_App_Notification_evt_t handleNotification; + +#if L2CAP_REQUEST_NEW_CONN_PARAM != 0 +#define SIZE_TAB_CONN_INT 2 +float tab_conn_interval[SIZE_TAB_CONN_INT] = { 50, 1000 }; /* ms */ +uint8_t index_con_int, mutex; +#endif + +/** + * Advertising Data + */ +static const char local_name[] = { AD_TYPE_COMPLETE_LOCAL_NAME, 'S', 'T', 'D', 'K', 'M', 'A', 'T', 'T', 'E', 'R' }; +uint8_t manuf_data[15] = { + 0x02, 0x01, 0x06, 0x0B, 0x16, 0xF6, 0xFF, 0x00, 0x00, 0x0F, 0xF1, 0xFF, 0x04, 0x80, 0x00, +}; + +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +static void BLE_UserEvtRx(void * pPayload); +static void BLE_StatusNot(HCI_TL_CmdStatus_t status); +static void Ble_Tl_Init(void); +static void Ble_Hci_Gap_Gatt_Init(void); +static const uint8_t * BleGetBdAddress(void); +static void Switch_OFF_GPIO(void); +#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0) +static void BLE_SVC_L2CAP_Conn_Update(uint16_t Connection_Handle); +#endif +static void HciUserEvtProcess(void * argument); +void BleAdvWorkaroundTimeoutHandler(TimerHandle_t xTimer); +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* Functions Definition ------------------------------------------------------*/ +void APP_BLE_Init_Dyn_1(void) +{ + /* USER CODE BEGIN APP_BLE_Init_1 */ + + /* USER CODE END APP_BLE_Init_1 */ + SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet = { { { 0, 0, 0 } }, /**< Header unused */ + { 0, /** pBleBufferAddress not used */ + 0, /** BleBufferSize not used */ + CFG_BLE_NUM_GATT_ATTRIBUTES, + CFG_BLE_NUM_GATT_SERVICES, + CFG_BLE_ATT_VALUE_ARRAY_SIZE, + CFG_BLE_NUM_LINK, + CFG_BLE_DATA_LENGTH_EXTENSION, + CFG_BLE_PREPARE_WRITE_LIST_SIZE, + CFG_BLE_MBLOCK_COUNT, + CFG_BLE_MAX_ATT_MTU, + CFG_BLE_SLAVE_SCA, + CFG_BLE_MASTER_SCA, + CFG_BLE_LSE_SOURCE, + CFG_BLE_MAX_CONN_EVENT_LENGTH, + CFG_BLE_HSE_STARTUP_TIME, + CFG_BLE_VITERBI_MODE, + CFG_BLE_OPTIONS, + 0, + CFG_BLE_MAX_COC_INITIATOR_NBR, + CFG_BLE_MIN_TX_POWER, + CFG_BLE_MAX_TX_POWER } }; + + /** + * Initialize Ble Transport Layer + */ + Ble_Tl_Init(); + + /** + * Do not allow standby in the application + */ + UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_BLE, UTIL_LPM_DISABLE); + + MtxHciId = osMutexNew(NULL); + SemHciId = osSemaphoreNew(1, 0, NULL); /*< Create the semaphore and make it busy at initialization */ + /** + * Register the hci transport layer to handle BLE User Asynchronous Events + */ + HciUserEvtProcessId = osThreadNew(HciUserEvtProcess, NULL, &HciUserEvtProcess_attr); + + /** + * Starts the BLE Stack on CPU2 + */ + SHCI_C2_BLE_Init(&ble_init_cmd_packet); + + /** + * Initialization of HCI & GATT & GAP layer + */ + Ble_Hci_Gap_Gatt_Init(); + + /** + * Initialization of the BLE Services + */ + SVCCTL_Init(); + + /** + * Initialization of the BLE App Context + */ + BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE; + BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0xFFFF; + /** + * Initialization of ADV - Ad Manufacturer Element - Support OTA Bit Mask + */ + +#if (RADIO_ACTIVITY_EVENT != 0) + aci_hal_set_radio_activity_mask(0x0006); +#endif + +#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0) + index_con_int = 0; + mutex = 1; +#endif + /** + * Initialize P2P Server Application + */ + APP_MATTER_Init(); + + /** + * Create timer to handle the Led Switch OFF + */ + HW_TS_Create(CFG_TIM_PROC_ID_ISR, &(BleApplicationContext.SwitchOffGPIO_timer_Id), hw_ts_SingleShot, Switch_OFF_GPIO); +} + +void APP_BLE_Init_Dyn_2(void) +{ + /** + * Make device discoverable + */ + BleApplicationContext.BleApplicationContext_legacy.advtServUUID[0] = NULL; + BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen = 0; + /* Initialize intervals for reconnexion without intervals update */ + AdvIntervalMin = CFG_FAST_CONN_ADV_INTERVAL_MIN; + AdvIntervalMax = CFG_FAST_CONN_ADV_INTERVAL_MAX; + + /* USER CODE BEGIN APP_BLE_Init_2 */ + + /* USER CODE END APP_BLE_Init_2 */ +} + +void APP_BLE_Init_Dyn_3(void) +{ + + sbleWorkaroundAdvTimeoutTimer = xTimerCreate("BleAdvWorkaroundTimer", // Just a text name, not used by the RTOS kernel + pdMS_TO_TICKS(2000), // == default timer period (mS) + 0, // no timer reload (==one-shot) + NULL, // init timer id = ble obj context + BleAdvWorkaroundTimeoutHandler // timer callback handler + ); + if (xTimerStart(sbleWorkaroundAdvTimeoutTimer, 0) != pdPASS) + { + /* The timer could not be set into the Active + state. */ + } + APP_BLE_Adv_Request(APP_BLE_FAST_ADV); +} + +SVCCTL_UserEvtFlowStatus_t SVCCTL_App_Notification(void * pckt) +{ + hci_event_pckt * event_pckt; + evt_le_meta_event * meta_evt; + event_pckt = (hci_event_pckt *) ((hci_uart_pckt *) pckt)->data; + + switch (event_pckt->evt) + { + case HCI_DISCONNECTION_COMPLETE_EVT_CODE: { + hci_disconnection_complete_event_rp0 * disconnection_complete_event; + disconnection_complete_event = (hci_disconnection_complete_event_rp0 *) event_pckt->data; + + if (disconnection_complete_event->Connection_Handle == BleApplicationContext.BleApplicationContext_legacy.connectionHandle) + { + BleApplicationContext.BleApplicationContext_legacy.connectionHandle = 0; + BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE; + APP_DBG_MSG("\r\n\r** DISCONNECTION EVENT WITH CLIENT \n"); + } + /* + * SPECIFIC to P2P Server APP + */ + handleNotification.P2P_Evt_Opcode = MATTER_STM_PEER_DISCON_HANDLE_EVT; + handleNotification.ConnectionHandle = disconnection_complete_event->Connection_Handle; + APP_MATTER_Notification(&handleNotification); + + /* USER CODE BEGIN EVT_DISCONN_COMPLETE */ + + /* USER CODE END EVT_DISCONN_COMPLETE */ + } + + break; /* EVT_DISCONN_COMPLETE */ + + case HCI_LE_META_EVT_CODE: { + meta_evt = (evt_le_meta_event *) event_pckt->data; + /* USER CODE BEGIN EVT_LE_META_EVENT */ + + /* USER CODE END EVT_LE_META_EVENT */ + switch (meta_evt->subevent) + { + case HCI_LE_CONNECTION_UPDATE_COMPLETE_SUBEVT_CODE: + APP_DBG_MSG("\r\n\r** CONNECTION UPDATE EVENT WITH CLIENT \n"); + + /** + * The connection is done, there is no need anymore to schedule the LP ADV + */ + break; + case HCI_LE_CONNECTION_COMPLETE_SUBEVT_CODE: { + hci_le_connection_complete_event_rp0 * connection_complete_event; + + /** + * The connection is done, there is no need anymore to schedule the LP ADV + */ + connection_complete_event = (hci_le_connection_complete_event_rp0 *) meta_evt->data; + + // HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id); + + APP_DBG_MSG("EVT_LE_CONN_COMPLETE for connection handle 0x%x\n", connection_complete_event->Connection_Handle); + + if (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_CONNECTING) + { + /* Connection as client */ + BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_CLIENT; + } + else + { + /* Connection as server */ + BleApplicationContext.Device_Connection_Status = APP_BLE_CONNECTED_SERVER; + } + + BleApplicationContext.BleApplicationContext_legacy.connectionHandle = connection_complete_event->Connection_Handle; + + /** SPECIFIC to P2P Server APP*/ + hci_le_set_data_length(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, 251, 2120); + handleNotification.P2P_Evt_Opcode = MATTER_STM_PEER_CONN_HANDLE_EVT; + handleNotification.ConnectionHandle = BleApplicationContext.BleApplicationContext_legacy.connectionHandle; + APP_MATTER_Notification(&handleNotification); + /**/ + /* USER CODE END HCI_EVT_LE_CONN_COMPLETE */ + } + break; /* HCI_EVT_LE_CONN_COMPLETE */ + + default: + /* USER CODE BEGIN SUBEVENT_DEFAULT */ + /* USER CODE END SUBEVENT_DEFAULT */ + break; + } + } + break; /* HCI_EVT_LE_META_EVENT */ + default: + /* USER CODE BEGIN ECODE_DEFAULT*/ + + /* USER CODE END ECODE_DEFAULT*/ + break; + } + + return (SVCCTL_UserEvtFlowEnable); +} + +APP_BLE_ConnStatus_t APP_BLE_Get_Server_Connection_Status(void) +{ + return BleApplicationContext.Device_Connection_Status; +} + +void APP_BLE_Key_Button2_Action(void) +{ +#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0) + if (BleApplicationContext.Device_Connection_Status != APP_BLE_FAST_ADV && + BleApplicationContext.Device_Connection_Status != APP_BLE_IDLE) + { + BLE_SVC_L2CAP_Conn_Update(BleApplicationContext.BleApplicationContext_legacy.connectionHandle); + } + return; +#endif +} + +void APP_BLE_Key_Button3_Action(void) {} + +void APP_BLE_Stop(void) +{ + /* Stop Advertising Timer */ + // HW_TS_Stop(BleApplicationContext.Advertising_mgr_timer_Id); + // HW_TS_Delete(BleApplicationContext.Advertising_mgr_timer_Id); + /* BLE STOP Procedure */ + aci_hal_stack_reset(); +} +/* USER CODE END FD*/ +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +static void Ble_Tl_Init(void) +{ + HCI_TL_HciInitConf_t Hci_Tl_Init_Conf; + + Hci_Tl_Init_Conf.p_cmdbuffer = (uint8_t *) &BleCmdBuffer; + Hci_Tl_Init_Conf.StatusNotCallBack = BLE_StatusNot; + hci_init(BLE_UserEvtRx, (void *) &Hci_Tl_Init_Conf); + + return; +} + +static void Ble_Hci_Gap_Gatt_Init(void) +{ + + uint8_t role; + uint8_t index; + uint16_t gap_service_handle, gap_dev_name_char_handle, gap_appearance_char_handle; + const uint8_t * bd_addr; + uint32_t srd_bd_addr[2]; + uint16_t appearance[1] = { BLE_CFG_GAP_APPEARANCE }; + + /** + * Initialize HCI layer + */ + /*HCI Reset to synchronise BLE Stack*/ + hci_reset(); + + /** + * Write the BD Address + */ + + bd_addr = BleGetBdAddress(); + aci_hal_write_config_data(CONFIG_DATA_PUBADDR_OFFSET, CONFIG_DATA_PUBADDR_LEN, (uint8_t *) bd_addr); + + /* BLE MAC in ADV Packet */ + // manuf_data[ sizeof(manuf_data)-6] = bd_addr[5]; + // manuf_data[ sizeof(manuf_data)-5] = bd_addr[4]; + // manuf_data[ sizeof(manuf_data)-4] = bd_addr[3]; + // manuf_data[ sizeof(manuf_data)-3] = bd_addr[2]; + // manuf_data[ sizeof(manuf_data)-2] = bd_addr[1]; + // manuf_data[ sizeof(manuf_data)-1] = bd_addr[0]; + // + /** + * Static random Address + * The two upper bits shall be set to 1 + * The lowest 32bits is read from the UDN to differentiate between devices + * The RNG may be used to provide a random number on each power on + */ + srd_bd_addr[1] = 0x0000ED6E; + srd_bd_addr[0] = LL_FLASH_GetUDN(); + aci_hal_write_config_data(CONFIG_DATA_RANDOM_ADDRESS_OFFSET, CONFIG_DATA_RANDOM_ADDRESS_LEN, (uint8_t *) srd_bd_addr); + + /** + * Write Identity root key used to derive LTK and CSRK + */ + aci_hal_write_config_data(CONFIG_DATA_IR_OFFSET, CONFIG_DATA_IR_LEN, (uint8_t *) BLE_CFG_IR_VALUE); + + /** + * Write Encryption root key used to derive LTK and CSRK + */ + aci_hal_write_config_data(CONFIG_DATA_ER_OFFSET, CONFIG_DATA_ER_LEN, (uint8_t *) BLE_CFG_ER_VALUE); + + /** + * Set TX Power to 0dBm. + */ + aci_hal_set_tx_power_level(1, CFG_TX_POWER); + + /** + * Initialize GATT interface + */ + aci_gatt_init(); + + /** + * Initialize GAP interface + */ + role = 0; + +#if (BLE_CFG_PERIPHERAL == 1) + role |= GAP_PERIPHERAL_ROLE; +#endif + +#if (BLE_CFG_CENTRAL == 1) + role |= GAP_CENTRAL_ROLE; +#endif + + if (role > 0) + { + const char * name = "STM32WB"; + aci_gap_init(role, 0, APPBLE_GAP_DEVICE_NAME_LENGTH, &gap_service_handle, &gap_dev_name_char_handle, + &gap_appearance_char_handle); + + if (aci_gatt_update_char_value(gap_service_handle, gap_dev_name_char_handle, 0, strlen(name), (uint8_t *) name)) + { + BLE_DBG_SVCCTL_MSG("Device Name aci_gatt_update_char_value failed.\n"); + } + } + + if (aci_gatt_update_char_value(gap_service_handle, gap_appearance_char_handle, 0, 2, (uint8_t *) &appearance)) + { + BLE_DBG_SVCCTL_MSG("Appearance aci_gatt_update_char_value failed.\n"); + } + /** + * Initialize Default PHY + */ + hci_le_set_default_phy(ALL_PHYS_PREFERENCE, TX_2M_PREFERRED, RX_2M_PREFERRED); + + /** + * Initialize IO capability + */ + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability = CFG_IO_CAPABILITY; + aci_gap_set_io_capability(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.ioCapability); + + /** + * Initialize authentication + */ + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode = CFG_MITM_PROTECTION; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data_Present = 0; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin = 8; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax = 16; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin = 1; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin = 111111; + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode = 1; + for (index = 0; index < 16; index++) + { + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.OOB_Data[index] = (uint8_t) index; + } + + aci_gap_set_authentication_requirement(BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.mitm_mode, 1, 0, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMin, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.encryptionKeySizeMax, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Use_Fixed_Pin, + BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.Fixed_Pin, 0); + + /** + * Initialize whitelist + */ + if (BleApplicationContext.BleApplicationContext_legacy.bleSecurityParam.bonding_mode) + { + aci_gap_configure_whitelist(); + } +} + +void APP_BLE_Adv_Request(APP_BLE_ConnStatus_t New_Status) +{ + tBleStatus ret = BLE_STATUS_INVALID_PARAMS; + uint16_t Min_Inter, Max_Inter; + + if (New_Status == APP_BLE_FAST_ADV) + { + Min_Inter = AdvIntervalMin; + Max_Inter = AdvIntervalMax; + } + else + { + Min_Inter = CFG_LP_CONN_ADV_INTERVAL_MIN; + Max_Inter = CFG_LP_CONN_ADV_INTERVAL_MAX; + } + + APP_DBG_MSG("First index in %d state \n", BleApplicationContext.Device_Connection_Status); + + if ((New_Status == APP_BLE_LP_ADV) && + ((BleApplicationContext.Device_Connection_Status == APP_BLE_FAST_ADV) || + (BleApplicationContext.Device_Connection_Status == APP_BLE_LP_ADV))) + { + /* Connection in ADVERTISE mode have to stop the current advertising */ + ret = aci_gap_set_non_discoverable(); + if (ret == BLE_STATUS_SUCCESS) + { + APP_DBG_MSG("Successfully Stopped Advertising"); + } + else + { + APP_DBG_MSG("Stop Advertising Failed , result: %d \n", ret); + } + } + + BleApplicationContext.Device_Connection_Status = New_Status; + /* Start Fast or Low Power Advertising */ + ret = aci_gap_set_discoverable(ADV_IND, Min_Inter, Max_Inter, GAP_PUBLIC_ADDR, NO_WHITE_LIST_USE, /* use white list */ + sizeof(local_name), (uint8_t *) &local_name, + BleApplicationContext.BleApplicationContext_legacy.advtServUUIDlen, + BleApplicationContext.BleApplicationContext_legacy.advtServUUID, 0, 0); + /* Update Advertising data */ + ret = aci_gap_update_adv_data(sizeof(manuf_data), (uint8_t *) manuf_data); + + APP_DBG_MSG("check set discoverable , result: %d \n", ret); + if (ret == BLE_STATUS_SUCCESS) + { + if (New_Status == APP_BLE_FAST_ADV) + { + APP_DBG_MSG("Successfully Start Fast Advertising \n"); + } + else + { + APP_DBG_MSG("Successfully Start Low Power Advertising \n"); + } + } + else + { + if (New_Status == APP_BLE_FAST_ADV) + { + APP_DBG_MSG("Start Fast Advertising Failed , result: %d \n", ret); + } + else + { + APP_DBG_MSG("Start Low Power Advertising Failed , result: %d \n", ret); + } + } + + return; +} + +const uint8_t * BleGetBdAddress(void) +{ + uint8_t * otp_addr; + const uint8_t * bd_addr; + uint32_t udn; + uint32_t company_id; + uint32_t device_id; + + udn = LL_FLASH_GetUDN(); + + if (udn != 0xFFFFFFFF) + { + company_id = LL_FLASH_GetSTCompanyID(); + device_id = LL_FLASH_GetDeviceID(); + + /** + * Public Address with the ST company ID + * bit[47:24] : 24bits (OUI) equal to the company ID + * bit[23:16] : Device ID. + * bit[15:0] : The last 16bits from the UDN + * Note: In order to use the Public Address in a final product, a dedicated + * 24bits company ID (OUI) shall be bought. + */ + bd_addr_udn[0] = (uint8_t)(udn & 0x000000FF); + bd_addr_udn[1] = (uint8_t)((udn & 0x0000FF00) >> 8); + bd_addr_udn[2] = (uint8_t) device_id; + bd_addr_udn[3] = (uint8_t)(company_id & 0x000000FF); + ; + bd_addr_udn[4] = (uint8_t)((company_id & 0x0000FF00) >> 8); + bd_addr_udn[5] = (uint8_t)((company_id & 0x00FF0000) >> 16); + + bd_addr = (const uint8_t *) bd_addr_udn; + } + else + { + otp_addr = OTP_Read(0); + if (otp_addr) + { + bd_addr = ((OTP_ID0_t *) otp_addr)->bd_address; + } + else + { + bd_addr = M_bd_addr; + } + } + + return bd_addr; +} + +/* USER CODE BEGIN FD_LOCAL_FUNCTION */ + +/* USER CODE END FD_LOCAL_FUNCTION */ + +/************************************************************* + * + *SPECIFIC FUNCTIONS FOR P2P SERVER + * + *************************************************************/ +void BleAdvWorkaroundTimeoutHandler(TimerHandle_t xTimer) +{ + APP_BLE_Adv_Cancel(); +} + +void APP_BLE_Adv_Cancel(void) +{ + /* USER CODE BEGIN Adv_Cancel_1 */ + // BSP_LED_Off(LED_GREEN); + /* USER CODE END Adv_Cancel_1 */ + + if (BleApplicationContext.Device_Connection_Status != APP_BLE_CONNECTED_SERVER) + + { + + tBleStatus result = 0x00; + + result = aci_gap_set_non_discoverable(); + + BleApplicationContext.Device_Connection_Status = APP_BLE_IDLE; + if (result == BLE_STATUS_SUCCESS) + { + APP_DBG_MSG(" \r\n\r"); + APP_DBG_MSG("** STOP ADVERTISING ** \r\n\r"); + } + else + { + APP_DBG_MSG("** STOP ADVERTISING ** Failed \r\n\r"); + } + } + + /* USER CODE BEGIN Adv_Cancel_2 */ + + /* USER CODE END Adv_Cancel_2 */ + return; +} + +static void Switch_OFF_GPIO() +{ + /* USER CODE BEGIN Switch_OFF_GPIO */ + // BSP_LED_Off(LED_GREEN); + /* USER CODE END Switch_OFF_GPIO */ +} + +#if (L2CAP_REQUEST_NEW_CONN_PARAM != 0) +void BLE_SVC_L2CAP_Conn_Update(uint16_t Connection_Handle) +{ + /* USER CODE BEGIN BLE_SVC_L2CAP_Conn_Update_1 */ + + /* USER CODE END BLE_SVC_L2CAP_Conn_Update_1 */ + if (mutex == 1) + { + mutex = 0; + index_con_int = (index_con_int + 1) % SIZE_TAB_CONN_INT; + uint16_t interval_min = CONN_P(tab_conn_interval[index_con_int]); + uint16_t interval_max = CONN_P(tab_conn_interval[index_con_int]); + uint16_t slave_latency = L2CAP_SLAVE_LATENCY; + uint16_t timeout_multiplier = L2CAP_TIMEOUT_MULTIPLIER; + tBleStatus result; + + result = aci_l2cap_connection_parameter_update_req(BleApplicationContext.BleApplicationContext_legacy.connectionHandle, + interval_min, interval_max, slave_latency, timeout_multiplier); + if (result == BLE_STATUS_SUCCESS) + { + APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Successfully \r\n\r"); + } + else + { + APP_DBG_MSG("BLE_SVC_L2CAP_Conn_Update(), Failed \r\n\r"); + } + } + /* USER CODE BEGIN BLE_SVC_L2CAP_Conn_Update_2 */ + + /* USER CODE END BLE_SVC_L2CAP_Conn_Update_2 */ + return; +} +#endif + +/* USER CODE BEGIN FD_SPECIFIC_FUNCTIONS */ + +/* USER CODE END FD_SPECIFIC_FUNCTIONS */ +/************************************************************* + * + * WRAP FUNCTIONS + * + *************************************************************/ + +static void HciUserEvtProcess(void * argument) +{ + UNUSED(argument); + + for (;;) + { + osThreadFlagsWait(1, osFlagsWaitAny, osWaitForever); + hci_user_evt_proc(); + } +} + +void hci_notify_asynch_evt(void * pdata) +{ + osThreadFlagsSet(HciUserEvtProcessId, 1); + return; +} + +void hci_cmd_resp_release(uint32_t flag) +{ + osSemaphoreRelease(SemHciId); + return; +} + +void hci_cmd_resp_wait(uint32_t timeout) +{ + osSemaphoreAcquire(SemHciId, osWaitForever); + return; +} + +static void BLE_UserEvtRx(void * pPayload) +{ + SVCCTL_UserEvtFlowStatus_t svctl_return_status; + tHCI_UserEvtRxParam * pParam; + + pParam = (tHCI_UserEvtRxParam *) pPayload; + + svctl_return_status = SVCCTL_UserEvtRx((void *) &(pParam->pckt->evtserial)); + if (svctl_return_status != SVCCTL_UserEvtFlowDisable) + { + pParam->status = HCI_TL_UserEventFlow_Enable; + } + else + { + pParam->status = HCI_TL_UserEventFlow_Disable; + } +} + +static void BLE_StatusNot(HCI_TL_CmdStatus_t status) +{ + switch (status) + { + case HCI_TL_CmdBusy: + /** + * All tasks that may send an aci/hci commands shall be listed here + * This is to prevent a new command is sent while one is already pending + */ + osMutexAcquire(MtxHciId, osWaitForever); + + break; + + case HCI_TL_CmdAvailable: + /** + * All tasks that may send an aci/hci commands shall be listed here + * This is to prevent a new command is sent while one is already pending + */ + osMutexRelease(MtxHciId); + + break; + + default: + break; + } + return; +} + +void SVCCTL_ResumeUserEventFlow(void) +{ + hci_resume_flow(); + return; +} + +/* USER CODE BEGIN FD_WRAP_FUNCTIONS */ + +/* USER CODE END FD_WRAP_FUNCTIONS */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.h new file mode 100644 index 00000000000000..cb0b80a25628f6 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_ble.h @@ -0,0 +1,88 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file app_ble.h + * @author MCD Application Team + * @brief Header for ble application + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef APP_BLE_H +#define APP_BLE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "hci_tl.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +typedef enum +{ + APP_BLE_IDLE, + APP_BLE_FAST_ADV, + APP_BLE_LP_ADV, + APP_BLE_SCAN, + APP_BLE_LP_CONNECTING, + APP_BLE_CONNECTED_SERVER, + APP_BLE_CONNECTED_CLIENT +} APP_BLE_ConnStatus_t; + +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* External variables --------------------------------------------------------*/ +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions ---------------------------------------------*/ +void APP_BLE_Init_Dyn_1(void); +void APP_BLE_Init_Dyn_2(void); +void APP_BLE_Init_Dyn_3(void); + +APP_BLE_ConnStatus_t APP_BLE_Get_Server_Connection_Status(void); + +/* USER CODE BEGIN EF */ +void APP_BLE_Key_Button1_Action(void); +void APP_BLE_Key_Button2_Action(void); +void APP_BLE_Key_Button3_Action(void); +void APP_BLE_Stop(void); +void APP_BLE_Adv_Request(APP_BLE_ConnStatus_t New_Status); +void APP_BLE_Adv_Cancel(void); +/* USER CODE END EF */ + +#ifdef __cplusplus +} +#endif + +#endif /*APP_BLE_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.c new file mode 100644 index 00000000000000..49881b1bcfa2df --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.c @@ -0,0 +1,236 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file app_matter.c + * @author MCD Application Team + * @brief matter application to handle ble between matter api and stm32 world + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_matter.h" +#include "app_common.h" +#include "app_conf.h" +#include "app_entry.h" +#include "ble.h" +#include "cmsis_os.h" +#include "custom_stm.h" +#include "dbg_trace.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ +typedef struct +{ + uint8_t Device_Led_Selection; + uint8_t Led1; +} P2P_LedCharValue_t; + +typedef struct +{ + uint8_t Device_Button_Selection; + uint8_t ButtonStatus; +} P2P_ButtonCharValue_t; + +typedef struct +{ + uint8_t Notification_Status; /* used to check if P2P Server is enabled to Notify */ + P2P_LedCharValue_t LedControl; + P2P_ButtonCharValue_t ButtonControl; + uint16_t ConnectionHandle; +} P2P_Server_App_Context_t; +/* USER CODE END PTD */ + +/* Private defines ------------------------------------------------------------*/ +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macros -------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ +/** + * START of Section BLE_APP_CONTEXT + */ + +PLACE_IN_SECTION("BLE_APP_CONTEXT") static P2P_Server_App_Context_t P2P_Server_App_Context; + +BLEReceiveCallback BLEReceiveCb = NULL; +BLETXCharCCCDWriteCallback BLETXCharCCCDWriteCb = NULL; +BLEConnectionCallback BLEConnectionCb = NULL; +BLEDisconnectionCallback BLEDisconnectionCb = NULL; +BLEDAckCallback BLEAckCb = NULL; + +/** + * END of Section BLE_APP_CONTEXT + */ +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ +/* USER CODE END PFP */ + +void APP_MATTER_BLE_Set_Receive_Callback(BLEReceiveCallback aCallback) +{ + BLEReceiveCb = aCallback; +} + +void APP_MATTER_BLE_Set_TXCharCCCDWrite_Callback(BLETXCharCCCDWriteCallback aCallback) +{ + BLETXCharCCCDWriteCb = aCallback; +} + +void APP_MATTER_BLE_Set_Connection_Callback(BLEConnectionCallback aCallback) +{ + BLEConnectionCb = aCallback; +} + +void APP_MATTER_BLE_Set_Disconnection_Callback(BLEDisconnectionCallback aCallback) +{ + BLEDisconnectionCb = aCallback; +} + +void APP_MATTER_BLE_Set_Ack_After_Indicate_Callback(BLEDAckCallback aCallback) +{ + BLEAckCb = aCallback; +} + +/* Functions Definition ------------------------------------------------------*/ +void APP_MATTER_Notification(MATTER_App_Notification_evt_t * pNotification) +{ + /* USER CODE BEGIN APP_MATTER_Notification */ + BLE_Matter_TXCharCCCD message; + /* USER CODE END APP_MATTER_Notification */ + switch (pNotification->P2P_Evt_Opcode) + { + /* USER CODE BEGIN APP_MATTER_Notification */ + /* USER CODE END APP_MATTER_Notification */ + + case MATTER_STM_PEER_CONN_HANDLE_EVT: + /* USER CODE BEGIN PEER_CONN_HANDLE_EVT */ + BLEConnectionCb(); + /* USER CODE END PEER_CONN_HANDLE_EVT */ + break; + + case MATTER_STM_PEER_DISCON_HANDLE_EVT: + /* USER CODE BEGIN PEER_DISCON_HANDLE_EVT */ + BLEDisconnectionCb(&pNotification->ConnectionHandle); + /* USER CODE END PEER_DISCON_HANDLE_EVT */ + break; + + case MATTER_STM_ACK_INDICATE_EVT: + /* USER CODE BEGIN PEER_DISCON_HANDLE_EVT */ + BLEAckCb(&pNotification->ConnectionHandle); + /* USER CODE END PEER_DISCON_HANDLE_EVT */ + break; + + case MATTER_STM_INDICATE_ENABLED_EVT: + /* USER CODE BEGIN P2PS_STM__NOTIFY_ENABLED_EVT */ + message.connid = pNotification->ConnectionHandle; + message.notif = 1; + P2P_Server_App_Context.Notification_Status = 1; + APP_DBG_MSG("-- Matter APPLICATION SERVER : INDICATE ENABLED\n"); + APP_DBG_MSG(" \n\r"); + BLETXCharCCCDWriteCb(&message); + /* USER CODE END P2PS_STM__NOTIFY_ENABLED_EVT */ + break; + + case MATTER_STM_INDICATE_DISABLED_EVT: + /* USER CODE BEGIN P2PS_STM_NOTIFY_DISABLED_EVT */ + message.connid = pNotification->ConnectionHandle; + message.notif = 0; + P2P_Server_App_Context.Notification_Status = 0; + APP_DBG_MSG("-- Matter APPLICATION SERVER : INDICATE DISABLED\n"); + APP_DBG_MSG(" \n\r"); + BLETXCharCCCDWriteCb(&message); + /* USER CODE END P2PS_STM_NOTIFY_DISABLED_EVT */ + break; + + case MATTER_STM_WRITE_EVT:; + BLE_Matter_RX Message; + Message.Length = pNotification->DataTransfered.Length; + Message.Payload = pNotification->DataTransfered.pPayload; + Message.connid = pNotification->ConnectionHandle; + BLEReceiveCb(&Message); // call matter callback + /* USER CODE BEGIN MATTER_STM_WRITE_EVT */ + + /* USER CODE END MATTER_STM_WRITE_EVT */ + break; + + default: + /* USER CODE BEGIN APP_MATTER_Notification */ + + /* USER CODE END APP_MATTER_Notification */ + break; + } + /* USER CODE BEGIN APP_MATTER_Notification */ + + /* USER CODE END APP_MATTER_Notification */ + return; +} + +void APP_MATTER_Init(void) +{ + /* USER CODE BEGIN APP_MATTER_Init */ + + /** + * Initialize LedButton Service + */ + P2P_Server_App_Context.Notification_Status = 0; + /* USER CODE END APP_MATTER_Init */ + return; +} + +/* USER CODE END FD */ + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ + +/* USER CODE BEGIN FD_LOCAL_FUNCTIONS*/ +void APP_MATTER_Send_Notification(uint16_t datalength, uint8_t * data) +{ + + if (P2P_Server_App_Context.ButtonControl.ButtonStatus == 0x00) + { + P2P_Server_App_Context.ButtonControl.ButtonStatus = 0x01; + } + else + { + P2P_Server_App_Context.ButtonControl.ButtonStatus = 0x00; + } + + if (P2P_Server_App_Context.Notification_Status) + { + CUSTOM_STM_App_Update_Char(P2P_NOTIFY_CHAR_UUID, (uint8_t *) data, datalength); + } + else + { + APP_DBG_MSG("-- Matter APPLICATION SERVER : CAN'T INFORM CLIENT - NOTIFICATION DISABLED\n "); + } + + return; +} + +/* USER CODE END FD_LOCAL_FUNCTIONS*/ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.h new file mode 100644 index 00000000000000..c3dccc8e142133 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_matter.h @@ -0,0 +1,116 @@ +/* USER CODE BEGIN */ +/** + ****************************************************************************** + * File Name : App/app_matter.h + * Description : Header for p2p_server_app.c module + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __APP_MATTER_H +#define __APP_MATTER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ + +typedef enum +{ + MATTER_STM_PEER_CONN_HANDLE_EVT, + MATTER_STM_PEER_DISCON_HANDLE_EVT, + MATTER_STM_ACK_INDICATE_EVT, + MATTER_STM_INDICATE_ENABLED_EVT, + MATTER_STM_INDICATE_DISABLED_EVT, + MATTER_STM_READ_EVT, + MATTER_STM_WRITE_EVT, + MATTER_STM_BOOT_REQUEST_EVT, +} MATTER_STM_Opcode_evt_t; + +typedef struct +{ + uint8_t * pPayload; + uint8_t Length; +} MATTER_STM_Data_t; + +typedef struct +{ + MATTER_STM_Opcode_evt_t P2P_Evt_Opcode; + MATTER_STM_Data_t DataTransfered; + uint16_t ConnectionHandle; + uint8_t ServiceInstance; +} MATTER_App_Notification_evt_t; + +typedef struct +{ + uint8_t * Payload; + uint16_t Length; + uint16_t connid; +} BLE_Matter_RX; + +typedef struct +{ + uint16_t connid; + uint8_t notif; +} BLE_Matter_TXCharCCCD; + +typedef void (*BLEReceiveCallback)(BLE_Matter_RX * aMessage); +typedef void (*BLETXCharCCCDWriteCallback)(BLE_Matter_TXCharCCCD * aMessage); +typedef void (*BLEConnectionCallback)(void); +typedef void (*BLEDisconnectionCallback)(uint16_t * connid); +typedef void (*BLEDAckCallback)(uint16_t * connid); + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* External variables --------------------------------------------------------*/ +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/* Exported macros ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions ---------------------------------------------*/ +/* USER CODE BEGIN EF */ +void APP_MATTER_Init(void); +void APP_MATTER_Send_Notification(uint16_t datalength, uint8_t * data); +void APP_MATTER_Notification(MATTER_App_Notification_evt_t * pNotification); + +void APP_MATTER_BLE_Set_Connection_Callback(BLEConnectionCallback aCallback); +void APP_MATTER_BLE_Set_Disconnection_Callback(BLEDisconnectionCallback aCallback); +void APP_MATTER_BLE_Set_Receive_Callback(BLEReceiveCallback aCallback); +void APP_MATTER_BLE_Set_TXCharCCCDWrite_Callback(BLETXCharCCCDWriteCallback aCallback); +void APP_MATTER_BLE_Set_Ack_After_Indicate_Callback(BLEDAckCallback aCallback); +/* USER CODE END EF */ + +#ifdef __cplusplus +} +#endif + +#endif /*__APP_MATTER_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.c new file mode 100644 index 00000000000000..f917b8542fc4bf --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.c @@ -0,0 +1,665 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : App/app_thread.c + * Description : Thread Application. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_thread.h" +#include "app_common.h" +#include "app_conf.h" +#include "app_entry.h" +#include "cmsis_os.h" +#include "dbg_trace.h" +#include "openthread_api_wb.h" +#include "queue.h" +#include "shci.h" +#include "stm32_lpm.h" +#include "stm32wbxx_core_interface_def.h" +#include "stm_logging.h" +#include "utilities_common.h" + +/* Private includes -----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private defines -----------------------------------------------------------*/ +#define C_SIZE_CMD_STRING 256U +#define MO_NOTIF_QUEUE_SIZE 10 + +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +static osSemaphoreId_t TransferToM0Semaphore; +static osMutexId_t MtxThreadId; + +/* FreeRtos stacks attributes */ +const osThreadAttr_t ThreadMsgM0ToM4Process_attr = { .name = CFG_THREAD_MSG_M0_TO_M4_PROCESS_NAME, + .attr_bits = CFG_THREAD_MSG_M0_TO_M4_PROCESS_ATTR_BITS, + .cb_mem = CFG_THREAD_MSG_M0_TO_M4_PROCESS_CB_MEM, + .cb_size = CFG_THREAD_MSG_M0_TO_M4_PROCESS_CB_SIZE, + .stack_mem = CFG_THREAD_MSG_M0_TO_M4_PROCESS_STACK_MEM, + .priority = CFG_THREAD_MSG_M0_TO_M4_PROCESS_PRIORITY, + .stack_size = CFG_THREAD_MSG_M0_TO_M4_PROCESS_STACK_SIZE }; + +const osThreadAttr_t ThreadCliProcess_attr = { .name = CFG_THREAD_CLI_PROCESS_NAME, + .attr_bits = CFG_THREAD_CLI_PROCESS_ATTR_BITS, + .cb_mem = CFG_THREAD_CLI_PROCESS_CB_MEM, + .cb_size = CFG_THREAD_CLI_PROCESS_CB_SIZE, + .stack_mem = CFG_THREAD_CLI_PROCESS_STACK_MEM, + .priority = CFG_THREAD_CLI_PROCESS_PRIORITY, + .stack_size = CFG_THREAD_CLI_PROCESS_STACK_SIZE }; + +static volatile int FlagReceiveAckFromM0 = 0; +/* Private macros ------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private function prototypes -----------------------------------------------*/ +static void APP_THREAD_CheckWirelessFirmwareInfo(void); +static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode); +#if (CFG_FULL_LOW_POWER == 0) +static void Send_CLI_To_M0(void); +#endif /* (CFG_FULL_LOW_POWER == 0) */ +static void Send_CLI_Ack_For_OT(void); +static void HostTxCb(void); +static void Wait_Getting_Ack_From_M0(void); +static void Receive_Ack_From_M0(void); +static void Receive_Notification_From_M0(void); +static void APP_THREAD_FreeRTOSProcessMsgM0ToM4Task(void * argument); +static void Ot_Cmd_Transfer_Common(void); +#if (CFG_FULL_LOW_POWER == 0) +static void APP_THREAD_FreeRTOSSendCLIToM0Task(void * argument); +#endif /* (CFG_FULL_LOW_POWER == 0) */ +#if (CFG_FULL_LOW_POWER == 0) +static void RxCpltCallback(void); +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +/* USER CODE BEGIN PFP */ +/* USER CODE END PFP */ + +/* Private variables ---------------------------------------------------------*/ +#if (CFG_FULL_LOW_POWER == 0) +static uint8_t aRxBuffer[C_SIZE_CMD_STRING]; +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +#if (CFG_FULL_LOW_POWER == 0) +static uint8_t CommandString[C_SIZE_CMD_STRING]; +#endif /* (CFG_FULL_LOW_POWER == 0) */ +static __IO uint16_t indexReceiveChar = 0; +static __IO uint16_t CptReceiveCmdFromUser = 0; + +static TL_CmdPacket_t * p_thread_otcmdbuffer; +static TL_EvtPacket_t * p_thread_notif_M0_to_M4; +PLACE_IN_SECTION("MB_MEM1") ALIGN(4) static TL_TH_Config_t ThreadConfigBuffer; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadOtCmdBuffer; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t ThreadNotifRspEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255U]; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadCliCmdBuffer; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t ThreadCliNotBuffer; +extern uint8_t g_ot_notification_allowed; + +/* USER CODE BEGIN PV */ +static QueueHandle_t MoNotifQueue; +static osThreadId_t OsTaskMsgM0ToM4Id; /* Task managing the M0 to M4 messaging */ +#if (CFG_FULL_LOW_POWER == 0) +static osThreadId_t OsTaskCliId; /* Task used to manage CLI command */ +#endif /* (CFG_FULL_LOW_POWER == 0) */ +/* Debug */ +/* USER CODE END PV */ + +/* Functions Definition ------------------------------------------------------*/ + +void APP_THREAD_Init(void) +{ + /* USER CODE BEGIN APP_THREAD_INIT_1 */ + /* Do not allow stop mode before Thread is initialized */ + UTIL_LPM_SetStopMode(1 << CFG_LPM_APP_THREAD, UTIL_LPM_DISABLE); + /* USER CODE END APP_THREAD_INIT_1 */ + + SHCI_CmdStatus_t ThreadInitStatus; + + /* Check the compatibility with the Coprocessor Wireless Firmware loaded */ + APP_THREAD_CheckWirelessFirmwareInfo(); + + /* Register cmdbuffer */ + APP_THREAD_RegisterCmdBuffer(&ThreadOtCmdBuffer); + + /** + * Do not allow standby in the application + */ + UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_THREAD, UTIL_LPM_DISABLE); + + /* Init config buffer and call TL_THREAD_Init */ + APP_THREAD_TL_THREAD_INIT(); + + /* Configure UART for sending CLI command from M4 */ + // APP_THREAD_Init_UART_CLI(); Conflict with qspi gpio + /* Send Thread start system cmd to M0 */ + ThreadInitStatus = SHCI_C2_THREAD_Init(); + + /* Prevent unused argument(s) compilation warning */ + UNUSED(ThreadInitStatus); + + /* Semaphore */ + TransferToM0Semaphore = osSemaphoreNew(1, 0, NULL); + /* Initialize the mutex */ + MtxThreadId = osMutexNew(NULL); + + MoNotifQueue = xQueueCreate(MO_NOTIF_QUEUE_SIZE, sizeof(uint8_t)); + if (MoNotifQueue == NULL) + { + APP_DBG("Failed to allocate M0 notification queue"); + } + + /* Create the different FreeRTOS tasks requested to run this Thread application*/ + OsTaskMsgM0ToM4Id = osThreadNew(APP_THREAD_FreeRTOSProcessMsgM0ToM4Task, NULL, &ThreadMsgM0ToM4Process_attr); + + /* USER CODE BEGIN APP_THREAD_INIT_FREERTOS */ + /* USER CODE END APP_THREAD_INIT_FREERTOS */ + /* USER CODE BEGIN APP_THREAD_INIT_2 */ + /* USER CODE END APP_THREAD_INIT_2 */ +} + +/** + * @brief Trace the error or the warning reported. + * @param ErrId : + * @param ErrCode + * @retval None + */ +void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode) +{ + /* USER CODE BEGIN APP_THREAD_Error_1 */ + + /* USER CODE END APP_THREAD_Error_1 */ + switch (ErrId) + { + case ERR_REC_MULTI_MSG_FROM_M0: + APP_THREAD_TraceError("ERROR : ERR_REC_MULTI_MSG_FROM_M0 ", ErrCode); + break; + case ERR_THREAD_SET_STATE_CB: + APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_STATE_CB ", ErrCode); + break; + case ERR_THREAD_SET_CHANNEL: + APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_CHANNEL ", ErrCode); + break; + case ERR_THREAD_SET_PANID: + APP_THREAD_TraceError("ERROR : ERR_THREAD_SET_PANID ", ErrCode); + break; + case ERR_THREAD_IPV6_ENABLE: + APP_THREAD_TraceError("ERROR : ERR_THREAD_IPV6_ENABLE ", ErrCode); + break; + case ERR_THREAD_START: + APP_THREAD_TraceError("ERROR: ERR_THREAD_START ", ErrCode); + break; + case ERR_THREAD_ERASE_PERSISTENT_INFO: + APP_THREAD_TraceError("ERROR : ERR_THREAD_ERASE_PERSISTENT_INFO ", ErrCode); + break; + case ERR_THREAD_CHECK_WIRELESS: + APP_THREAD_TraceError("ERROR : ERR_THREAD_CHECK_WIRELESS ", ErrCode); + break; + /* USER CODE BEGIN APP_THREAD_Error_2 */ + case ERR_THREAD_COAP_START: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_START ", ErrCode); + break; + case ERR_THREAD_COAP_ADD_RESSOURCE: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_ADD_RESSOURCE ", ErrCode); + break; + case ERR_THREAD_MESSAGE_READ: + APP_THREAD_TraceError("ERROR : ERR_THREAD_MESSAGE_READ ", ErrCode); + break; + case ERR_THREAD_COAP_SEND_RESPONSE: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_RESPONSE ", ErrCode); + break; + case ERR_THREAD_COAP_APPEND: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_APPEND ", ErrCode); + break; + case ERR_THREAD_COAP_SEND_REQUEST: + APP_THREAD_TraceError("ERROR : ERR_THREAD_COAP_SEND_REQUEST ", ErrCode); + break; + case ERR_TIMER_INIT: + APP_THREAD_TraceError("ERROR : ERR_TIMER_INIT ", ErrCode); + break; + case ERR_TIMER_START: + APP_THREAD_TraceError("ERROR : ERR_TIMER_START ", ErrCode); + break; + /* USER CODE END APP_THREAD_Error_2 */ + default: + APP_THREAD_TraceError("ERROR Unknown ", 0); + break; + } +} + +/** + * @brief Perform initialization of CLI UART interface. + * @param None + * @retval None + */ +void APP_THREAD_Init_UART_CLI(void) +{ +#if (CFG_FULL_LOW_POWER == 0) + OsTaskCliId = osThreadNew(APP_THREAD_FreeRTOSSendCLIToM0Task, NULL, &ThreadCliProcess_attr); +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +#if (CFG_FULL_LOW_POWER == 0) + HW_UART_Init(CFG_CLI_UART); + HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1, RxCpltCallback); +#endif /* (CFG_FULL_LOW_POWER == 0) */ +} + +/** + * @brief Perform initialization of TL for THREAD. + * @param None + * @retval None + */ +void APP_THREAD_TL_THREAD_INIT(void) +{ + ThreadConfigBuffer.p_ThreadOtCmdRspBuffer = (uint8_t *) &ThreadOtCmdBuffer; + ThreadConfigBuffer.p_ThreadNotAckBuffer = (uint8_t *) ThreadNotifRspEvtBuffer; + ThreadConfigBuffer.p_ThreadCliRspBuffer = (uint8_t *) &ThreadCliCmdBuffer; + ThreadConfigBuffer.p_ThreadCliNotBuffer = (uint8_t *) &ThreadCliNotBuffer; + + TL_THREAD_Init(&ThreadConfigBuffer); +} + +/** + * @brief This function is used to transfer the Ot commands from the + * M4 to the M0. + * + * @param None + * @return None + */ +void Ot_Cmd_Transfer(void) +{ + Ot_Cmd_Transfer_Common(); +} + +/** + * @brief This function is used to transfer the Ot commands from the + * M4 to the M0 with Notification M0 to M4 allowed. + * + * @param None + * @return None + */ +void Ot_Cmd_TransferWithNotif(void) +{ + /* Flag to specify to UTIL_SEQ_EvtIdle that M0 to M4 notifications are allowed */ + g_ot_notification_allowed = 1U; + + Ot_Cmd_Transfer_Common(); +} + +/** + * @brief This function is called when acknowledge from OT command is received from the M0+. + * + * @param Otbuffer : a pointer to TL_EvtPacket_t + * @return None + */ +void TL_OT_CmdEvtReceived(TL_EvtPacket_t * Otbuffer) +{ + /* Prevent unused argument(s) compilation warning */ + UNUSED(Otbuffer); + + Receive_Ack_From_M0(); + + /* Does not allow OpenThread M0 to M4 notification */ + g_ot_notification_allowed = 0U; +} + +/** + * @brief This function is called when notification from M0+ is received. + * + * @param Notbuffer : a pointer to TL_EvtPacket_t + * @return None + */ +void TL_THREAD_NotReceived(TL_EvtPacket_t * Notbuffer) +{ + p_thread_notif_M0_to_M4 = Notbuffer; + + Receive_Notification_From_M0(); +} + +/** + * @brief This function is called when notification on CLI TL Channel from M0+ is received. + * + * @param Notbuffer : a pointer to TL_EvtPacket_t + * @return None + */ +void TL_THREAD_CliNotReceived(TL_EvtPacket_t * Notbuffer) +{ + TL_CmdPacket_t * l_CliBuffer = (TL_CmdPacket_t *) Notbuffer; + uint8_t l_size = l_CliBuffer->cmdserial.cmd.plen; + + /* WORKAROUND: if string to output is "> " then respond directly to M0 and do not output it */ + if (strcmp((const char *) l_CliBuffer->cmdserial.cmd.payload, "> ") != 0) + { + /* Write to CLI UART */ + HW_UART_Transmit_IT(CFG_CLI_UART, l_CliBuffer->cmdserial.cmd.payload, l_size, HostTxCb); + } + else + { + Send_CLI_Ack_For_OT(); + } +} + +/** + * @brief This function is called before sending any ot command to the M0 + * core. The purpose of this function is to be able to check if + * there are no notifications coming from the M0 core which are + * pending before sending a new ot command. + * @param None + * @retval None + */ +void Pre_OtCmdProcessing(void) +{ + osMutexAcquire(MtxThreadId, osWaitForever); +} + +void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t * p_buffer) +{ + p_thread_otcmdbuffer = p_buffer; +} + +Thread_OT_Cmd_Request_t * THREAD_Get_OTCmdPayloadBuffer(void) +{ + return (Thread_OT_Cmd_Request_t *) p_thread_otcmdbuffer->cmdserial.cmd.payload; +} + +Thread_OT_Cmd_Request_t * THREAD_Get_OTCmdRspPayloadBuffer(void) +{ + return (Thread_OT_Cmd_Request_t *) ((TL_EvtPacket_t *) p_thread_otcmdbuffer)->evtserial.evt.payload; +} + +Thread_OT_Cmd_Request_t * THREAD_Get_NotificationPayloadBuffer(void) +{ + return (Thread_OT_Cmd_Request_t *) (p_thread_notif_M0_to_M4)->evtserial.evt.payload; +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ + +/** + * @brief Warn the user that an error has occurred.In this case, + * the LEDs on the Board will start blinking. + * + * @param pMess : Message associated to the error. + * @param ErrCode: Error code associated to the module (OpenThread or other module if any) + * @retval None + */ +static void APP_THREAD_TraceError(const char * pMess, uint32_t ErrCode) +{ + /* USER CODE BEGIN TRACE_ERROR */ + APP_DBG("**** Fatal error = %s (Err = %d)", pMess, ErrCode); + while (1U == 1U) + { + HAL_Delay(500U); + } + /* USER CODE END TRACE_ERROR */ +} + +/** + * @brief Check if the Coprocessor Wireless Firmware loaded supports Thread + * and display associated information + * @param None + * @retval None + */ +static void APP_THREAD_CheckWirelessFirmwareInfo(void) +{ + WirelessFwInfo_t wireless_info_instance; + WirelessFwInfo_t * p_wireless_info = &wireless_info_instance; + + if (SHCI_GetWirelessFwInfo(p_wireless_info) != SHCI_Success) + { + APP_THREAD_Error((uint32_t) ERR_THREAD_CHECK_WIRELESS, (uint32_t) ERR_INTERFACE_FATAL); + } + else + { + APP_DBG("**********************************************************"); + APP_DBG("WIRELESS COPROCESSOR FW:"); + /* Print version */ + APP_DBG("VERSION ID = %d.%d.%d", p_wireless_info->VersionMajor, p_wireless_info->VersionMinor, p_wireless_info->VersionSub); + + switch (p_wireless_info->StackType) + { + case INFO_STACK_TYPE_THREAD_FTD: + APP_DBG("FW Type : Thread FTD"); + break; + case INFO_STACK_TYPE_THREAD_MTD: + APP_DBG("FW Type : Thread MTD"); + break; + case INFO_STACK_TYPE_BLE_THREAD_FTD_DYAMIC: + APP_DBG("FW Type : Dynamic Concurrent Mode BLE/Thread"); + break; + // case INFO_STACK_TYPE_BLE_THREAD_FOR_MATTER: + // APP_DBG("FW Type : Dynamic Concurrent Mode BLE/Thread for Matter ") + // ; + // break; + default: + /* No Thread device supported ! */ + APP_THREAD_Error((uint32_t) ERR_THREAD_CHECK_WIRELESS, (uint32_t) ERR_INTERFACE_FATAL); + break; + } + APP_DBG("**********************************************************"); + } +} + +/************************************************************* + * + * FREERTOS WRAPPER FUNCTIONS + * + *************************************************************/ +static void APP_THREAD_FreeRTOSProcessMsgM0ToM4Task(void * argument) +{ + UNUSED(argument); + uint8_t NotUsed = 0; + for (;;) + { + /* USER CODE BEGIN APP_THREAD_FREERTOS_PROCESS_MSG_M0_TO_M4_1 */ + + /* USER END END APP_THREAD_FREERTOS_PROCESS_MSG_M0_TO_M4_1 */ + xQueueReceive(MoNotifQueue, &NotUsed, portMAX_DELAY); + + if (uxQueueMessagesWaiting(MoNotifQueue) > 1U) + { + APP_THREAD_Error(ERR_REC_MULTI_MSG_FROM_M0, 0); + } + else + { + OpenThread_CallBack_Processing(); + } + /* USER CODE BEGIN APP_THREAD_FREERTOS_PROCESS_MSG_M0_TO_M4_2 */ + + /* USER END END APP_THREAD_FREERTOS_PROCESS_MSG_M0_TO_M4_2 */ + } +} + +#if (CFG_FULL_LOW_POWER == 0) +static void APP_THREAD_FreeRTOSSendCLIToM0Task(void * argument) +{ + UNUSED(argument); + for (;;) + { + /* USER CODE BEGIN APP_THREAD_FREERTOS_SEND_CLI_TO_M0_1 */ + + /* USER END END APP_THREAD_FREERTOS_SEND_CLI_TO_M0_1 */ + osThreadFlagsWait(1, osFlagsWaitAll, osWaitForever); + Send_CLI_To_M0(); + /* USER CODE BEGIN APP_THREAD_FREERTOS_SEND_CLI_TO_M0_2 */ + + /* USER END END APP_THREAD_FREERTOS_SEND_CLI_TO_M0_2 */ + } +} +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +/* USER CODE BEGIN FREERTOS_WRAPPER_FUNCTIONS */ +/* USER CODE END FREERTOS_WRAPPER_FUNCTIONS */ + +/* USER CODE BEGIN FD_LOCAL_FUNCTIONS */ + +/* USER CODE END FD_LOCAL_FUNCTIONS */ + +/************************************************************* + * + * WRAP FUNCTIONS + * + *************************************************************/ +static void Ot_Cmd_Transfer_Common(void) +{ + /* OpenThread OT command cmdcode range 0x280 .. 0x3DF = 352 */ + p_thread_otcmdbuffer->cmdserial.cmd.cmdcode = 0x280U; + /* Size = otCmdBuffer->Size (Number of OT cmd arguments : 1 arg = 32bits so multiply by 4 to get size in bytes) + * + ID (4 bytes) + Size (4 bytes) */ + uint32_t l_size = ((Thread_OT_Cmd_Request_t *) (p_thread_otcmdbuffer->cmdserial.cmd.payload))->Size * 4U + 8U; + p_thread_otcmdbuffer->cmdserial.cmd.plen = l_size; + + TL_OT_SendCmd(); + + /* Wait completion of cmd */ + Wait_Getting_Ack_From_M0(); +} + +/** + * @brief This function waits for getting an acknowledgment from the M0. + * + * @param None + * @retval None + */ +static void Wait_Getting_Ack_From_M0(void) +{ + while (FlagReceiveAckFromM0 == 0) + { + } + FlagReceiveAckFromM0 = 0; + osMutexRelease(MtxThreadId); + // osSemaphoreAcquire( TransferToM0Semaphore, osWaitForever ); +} + +/** + * @brief Receive an acknowledgment from the M0+ core. + * Each command send by the M4 to the M0 are acknowledged. + * This function is called under interrupt. + * @param None + * @retval None + */ +static void Receive_Ack_From_M0(void) +{ + FlagReceiveAckFromM0 = 1; + // osSemaphoreRelease( TransferToM0Semaphore); +} + +/** + * @brief Receive a notification from the M0+ through the IPCC. + * This function is called under interrupt. + * @param None + * @retval None + */ +static void Receive_Notification_From_M0(void) +{ + /* The xHigherPriorityTaskWoken parameter must be initialized to pdFALSE as + it will get set to pdTRUE inside the interrupt safe API function if a + context switch is required. */ + BaseType_t xHigherPriorityTaskWoken = pdFALSE; + + uint8_t NotUsed = 0; + xQueueSendToFrontFromISR(MoNotifQueue, &NotUsed, &xHigherPriorityTaskWoken); + + /* Pass the xHigherPriorityTaskWoken value into portEND_SWITCHING_ISR(). If + xHigherPriorityTaskWoken was set to pdTRUE inside xSemaphoreGiveFromISR() + then calling portEND_SWITCHING_ISR() will request a context switch. If + xHigherPriorityTaskWoken is still pdFALSE then calling + portEND_SWITCHING_ISR() will have no effect */ + portEND_SWITCHING_ISR(xHigherPriorityTaskWoken); +} + +#if (CFG_FULL_LOW_POWER == 0) +static void RxCpltCallback(void) +{ + /* Filling buffer and wait for '\r' char */ + if (indexReceiveChar < C_SIZE_CMD_STRING) + { + CommandString[indexReceiveChar++] = aRxBuffer[0]; + if (aRxBuffer[0] == '\r') + { + CptReceiveCmdFromUser = 1U; + + /* UART task scheduling*/ + osThreadFlagsSet(OsTaskCliId, 1); + } + } + + /* Once a character has been sent, put back the device in reception mode */ + HW_UART_Receive_IT(CFG_CLI_UART, aRxBuffer, 1U, RxCpltCallback); +} +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +#if (CFG_FULL_LOW_POWER == 0) +/** + * @brief Process sends receive CLI command to M0. + * @param None + * @retval None + */ +static void Send_CLI_To_M0(void) +{ + memset(ThreadCliCmdBuffer.cmdserial.cmd.payload, 0x0U, 255U); + memcpy(ThreadCliCmdBuffer.cmdserial.cmd.payload, CommandString, indexReceiveChar); + ThreadCliCmdBuffer.cmdserial.cmd.plen = indexReceiveChar; + ThreadCliCmdBuffer.cmdserial.cmd.cmdcode = 0x0; + + /* Clear receive buffer, character counter and command complete */ + CptReceiveCmdFromUser = 0; + indexReceiveChar = 0; + memset(CommandString, 0, C_SIZE_CMD_STRING); + + TL_CLI_SendCmd(); +} +#endif /* (CFG_FULL_LOW_POWER == 0) */ + +/** + * @brief Send notification for CLI TL Channel. + * @param None + * @retval None + */ +static void Send_CLI_Ack_For_OT(void) +{ + + /* Notify M0 that characters have been sent to UART */ + TL_THREAD_CliSendAck(); +} + +/** + * @brief End of transfer callback for CLI UART sending. + * + * @param Notbuffer : a pointer to TL_EvtPacket_t + * @return None + */ +static void HostTxCb(void) +{ + Send_CLI_Ack_For_OT(); +} + +/* USER CODE BEGIN FD_WRAP_FUNCTIONS */ + +/* USER CODE END FD_WRAP_FUNCTIONS */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.h new file mode 100644 index 00000000000000..512b3bcd544538 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/app_thread.h @@ -0,0 +1,132 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : App/app_thread.h + * Description : Header for Thread Application. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef APP_THREAD_H +#define APP_THREAD_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* Private includes ----------------------------------------------------------*/ +#include "stm32wbxx_core_interface_def.h" +#include "tl.h" +#include "tl_thread_hci.h" + +/* OpenThread Library */ +#include OPENTHREAD_CONFIG_FILE + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ + +/* Thread application generic defines */ +/*------------------------------------*/ +typedef enum +{ + APP_THREAD_LIMITED, + APP_THREAD_FULL, +} APP_THREAD_InitMode_t; + +/* ipv6-addressing defines */ +/*------------------------------------*/ +/* Key Point: A major difference between FTDs and MTDs are that FTDs subscribe to the ff03::2 multicast address. + * MTDs do not. */ + +#define MULICAST_FTD_MED "ff03::1" +#define MULICAST_FTD_BORDER_ROUTER "ff03::2" + +/* Application errors */ +/*------------------------------------*/ + +/* + * List of all errors tracked by the Thread application + * running on M4. Some of these errors may be fatal + * or just warnings + */ +typedef enum +{ + ERR_REC_MULTI_MSG_FROM_M0, + ERR_THREAD_SET_STATE_CB, + ERR_THREAD_SET_CHANNEL, + ERR_THREAD_SET_PANID, + ERR_THREAD_IPV6_ENABLE, + ERR_THREAD_START, + ERR_THREAD_ERASE_PERSISTENT_INFO, + ERR_THREAD_SET_NETWORK_KEY, + /* USER CODE BEGIN ERROR_APPLI_ENUM */ + ERR_THREAD_COAP_START, + ERR_THREAD_COAP_ADD_RESSOURCE, + ERR_THREAD_MESSAGE_READ, + ERR_THREAD_COAP_SEND_RESPONSE, + ERR_THREAD_COAP_APPEND, + ERR_THREAD_COAP_SEND_REQUEST, + ERR_THREAD_SETUP, + ERR_THREAD_LINK_MODE, + ERR_TIMER_INIT, + ERR_TIMER_START, + ERR_THREAD_COAP_NEW_MSG, + ERR_THREAD_COAP_ADDRESS_NOT_DEFINED, + ERR_THREAD_STOP, + /* USER CODE END ERROR_APPLI_ENUM */ + ERR_THREAD_CHECK_WIRELESS +} ErrAppliIdEnum_t; +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* External variables --------------------------------------------------------*/ +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/* Exported macros ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions ------------------------------------------------------- */ +void APP_THREAD_Init(void); +void APP_THREAD_Error(uint32_t ErrId, uint32_t ErrCode); +void APP_THREAD_RegisterCmdBuffer(TL_CmdPacket_t * p_buffer); +void APP_THREAD_ProcessMsgM0ToM4(void); +void APP_THREAD_Init_UART_CLI(void); +void APP_THREAD_TL_THREAD_INIT(void); +void APP_THREAD_SEND_MSG(void); +/* **** */ +void APP_THREAD_Stop(void); +void APP_THREAD_CleanCallbacks(void); + +/* USER CODE BEGIN EF */ + +/* USER CODE END EF */ + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* APP_THREAD_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h new file mode 100644 index 00000000000000..9cdee1a82cc217 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_conf.h @@ -0,0 +1,68 @@ +/** + ****************************************************************************** + * File Name : App/ble_conf.h + * Description : Configuration file for BLE Middleware. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef BLE_CONF_H +#define BLE_CONF_H + +#include "app_conf.h" + +/****************************************************************************** + * + * BLE SERVICES CONFIGURATION + * blesvc + * + ******************************************************************************/ + +/** + * This setting shall be set to '1' if the device needs to support the Peripheral Role + * In the MS configuration, both BLE_CFG_PERIPHERAL and BLE_CFG_CENTRAL shall be set to '1' + */ +#define BLE_CFG_PERIPHERAL 1 + +/** + * This setting shall be set to '1' if the device needs to support the Central Role + * In the MS configuration, both BLE_CFG_PERIPHERAL and BLE_CFG_CENTRAL shall be set to '1' + */ +#define BLE_CFG_CENTRAL 0 + +/** + * There is one handler per service enabled + * Note: There is no handler for the Device Information Service + * + * This shall take into account all registered handlers + * (from either the provided services or the custom services) + */ +#define BLE_CFG_SVC_MAX_NBR_CB 3 + +#define BLE_CFG_CLT_MAX_NBR_CB 0 + +/****************************************************************************** + * GAP Service - Appearance + ******************************************************************************/ + +#define BLE_CFG_UNKNOWN_APPEARANCE (0) +#define BLE_CFG_HR_SENSOR_APPEARANCE (832) +#define BLE_CFG_GAP_APPEARANCE (BLE_CFG_UNKNOWN_APPEARANCE) + +/****************************************************************************** + * Over The Air Feature (OTA) - STM Proprietary + ******************************************************************************/ +#define BLE_CFG_OTA_REBOOT_CHAR 0 /**< REBOOT OTA MODE CHARACTERISTIC */ + +#endif /*BLE_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_dbg_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_dbg_conf.h new file mode 100644 index 00000000000000..0951cc1372a405 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/ble_dbg_conf.h @@ -0,0 +1,196 @@ +/** + ****************************************************************************** + * File Name : App/ble_dbg_conf.h + * Description : Debug configuration file for BLE Middleware. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __BLE_DBG_CONF_H +#define __BLE_DBG_CONF_H + +/** + * Enable or Disable traces from BLE + */ + +#define BLE_DBG_APP_EN 0 +#define BLE_DBG_DIS_EN 0 +#define BLE_DBG_HRS_EN 0 +#define BLE_DBG_SVCCTL_EN 0 +#define BLE_DBG_BLS_EN 0 +#define BLE_DBG_HTS_EN 0 +#define BLE_DBG_P2P_STM_EN 1 + +/** + * Macro definition + */ +#if (BLE_DBG_APP_EN != 0) +#define BLE_DBG_APP_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_APP_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_DIS_EN != 0) +#define BLE_DBG_DIS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_DIS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_HRS_EN != 0) +#define BLE_DBG_HRS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_HRS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_P2P_STM_EN != 0) +#define BLE_DBG_P2P_STM_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_P2P_STM_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_TEMPLATE_STM_EN != 0) +#define BLE_DBG_TEMPLATE_STM_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_TEMPLATE_STM_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_EDS_STM_EN != 0) +#define BLE_DBG_EDS_STM_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_EDS_STM_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_LBS_STM_EN != 0) +#define BLE_DBG_LBS_STM_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_LBS_STM_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_SVCCTL_EN != 0) +#define BLE_DBG_SVCCTL_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_SVCCTL_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_CTS_EN != 0) +#define BLE_DBG_CTS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_CTS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_HIDS_EN != 0) +#define BLE_DBG_HIDS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_HIDS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_PASS_EN != 0) +#define BLE_DBG_PASS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_PASS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_BLS_EN != 0) +#define BLE_DBG_BLS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_BLS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_HTS_EN != 0) +#define BLE_DBG_HTS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_HTS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_ANS_EN != 0) +#define BLE_DBG_ANS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_ANS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_ESS_EN != 0) +#define BLE_DBG_ESS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_ESS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_GLS_EN != 0) +#define BLE_DBG_GLS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_GLS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_BAS_EN != 0) +#define BLE_DBG_BAS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_BAS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_RTUS_EN != 0) +#define BLE_DBG_RTUS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_RTUS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_HPS_EN != 0) +#define BLE_DBG_HPS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_HPS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_TPS_EN != 0) +#define BLE_DBG_TPS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_TPS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_LLS_EN != 0) +#define BLE_DBG_LLS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_LLS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_IAS_EN != 0) +#define BLE_DBG_IAS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_IAS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_WSS_EN != 0) +#define BLE_DBG_WSS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_WSS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_LNS_EN != 0) +#define BLE_DBG_LNS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_LNS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_SCPS_EN != 0) +#define BLE_DBG_SCPS_MSG PRINT_MESG_DBG +#else +#define BLE_DBG_SCPS_MSG PRINT_NO_MESG +#endif + +#if (BLE_DBG_DTS_EN != 0) +#define BLE_DBG_DTS_MSG PRINT_MESG_DBG +#define BLE_DBG_DTS_BUF PRINT_LOG_BUFF_DBG +#else +#define BLE_DBG_DTS_MSG PRINT_NO_MESG +#define BLE_DBG_DTS_BUF PRINT_NO_MESG +#endif + +#endif /*__BLE_DBG_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c new file mode 100644 index 00000000000000..a4e4a492cbc360 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.c @@ -0,0 +1,261 @@ +/** + ****************************************************************************** + * @file custom_stm.c + * @author MCD Application Team + * @brief matter Service using gatt(Custom STM) + ****************************************************************************** + * @attention + * + * Copyright (c) 2018-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_matter.h" +#include "common_blesvc.h" + +/* Private typedef -----------------------------------------------------------*/ +typedef struct +{ + uint16_t PeerToPeerSvcHdle; /**< Service handle */ + uint16_t P2PWriteClientToServerCharHdle; /**< Characteristic handle */ + uint16_t P2PNotifyServerToClientCharHdle; /**< Characteristic handle */ +} PeerToPeerContext_t; + +/* Private defines -----------------------------------------------------------*/ +#define UUID_128_SUPPORTED 1 + +#if (UUID_128_SUPPORTED == 1) +#define BM_UUID_LENGTH UUID_TYPE_128 +#else +#define BM_UUID_LENGTH UUID_TYPE_16 +#endif + +#define BM_REQ_CHAR_SIZE (3) + +/* Private macros ------------------------------------------------------------*/ + +/* Private variables ---------------------------------------------------------*/ + +MATTER_App_Notification_evt_t Notification; + +/** + * START of Section BLE_DRIVER_CONTEXT + */ +PLACE_IN_SECTION("BLE_DRIVER_CONTEXT") static PeerToPeerContext_t aPeerToPeerContext; + +/** + * END of Section BLE_DRIVER_CONTEXT + */ +/* Private function prototypes -----------------------------------------------*/ +static SVCCTL_EvtAckStatus_t Matter_Event_Handler(void * Event); + +/* Functions Definition ------------------------------------------------------*/ +/* Private functions ----------------------------------------------------------*/ + +#define COPY_UUID_128(uuid_struct, uuid_15, uuid_14, uuid_13, uuid_12, uuid_11, uuid_10, uuid_9, uuid_8, uuid_7, uuid_6, uuid_5, \ + uuid_4, uuid_3, uuid_2, uuid_1, uuid_0) \ + do \ + { \ + uuid_struct[0] = uuid_0; \ + uuid_struct[1] = uuid_1; \ + uuid_struct[2] = uuid_2; \ + uuid_struct[3] = uuid_3; \ + uuid_struct[4] = uuid_4; \ + uuid_struct[5] = uuid_5; \ + uuid_struct[6] = uuid_6; \ + uuid_struct[7] = uuid_7; \ + uuid_struct[8] = uuid_8; \ + uuid_struct[9] = uuid_9; \ + uuid_struct[10] = uuid_10; \ + uuid_struct[11] = uuid_11; \ + uuid_struct[12] = uuid_12; \ + uuid_struct[13] = uuid_13; \ + uuid_struct[14] = uuid_14; \ + uuid_struct[15] = uuid_15; \ + } while (0) + +/* Hardware Characteristics Service */ + +#define MATTER_SERVICE_UUID (0xFFF6) +#define COPY_CHAR_RX_UUID(uuid_struct) \ + COPY_UUID_128(uuid_struct, 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D, 0x11) +#define COPY_CHAR_TX_UUID(uuid_struct) \ + COPY_UUID_128(uuid_struct, 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, 0x9D, 0x12) +#define COPY_CHAR_ADDCOMMISSIONING_UUID(uuid_struct) \ + COPY_UUID_128(uuid_struct, 0x64, 0x63, 0x02, 0x38, 0x87, 0x72, 0x45, 0xF2, 0xB8, 0x7D, 0x74, 0x8A, 0x83, 0x21, 0x8F, 0x04) + +/* Public functions ----------------------------------------------------------*/ +/** + * @brief Service initialization + * @param None + * @retval None + */ +void SVCCTL_InitCustomSvc(void) +{ + + Char_UUID_t uuid16; + + /** + * Register the event handler to the BLE controller + */ + SVCCTL_RegisterSvcHandler(Matter_Event_Handler); + + /** + * Peer To Peer Service + * + * Max_Attribute_Records = 2*no_of_char + 1 + * service_max_attribute_record = 1 for Peer To Peer service + + * 2 for P2P Write characteristic + + * 2 for P2P Notify characteristic + + * 1 for client char configuration descriptor + + * + */ + + uint16_t uuid = MATTER_SERVICE_UUID; + + aci_gatt_add_service(UUID_TYPE_16, (Service_UUID_t *) &uuid, PRIMARY_SERVICE, 8, &(aPeerToPeerContext.PeerToPeerSvcHdle)); + + /** + * Add RX Characteristic + */ + COPY_CHAR_RX_UUID(uuid16.Char_UUID_128); + aci_gatt_add_char(aPeerToPeerContext.PeerToPeerSvcHdle, UUID_TYPE_128, &uuid16, 247, CHAR_PROP_WRITE, ATTR_PERMISSION_NONE, + GATT_NOTIFY_ATTRIBUTE_WRITE | GATT_NOTIFY_WRITE_REQ_AND_WAIT_FOR_APPL_RESP, /* gattEvtMask */ + 10, /* encryKeySize */ + 1, /* isVariable */ + &(aPeerToPeerContext.P2PWriteClientToServerCharHdle)); + + /** + * Add notification Characteristic + */ + + COPY_CHAR_TX_UUID(uuid16.Char_UUID_128); + aci_gatt_add_char(aPeerToPeerContext.PeerToPeerSvcHdle, UUID_TYPE_128, &uuid16, 247, CHAR_PROP_INDICATE, ATTR_PERMISSION_NONE, + GATT_NOTIFY_ATTRIBUTE_WRITE, /* gattEvtMask */ + 10, /* encryKeySize */ + 1, /* isVariable: 1 */ + &(aPeerToPeerContext.P2PNotifyServerToClientCharHdle)); + + return; +} + +/** + * @brief Characteristic update + * @param UUID: UUID of the characteristic + * @param Service_Instance: Instance of the service to which the characteristic belongs + * + */ +tBleStatus CUSTOM_STM_App_Update_Char(uint16_t UUID, uint8_t * pPayload, uint16_t Length) +{ + tBleStatus result = BLE_STATUS_INVALID_PARAMS; + switch (UUID) + { + case P2P_NOTIFY_CHAR_UUID: + + result = aci_gatt_update_char_value(aPeerToPeerContext.PeerToPeerSvcHdle, + aPeerToPeerContext.P2PNotifyServerToClientCharHdle, 0, /* charValOffset */ + Length, /* charValueLen */ + (uint8_t *) pPayload); + + break; + + default: + break; + } + + return result; +} + +/* Private functions ----------------------------------------------------------*/ + +/** + * @brief Event handler + * @param Event: Address of the buffer holding the Event + * @retval Ack: Return whether the Event has been managed or not + */ +static SVCCTL_EvtAckStatus_t Matter_Event_Handler(void * Event) +{ + SVCCTL_EvtAckStatus_t return_value; + hci_event_pckt * event_pckt; + evt_blecore_aci * blecore_evt; + aci_gatt_attribute_modified_event_rp0 * attribute_modified; + + return_value = SVCCTL_EvtNotAck; + event_pckt = (hci_event_pckt *) (((hci_uart_pckt *) Event)->data); + + switch (event_pckt->evt) + { + case HCI_VENDOR_SPECIFIC_DEBUG_EVT_CODE: { + blecore_evt = (evt_blecore_aci *) event_pckt->data; + switch (blecore_evt->ecode) + { + case ACI_GATT_SERVER_CONFIRMATION_VSEVT_CODE: { + attribute_modified = (aci_gatt_attribute_modified_event_rp0 *) blecore_evt->data; + Notification.P2P_Evt_Opcode = MATTER_STM_ACK_INDICATE_EVT; + Notification.ConnectionHandle = attribute_modified->Connection_Handle; + APP_MATTER_Notification(&Notification); + } + case ACI_GATT_ATTRIBUTE_MODIFIED_VSEVT_CODE: { + attribute_modified = (aci_gatt_attribute_modified_event_rp0 *) blecore_evt->data; + if (attribute_modified->Attr_Handle == (aPeerToPeerContext.P2PNotifyServerToClientCharHdle + 2)) + { + /** + * Descriptor handle + */ + return_value = SVCCTL_EvtAckFlowEnable; + APP_DBG_MSG("Subscribe for c2 notification\n"); + /** + * Indicate to application + */ + if (attribute_modified->Attr_Data[0] & COMSVC_Indication) + { + Notification.P2P_Evt_Opcode = MATTER_STM_INDICATE_ENABLED_EVT; + Notification.ConnectionHandle = attribute_modified->Connection_Handle; + APP_MATTER_Notification(&Notification); + } + else + { + Notification.P2P_Evt_Opcode = MATTER_STM_INDICATE_DISABLED_EVT; + Notification.ConnectionHandle = attribute_modified->Connection_Handle; + APP_MATTER_Notification(&Notification); + } + } + + else if (attribute_modified->Attr_Handle == (aPeerToPeerContext.P2PWriteClientToServerCharHdle + 1)) + { + Notification.P2P_Evt_Opcode = MATTER_STM_WRITE_EVT; + Notification.DataTransfered.Length = attribute_modified->Attr_Data_Length; + Notification.DataTransfered.pPayload = attribute_modified->Attr_Data; + Notification.ConnectionHandle = attribute_modified->Connection_Handle; + APP_MATTER_Notification(&Notification); + } + } + break; + case ACI_GATT_WRITE_PERMIT_REQ_VSEVT_CODE: { + aci_gatt_write_permit_req_event_rp0 * write_perm_req; + write_perm_req = (aci_gatt_write_permit_req_event_rp0 *) blecore_evt->data; + aci_gatt_write_resp(write_perm_req->Connection_Handle, write_perm_req->Attribute_Handle, + 0x00, /* write_status = 0 (no error))*/ + 0x00, /* err_code */ + write_perm_req->Data_Length, (uint8_t *) &(write_perm_req->Data[0])); + } + break; + default: + break; + } + } + break; /* HCI_HCI_VENDOR_SPECIFIC_DEBUG_EVT_CODE_SPECIFIC */ + + default: + break; + } + + return (return_value); +} /* end SVCCTL_EvtAckStatus_t */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h new file mode 100644 index 00000000000000..a4627c05ae9223 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/custom_stm.h @@ -0,0 +1,134 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file custom_stm.h + * @author MCD Application Team + * @brief Header for custom_stm.c module. + ****************************************************************************** + * @attention + * + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef CUSTOM_STM_H +#define CUSTOM_STM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ +#include +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +typedef enum +{ + /* My_P2P_Server */ + CUSTOM_STM_LED_C, + CUSTOM_STM_SWITCH_C, + /* My_Heart_Rate */ + CUSTOM_STM_HRS_M, + CUSTOM_STM_HRS_SL, + CUSTOM_STM_HRS_CTRLP, +} Custom_STM_Char_Opcode_t; + +typedef enum +{ + /* My_LED_Char */ + CUSTOM_STM_LED_C_READ_EVT, + CUSTOM_STM_LED_C_WRITE_NO_RESP_EVT, + /* My_Switch_Char */ + CUSTOM_STM_SWITCH_C_NOTIFY_ENABLED_EVT, + CUSTOM_STM_SWITCH_C_NOTIFY_DISABLED_EVT, + /* My_HRS_Meas */ + CUSTOM_STM_HRS_M_NOTIFY_ENABLED_EVT, + CUSTOM_STM_HRS_M_NOTIFY_DISABLED_EVT, + /* My_Sensor_Loc */ + CUSTOM_STM_HRS_SL_READ_EVT, + /* My_HRS_CTRL_Point */ + CUSTOM_STM_HRS_CTRLP_WRITE_EVT, + + CUSTOM_STM_BOOT_REQUEST_EVT +} Custom_STM_Opcode_evt_t; + +typedef struct +{ + uint8_t * pPayload; + uint8_t Length; +} Custom_STM_Data_t; + +typedef struct +{ + Custom_STM_Opcode_evt_t Custom_Evt_Opcode; + Custom_STM_Data_t DataTransfered; + uint16_t ConnectionHandle; + uint8_t ServiceInstance; +} Custom_STM_App_Notification_evt_t; + +/* USER CODE BEGIN ET */ +typedef enum +{ + CUSTOM_STM_HRS_HRM_VALUE_FORMAT_UINT16 = 1, + CUSTOM_STM_HRS_HRM_SENSOR_CONTACTS_PRESENT = 2, + CUSTOM_STM_HRS_HRM_SENSOR_CONTACTS_SUPPORTED = 4, + CUSTOM_STM_HRS_HRM_ENERGY_EXPENDED_PRESENT = 8, + CUSTOM_STM_HRS_HRM_RR_INTERVAL_PRESENT = 0x10 +} Custom_STM_HRS_HrmFlags_t; + +typedef enum +{ + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_OTHER = 0, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_CHEST = 1, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_WRIST = 2, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_FINGER = 3, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_HAND = 4, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_EAR_LOBE = 5, + CUSTOM_STM_HRS_BODY_SENSOR_LOCATION_FOOT = 6 +} Custom_STM_HRS_BodySensorLocation_t; + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +extern uint8_t SizeLed_C; +extern uint8_t SizeSwitch_C; +extern uint8_t SizeHrs_M; +extern uint8_t SizeHrs_Sl; +extern uint8_t SizeHrs_Ctrlp; + +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* External variables --------------------------------------------------------*/ +/* USER CODE BEGIN EV */ + +/* USER CODE END EV */ + +/* Exported macros -----------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions ------------------------------------------------------- */ +void SVCCTL_InitCustomSvc(void); +tBleStatus CUSTOM_STM_App_Update_Char(uint16_t UUID, uint8_t * pPayload, uint16_t Length); +/* USER CODE BEGIN EF */ + +/* USER CODE END EF */ + +#ifdef __cplusplus +} +#endif + +#endif /*CUSTOM_STM_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/tl_dbg_conf.h b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/tl_dbg_conf.h new file mode 100644 index 00000000000000..4a56cfea5fc562 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/App/tl_dbg_conf.h @@ -0,0 +1,123 @@ +/** + ****************************************************************************** + * File Name : tl_dbg_conf.h + * Description : Debug configuration file for stm32wpan transport layer interface. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __TL_DBG_CONF_H +#define __TL_DBG_CONF_H + +/* USER CODE BEGIN Tl_Conf */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_conf.h" /* required as some configuration used in dbg_trace.h are set there */ +#include "dbg_trace.h" +#include "hw_if.h" + +/** + * Enable or Disable traces + * The raw data output is the hci binary packet format as specified by the BT specification * + */ +#define TL_SHCI_CMD_DBG_EN 0 /* Reports System commands sent to CPU2 and the command response */ +#define TL_SHCI_CMD_DBG_RAW_EN 0 /* Reports raw data System commands sent to CPU2 and the command response */ +#define TL_SHCI_EVT_DBG_EN 0 /* Reports System Asynchronous Events received from CPU2 */ +#define TL_SHCI_EVT_DBG_RAW_EN 0 /* Reports raw data System Asynchronous Events received from CPU2 */ + +#define TL_HCI_CMD_DBG_EN 0 /* Reports BLE command sent to CPU2 and the command response */ +#define TL_HCI_CMD_DBG_RAW_EN 0 /* Reports raw data BLE command sent to CPU2 and the command response */ +#define TL_HCI_EVT_DBG_EN 0 /* Reports BLE Asynchronous Events received from CPU2 */ +#define TL_HCI_EVT_DBG_RAW_EN 0 /* Reports raw data BLE Asynchronous Events received from CPU2 */ + +#define TL_MM_DBG_EN 0 /* Reports the information of the buffer released to CPU2 */ + +/** + * Macro definition + */ + +/** + * System Transport Layer + */ +#if (TL_SHCI_CMD_DBG_EN != 0) +#define TL_SHCI_CMD_DBG_MSG PRINT_MESG_DBG +#define TL_SHCI_CMD_DBG_BUF PRINT_LOG_BUFF_DBG +#else +#define TL_SHCI_CMD_DBG_MSG(...) +#define TL_SHCI_CMD_DBG_BUF(...) +#endif + +#if (TL_SHCI_CMD_DBG_RAW_EN != 0) +#define TL_SHCI_CMD_DBG_RAW(_PDATA_, _SIZE_) HW_UART_Transmit(hw_uart1, (uint8_t *) _PDATA_, _SIZE_, (~0)) +#else +#define TL_SHCI_CMD_DBG_RAW(...) +#endif + +#if (TL_SHCI_EVT_DBG_EN != 0) +#define TL_SHCI_EVT_DBG_MSG PRINT_MESG_DBG +#define TL_SHCI_EVT_DBG_BUF PRINT_LOG_BUFF_DBG +#else +#define TL_SHCI_EVT_DBG_MSG(...) +#define TL_SHCI_EVT_DBG_BUF(...) +#endif + +#if (TL_SHCI_EVT_DBG_RAW_EN != 0) +#define TL_SHCI_EVT_DBG_RAW(_PDATA_, _SIZE_) HW_UART_Transmit(hw_uart1, (uint8_t *) _PDATA_, _SIZE_, (~0)) +#else +#define TL_SHCI_EVT_DBG_RAW(...) +#endif + +/** + * BLE Transport Layer + */ +#if (TL_HCI_CMD_DBG_EN != 0) +#define TL_HCI_CMD_DBG_MSG PRINT_MESG_DBG +#define TL_HCI_CMD_DBG_BUF PRINT_LOG_BUFF_DBG +#else +#define TL_HCI_CMD_DBG_MSG(...) +#define TL_HCI_CMD_DBG_BUF(...) +#endif + +#if (TL_HCI_CMD_DBG_RAW_EN != 0) +#define TL_HCI_CMD_DBG_RAW(_PDATA_, _SIZE_) HW_UART_Transmit(hw_uart1, (uint8_t *) _PDATA_, _SIZE_, (~0)) +#else +#define TL_HCI_CMD_DBG_RAW(...) +#endif + +#if (TL_HCI_EVT_DBG_EN != 0) +#define TL_HCI_EVT_DBG_MSG PRINT_MESG_DBG +#define TL_HCI_EVT_DBG_BUF PRINT_LOG_BUFF_DBG +#else +#define TL_HCI_EVT_DBG_MSG(...) +#define TL_HCI_EVT_DBG_BUF(...) +#endif + +#if (TL_HCI_EVT_DBG_RAW_EN != 0) +#define TL_HCI_EVT_DBG_RAW(_PDATA_, _SIZE_) HW_UART_Transmit(hw_uart1, (uint8_t *) _PDATA_, _SIZE_, (~0)) +#else +#define TL_HCI_EVT_DBG_RAW(...) +#endif + +/** + * Memory Manager - Released buffer tracing + */ +#if (TL_MM_DBG_EN != 0) +#define TL_MM_DBG_MSG PRINT_MESG_DBG +#else +#define TL_MM_DBG_MSG(...) +#endif + +/* USER CODE END Tl_Conf */ + +#endif /*__TL_DBG_CONF_H */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c new file mode 100644 index 00000000000000..7e1f5d5d43348f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/STM32_WPAN/Target/hw_ipcc.c @@ -0,0 +1,667 @@ +/** + ****************************************************************************** + * File Name : Target/hw_ipcc.c + * Description : Hardware IPCC source file for STM32WPAN Middleware. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" +#include "mbox_def.h" + +/* Global variables ---------------------------------------------------------*/ +/* Private defines -----------------------------------------------------------*/ +#define HW_IPCC_TX_PENDING(channel) (!(LL_C1_IPCC_IsActiveFlag_CHx(IPCC, channel))) && (((~(IPCC->C1MR)) & (channel << 16U))) +#define HW_IPCC_RX_PENDING(channel) (LL_C2_IPCC_IsActiveFlag_CHx(IPCC, channel)) && (((~(IPCC->C1MR)) & (channel << 0U))) + +/* Private macros ------------------------------------------------------------*/ +/* Private typedef -----------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +static void (*FreeBufCb)(void); + +/* Private function prototypes -----------------------------------------------*/ +static void HW_IPCC_BLE_EvtHandler(void); +static void HW_IPCC_BLE_AclDataEvtHandler(void); +static void HW_IPCC_MM_FreeBufHandler(void); +static void HW_IPCC_SYS_CmdEvtHandler(void); +static void HW_IPCC_SYS_EvtHandler(void); +static void HW_IPCC_TRACES_EvtHandler(void); + +#ifdef THREAD_WB +static void HW_IPCC_OT_CmdEvtHandler(void); +static void HW_IPCC_THREAD_NotEvtHandler(void); +static void HW_IPCC_THREAD_CliNotEvtHandler(void); +#endif + +#ifdef LLD_TESTS_WB +static void HW_IPCC_LLDTESTS_ReceiveCliRspHandler(void); +static void HW_IPCC_LLDTESTS_ReceiveM0CmdHandler(void); +#endif +#ifdef LLD_BLE_WB +/*static void HW_IPCC_LLD_BLE_ReceiveCliRspHandler( void );*/ +static void HW_IPCC_LLD_BLE_ReceiveRspHandler(void); +static void HW_IPCC_LLD_BLE_ReceiveM0CmdHandler(void); +#endif + +#ifdef MAC_802_15_4_WB +static void HW_IPCC_MAC_802_15_4_CmdEvtHandler(void); +static void HW_IPCC_MAC_802_15_4_NotEvtHandler(void); +#endif + +#ifdef ZIGBEE_WB +static void HW_IPCC_ZIGBEE_CmdEvtHandler(void); +static void HW_IPCC_ZIGBEE_StackNotifEvtHandler(void); +static void HW_IPCC_ZIGBEE_StackM0RequestHandler(void); +#endif + +/* Public function definition -----------------------------------------------*/ + +/****************************************************************************** + * INTERRUPT HANDLER + ******************************************************************************/ +void HW_IPCC_Rx_Handler(void) +{ + if (HW_IPCC_RX_PENDING(HW_IPCC_SYSTEM_EVENT_CHANNEL)) + { + HW_IPCC_SYS_EvtHandler(); + } +#ifdef MAC_802_15_4_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL)) + { + HW_IPCC_MAC_802_15_4_NotEvtHandler(); + } +#endif /* MAC_802_15_4_WB */ +#ifdef THREAD_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL)) + { + HW_IPCC_THREAD_NotEvtHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL)) + { + HW_IPCC_THREAD_CliNotEvtHandler(); + } +#endif /* THREAD_WB */ +#ifdef LLD_TESTS_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL)) + { + HW_IPCC_LLDTESTS_ReceiveCliRspHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_LLDTESTS_M0_CMD_CHANNEL)) + { + HW_IPCC_LLDTESTS_ReceiveM0CmdHandler(); + } +#endif /* LLD_TESTS_WB */ +#ifdef LLD_BLE_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_LLD_BLE_RSP_CHANNEL)) + { + HW_IPCC_LLD_BLE_ReceiveRspHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_LLD_BLE_M0_CMD_CHANNEL)) + { + HW_IPCC_LLD_BLE_ReceiveM0CmdHandler(); + } +#endif /* LLD_TESTS_WB */ +#ifdef ZIGBEE_WB + else if (HW_IPCC_RX_PENDING(HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL)) + { + HW_IPCC_ZIGBEE_StackNotifEvtHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL)) + { + HW_IPCC_ZIGBEE_StackM0RequestHandler(); + } +#endif /* ZIGBEE_WB */ + else if (HW_IPCC_RX_PENDING(HW_IPCC_BLE_EVENT_CHANNEL)) + { + HW_IPCC_BLE_EvtHandler(); + } + else if (HW_IPCC_RX_PENDING(HW_IPCC_TRACES_CHANNEL)) + { + HW_IPCC_TRACES_EvtHandler(); + } + + return; +} + +void HW_IPCC_Tx_Handler(void) +{ + if (HW_IPCC_TX_PENDING(HW_IPCC_SYSTEM_CMD_RSP_CHANNEL)) + { + HW_IPCC_SYS_CmdEvtHandler(); + } +#ifdef MAC_802_15_4_WB + else if (HW_IPCC_TX_PENDING(HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL)) + { + HW_IPCC_MAC_802_15_4_CmdEvtHandler(); + } +#endif /* MAC_802_15_4_WB */ +#ifdef THREAD_WB + else if (HW_IPCC_TX_PENDING(HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL)) + { + HW_IPCC_OT_CmdEvtHandler(); + } +#endif /* THREAD_WB */ +#ifdef LLD_TESTS_WB +// No TX handler for LLD tests +#endif /* LLD_TESTS_WB */ +#ifdef ZIGBEE_WB + if (HW_IPCC_TX_PENDING(HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL)) + { + HW_IPCC_ZIGBEE_CmdEvtHandler(); + } +#endif /* ZIGBEE_WB */ + + else if (HW_IPCC_TX_PENDING(HW_IPCC_MM_RELEASE_BUFFER_CHANNEL)) + { + HW_IPCC_MM_FreeBufHandler(); + } + else if (HW_IPCC_TX_PENDING(HW_IPCC_HCI_ACL_DATA_CHANNEL)) + { + HW_IPCC_BLE_AclDataEvtHandler(); + } + + return; +} +/****************************************************************************** + * GENERAL + ******************************************************************************/ +void HW_IPCC_Enable(void) +{ + /** + * Such as IPCC IP available to the CPU2, it is required to keep the IPCC clock running + when FUS is running on CPU2 and CPU1 enters deep sleep mode + */ + LL_C2_AHB3_GRP1_EnableClock(LL_C2_AHB3_GRP1_PERIPH_IPCC); + + /** + * When the device is out of standby, it is required to use the EXTI mechanism to wakeup CPU2 + */ + LL_C2_EXTI_EnableEvent_32_63(LL_EXTI_LINE_41); + LL_EXTI_EnableRisingTrig_32_63(LL_EXTI_LINE_41); + + /** + * In case the SBSFU is implemented, it may have already set the C2BOOT bit to startup the CPU2. + * In that case, to keep the mechanism transparent to the user application, it shall call the system command + * SHCI_C2_Reinit( ) before jumping to the application. + * When the CPU2 receives that command, it waits for its event input to be set to restart the CPU2 firmware. + * This is required because once C2BOOT has been set once, a clear/set on C2BOOT has no effect. + * When SHCI_C2_Reinit( ) is not called, generating an event to the CPU2 does not have any effect + * So, by default, the application shall both set the event flag and set the C2BOOT bit. + */ + __SEV(); /* Set the internal event flag and send an event to the CPU2 */ + __WFE(); /* Clear the internal event flag */ + LL_PWR_EnableBootC2(); + + return; +} + +void HW_IPCC_Init(void) +{ + LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC); + + LL_C1_IPCC_EnableIT_RXO(IPCC); + LL_C1_IPCC_EnableIT_TXF(IPCC); + + HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn); + HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn); + + return; +} + +/****************************************************************************** + * BLE + ******************************************************************************/ +void HW_IPCC_BLE_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_BLE_EVENT_CHANNEL); + + return; +} + +void HW_IPCC_BLE_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_BLE_CMD_CHANNEL); + + return; +} + +static void HW_IPCC_BLE_EvtHandler(void) +{ + HW_IPCC_BLE_RxEvtNot(); + + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_BLE_EVENT_CHANNEL); + + return; +} + +void HW_IPCC_BLE_SendAclData(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL); + + return; +} + +static void HW_IPCC_BLE_AclDataEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_HCI_ACL_DATA_CHANNEL); + + HW_IPCC_BLE_AclDataAckNot(); + + return; +} + +__weak void HW_IPCC_BLE_AclDataAckNot(void){}; +__weak void HW_IPCC_BLE_RxEvtNot(void){}; + +/****************************************************************************** + * SYSTEM + ******************************************************************************/ +void HW_IPCC_SYS_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL); + + return; +} + +void HW_IPCC_SYS_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL); + + return; +} + +static void HW_IPCC_SYS_CmdEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_SYSTEM_CMD_RSP_CHANNEL); + + HW_IPCC_SYS_CmdEvtNot(); + + return; +} + +static void HW_IPCC_SYS_EvtHandler(void) +{ + HW_IPCC_SYS_EvtNot(); + + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_SYSTEM_EVENT_CHANNEL); + + return; +} + +__weak void HW_IPCC_SYS_CmdEvtNot(void){}; +__weak void HW_IPCC_SYS_EvtNot(void){}; + +/****************************************************************************** + * MAC 802.15.4 + ******************************************************************************/ +#ifdef MAC_802_15_4_WB +void HW_IPCC_MAC_802_15_4_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL); + + return; +} + +void HW_IPCC_MAC_802_15_4_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL); + + return; +} + +void HW_IPCC_MAC_802_15_4_SendAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL); + + return; +} + +static void HW_IPCC_MAC_802_15_4_CmdEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_MAC_802_15_4_CMD_RSP_CHANNEL); + + HW_IPCC_MAC_802_15_4_CmdEvtNot(); + + return; +} + +static void HW_IPCC_MAC_802_15_4_NotEvtHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_MAC_802_15_4_NOTIFICATION_ACK_CHANNEL); + + HW_IPCC_MAC_802_15_4_EvtNot(); + + return; +} +__weak void HW_IPCC_MAC_802_15_4_CmdEvtNot(void){}; +__weak void HW_IPCC_MAC_802_15_4_EvtNot(void){}; +#endif + +/****************************************************************************** + * THREAD + ******************************************************************************/ +#ifdef THREAD_WB +void HW_IPCC_THREAD_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL); + + return; +} + +void HW_IPCC_OT_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL); + + return; +} + +void HW_IPCC_CLI_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_THREAD_CLI_CMD_CHANNEL); + + return; +} + +void HW_IPCC_THREAD_SendAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL); + + return; +} + +void HW_IPCC_THREAD_CliSendAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL); + + return; +} + +static void HW_IPCC_OT_CmdEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_THREAD_OT_CMD_RSP_CHANNEL); + + HW_IPCC_OT_CmdEvtNot(); + + return; +} + +static void HW_IPCC_THREAD_NotEvtHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_THREAD_NOTIFICATION_ACK_CHANNEL); + + HW_IPCC_THREAD_EvtNot(); + + return; +} + +static void HW_IPCC_THREAD_CliNotEvtHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_THREAD_CLI_NOTIFICATION_ACK_CHANNEL); + + HW_IPCC_THREAD_CliEvtNot(); + + return; +} + +__weak void HW_IPCC_OT_CmdEvtNot(void){}; +__weak void HW_IPCC_CLI_CmdEvtNot(void){}; +__weak void HW_IPCC_THREAD_EvtNot(void){}; + +#endif /* THREAD_WB */ + +/****************************************************************************** + * LLD TESTS + ******************************************************************************/ +#ifdef LLD_TESTS_WB +void HW_IPCC_LLDTESTS_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL); + return; +} + +void HW_IPCC_LLDTESTS_SendCliCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_LLDTESTS_CLI_CMD_CHANNEL); + return; +} + +static void HW_IPCC_LLDTESTS_ReceiveCliRspHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL); + HW_IPCC_LLDTESTS_ReceiveCliRsp(); + return; +} + +void HW_IPCC_LLDTESTS_SendCliRspAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_CLI_RSP_CHANNEL); + return; +} + +static void HW_IPCC_LLDTESTS_ReceiveM0CmdHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL); + HW_IPCC_LLDTESTS_ReceiveM0Cmd(); + return; +} + +void HW_IPCC_LLDTESTS_SendM0CmdAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLDTESTS_M0_CMD_CHANNEL); + return; +} +__weak void HW_IPCC_LLDTESTS_ReceiveCliRsp(void){}; +__weak void HW_IPCC_LLDTESTS_ReceiveM0Cmd(void){}; +#endif /* LLD_TESTS_WB */ + +/****************************************************************************** + * LLD BLE + ******************************************************************************/ +#ifdef LLD_BLE_WB +void HW_IPCC_LLD_BLE_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL); + return; +} + +void HW_IPCC_LLD_BLE_SendCliCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_LLD_BLE_CLI_CMD_CHANNEL); + return; +} + +/*static void HW_IPCC_LLD_BLE_ReceiveCliRspHandler( void ) +{ + LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL ); + HW_IPCC_LLD_BLE_ReceiveCliRsp(); + return; +}*/ + +void HW_IPCC_LLD_BLE_SendCliRspAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_CLI_RSP_CHANNEL); + return; +} + +static void HW_IPCC_LLD_BLE_ReceiveM0CmdHandler(void) +{ + // LL_C1_IPCC_DisableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL ); + HW_IPCC_LLD_BLE_ReceiveM0Cmd(); + return; +} + +void HW_IPCC_LLD_BLE_SendM0CmdAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL); + // LL_C1_IPCC_EnableReceiveChannel( IPCC, HW_IPCC_LLD_BLE_M0_CMD_CHANNEL ); + return; +} +__weak void HW_IPCC_LLD_BLE_ReceiveCliRsp(void){}; +__weak void HW_IPCC_LLD_BLE_ReceiveM0Cmd(void){}; + +/* Transparent Mode */ +void HW_IPCC_LLD_BLE_SendCmd(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_LLD_BLE_CMD_CHANNEL); + return; +} + +static void HW_IPCC_LLD_BLE_ReceiveRspHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL); + HW_IPCC_LLD_BLE_ReceiveRsp(); + return; +} + +void HW_IPCC_LLD_BLE_SendRspAck(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_LLD_BLE_RSP_CHANNEL); + return; +} + +#endif /* LLD_BLE_WB */ + +/****************************************************************************** + * ZIGBEE + ******************************************************************************/ +#ifdef ZIGBEE_WB +void HW_IPCC_ZIGBEE_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL); + + return; +} + +void HW_IPCC_ZIGBEE_SendM4RequestToM0(void) +{ + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL); + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL); + + return; +} + +void HW_IPCC_ZIGBEE_SendM4AckToM0Notify(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL); + + return; +} + +static void HW_IPCC_ZIGBEE_CmdEvtHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_ZIGBEE_CMD_APPLI_CHANNEL); + + HW_IPCC_ZIGBEE_RecvAppliAckFromM0(); + + return; +} + +static void HW_IPCC_ZIGBEE_StackNotifEvtHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_APPLI_NOTIF_ACK_CHANNEL); + + HW_IPCC_ZIGBEE_RecvM0NotifyToM4(); + + return; +} + +static void HW_IPCC_ZIGBEE_StackM0RequestHandler(void) +{ + LL_C1_IPCC_DisableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL); + + HW_IPCC_ZIGBEE_RecvM0RequestToM4(); + + return; +} + +void HW_IPCC_ZIGBEE_SendM4AckToM0Request(void) +{ + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL); + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_ZIGBEE_M0_REQUEST_CHANNEL); + + return; +} + +__weak void HW_IPCC_ZIGBEE_RecvAppliAckFromM0(void){}; +__weak void HW_IPCC_ZIGBEE_RecvM0NotifyToM4(void){}; +__weak void HW_IPCC_ZIGBEE_RecvM0RequestToM4(void){}; +#endif /* ZIGBEE_WB */ + +/****************************************************************************** + * MEMORY MANAGER + ******************************************************************************/ +void HW_IPCC_MM_SendFreeBuf(void (*cb)(void)) +{ + if (LL_C1_IPCC_IsActiveFlag_CHx(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL)) + { + FreeBufCb = cb; + LL_C1_IPCC_EnableTransmitChannel(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL); + } + else + { + cb(); + + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL); + } + + return; +} + +static void HW_IPCC_MM_FreeBufHandler(void) +{ + LL_C1_IPCC_DisableTransmitChannel(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL); + + FreeBufCb(); + + LL_C1_IPCC_SetFlag_CHx(IPCC, HW_IPCC_MM_RELEASE_BUFFER_CHANNEL); + + return; +} + +/****************************************************************************** + * TRACES + ******************************************************************************/ +void HW_IPCC_TRACES_Init(void) +{ + LL_C1_IPCC_EnableReceiveChannel(IPCC, HW_IPCC_TRACES_CHANNEL); + + return; +} + +static void HW_IPCC_TRACES_EvtHandler(void) +{ + HW_IPCC_TRACES_EvtNot(); + + LL_C1_IPCC_ClearFlag_CHx(IPCC, HW_IPCC_TRACES_CHANNEL); + + return; +} + +__weak void HW_IPCC_TRACES_EvtNot(void){}; diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/app_entry.cpp b/examples/platform/stm32/common/STM32WB5MM-DK/Src/app_entry.cpp new file mode 100644 index 00000000000000..4d828c6cd4ffee --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/app_entry.cpp @@ -0,0 +1,583 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : app_entry.c + * Description : Entry application source file for STM32WPAN Middleware. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_entry.h" +#include "app_ble.h" +#include "app_common.h" +#include "app_conf.h" +#include "app_thread.h" +#include "cmsis_os.h" +#include "dbg_trace.h" +#include "hw_conf.h" +#include "main.h" +#include "shci.h" +#include "shci_tl.h" +#include "ssd1315.h" +#include "stm32_lcd.h" +#include "stm32_lpm.h" +#include "stm32wb5mm_dk_lcd.h" +#include "stm_logging.h" + +#include "AppTask.h" +/* Private includes -----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN PTD */ + +/* USER CODE END PTD */ + +/* Private defines -----------------------------------------------------------*/ +/* POOL_SIZE = 2(TL_PacketHeader_t) + 258 (3(TL_EVT_HDR_SIZE) + 255(Payload size)) */ +#define POOL_SIZE (CFG_TLBLE_EVT_QUEUE_LENGTH * 4 * DIVC((sizeof(TL_PacketHeader_t) + TL_BLE_EVENT_FRAME_SIZE), 4)) +/* USER CODE BEGIN PD */ + +/* USER CODE END PD */ + +/* Private macros ------------------------------------------------------------*/ +/* USER CODE BEGIN PM */ + +/* USER CODE END PM */ + +/* Private variables ---------------------------------------------------------*/ + +extern RTC_HandleTypeDef hrtc; /**< RTC handler declaration */ +#ifdef __cplusplus +extern "C" { +#endif + +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t EvtPool[POOL_SIZE]; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static TL_CmdPacket_t SystemCmdBuffer; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t SystemSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255]; +PLACE_IN_SECTION("MB_MEM2") ALIGN(4) static uint8_t BleSpareEvtBuffer[sizeof(TL_PacketHeader_t) + TL_EVT_HDR_SIZE + 255]; +uint8_t g_ot_notification_allowed = 0U; +/* Global variables ----------------------------------------------------------*/ + +/* Global function prototypes -----------------------------------------------*/ +#if (CFG_DEBUG_TRACE != 0) +size_t DbgTraceWrite(int handle, const unsigned char * buf, size_t bufSize); +#endif + +/* USER CODE BEGIN GFP */ +osSemaphoreId_t SemShciId; +osSemaphoreId_t SemShciUserEvtProcessId; +osThreadId_t OsShciUserEvtProcessId; +osThreadId_t OsPushButtonProcessId; + +const osThreadAttr_t ShciUserEvtProcess_attr = { .name = CFG_SHCI_USER_EVT_PROCESS_NAME, + .attr_bits = CFG_SHCI_USER_EVT_PROCESS_ATTR_BITS, + .cb_mem = CFG_SHCI_USER_EVT_PROCESS_CB_MEM, + .cb_size = CFG_SHCI_USER_EVT_PROCESS_CB_SIZE, + .stack_mem = CFG_SHCI_USER_EVT_PROCESS_STACK_MEM, + .stack_size = CFG_SHCI_USER_EVT_PROCESS_STACK_SIZE, + .priority = CFG_SHCI_USER_EVT_PROCESS_PRIORITY }; + +const osThreadAttr_t PushButtonProcess_attr = { .name = CFG_PUSH_BUTTON_EVT_PROCESS_NAME, + .attr_bits = CFG_PUSH_BUTTON_EVT_PROCESS_ATTR_BITS, + .cb_mem = CFG_PUSH_BUTTON_EVT_PROCESS_CB_MEM, + .cb_size = CFG_PUSH_BUTTON_EVT_PROCESS_CB_SIZE, + .stack_mem = CFG_PUSH_BUTTON_EVT_PROCESS_STACK_MEM, + .stack_size = CFG_PUSH_BUTTON_EVT_PROCESS_STACK_SIZE, + .priority = CFG_PUSH_BUTTON_EVT_PROCESS_PRIORITY }; + +/* USER CODE END GFP */ + +/* Private functions prototypes-----------------------------------------------*/ +static void SystemPower_Config(void); +static void Init_Debug(void); +static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status); +static void APPE_SysUserEvtRx(void * pPayload); +static void APPE_SysEvtReadyProcessing(void); +static void APPE_SysEvtError(SCHI_SystemErrCode_t ErrorCode); +static void appe_Tl_Init(void); +/* USER CODE BEGIN PFP */ +static void Led_Init(void); +static void Button_Init(void); +#if (CFG_HW_EXTPA_ENABLED == 1) +static void ExtPA_Init(void); +#endif +static void ShciUserEvtProcess(void * argument); +static void PushButtonEvtProcess(void * argument); +/* USER CODE END PFP */ + +static void displayConcurrentMode(void); + +// Callback function to handle pushbutton to apptask +PushButtonCallback PbCb = NULL; + +void APP_ENTRY_PBSetReceiveCallback(PushButtonCallback aCallback) +{ + PbCb = aCallback; +} + +/* Functions Definition ------------------------------------------------------*/ +void APPE_Init(void) +{ + /* Configure the system Power Mode */ + SystemPower_Config(); + + /* Initialize the TimerServer */ + HW_TS_Init(hw_ts_InitMode_Full, &hrtc); + + /* USER CODE BEGIN APPE_Init_1 */ + /* initialize debugger module if supported and debug trace if activated */ + Init_Debug(); + + /* Display Dynamic concurrent mode (BLE and Thread) */ + displayConcurrentMode(); + + /** + * The Standby mode should not be entered before the initialization is over + * The default state of the Low Power Manager is to allow the Standby Mode so an request is needed here + */ + UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE); + + /** init freertos semaphore */ + SemShciId = osSemaphoreNew(1, 0, NULL); /*< Create the semaphore and make it busy at initialization */ + SemShciUserEvtProcessId = osSemaphoreNew(1, 0, NULL); /*< Create the semaphore and make it busy at initialization */ + OsShciUserEvtProcessId = osThreadNew(ShciUserEvtProcess, NULL, &ShciUserEvtProcess_attr); + OsPushButtonProcessId = osThreadNew(PushButtonEvtProcess, NULL, &PushButtonProcess_attr); + + Led_Init(); + Button_Init(); + + /* USER CODE END APPE_Init_1 */ + /* Initialize all transport layers and start CPU2 which will send back a ready event to CPU1 */ + appe_Tl_Init(); + + BSP_LCD_Init(0, LCD_ORIENTATION_LANDSCAPE); + /* Set LCD Foreground Layer */ + UTIL_LCD_SetFuncDriver(&LCD_Driver); /* SetFunc before setting device */ + UTIL_LCD_SetDevice(0); /* SetDevice after funcDriver is set */ + BSP_LCD_Clear(0, SSD1315_COLOR_BLACK); + BSP_LCD_DisplayOn(0); + BSP_LCD_Refresh(0); + UTIL_LCD_SetFont(&Font12); + /* Set the LCD Text Color */ + UTIL_LCD_SetTextColor(SSD1315_COLOR_WHITE); + UTIL_LCD_SetBackColor(SSD1315_COLOR_BLACK); + BSP_LCD_Clear(0, SSD1315_COLOR_BLACK); + BSP_LCD_Refresh(0); + UTIL_LCD_DisplayStringAt(0, 0, (uint8_t *) "Matter LightingApp", CENTER_MODE); + BSP_LCD_Refresh(0); + + /** + * From now, the application is waiting for the ready event ( VS_HCI_C2_Ready ) + * received on the system channel before starting the Stack + * This system event is received with APPE_SysUserEvtRx() + */ + /* USER CODE BEGIN APPE_Init_2 */ +#if (CFG_HW_EXTPA_ENABLED == 1) + ExtPA_Init(); +#endif + + /* USER CODE END APPE_Init_2 */ + return; +} + +static void displayConcurrentMode() +{ + APP_DBG("Matter Over Thread Lighting-App starting..."); +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +static void Init_Debug(void) +{ +#if (CFG_DEBUGGER_SUPPORTED == 1) + /** + * Keep debugger enabled while in any low power mode + */ + HAL_DBGMCU_EnableDBGSleepMode(); + + /* Enable debugger EXTI lines */ + LL_EXTI_EnableIT_32_63(LL_EXTI_LINE_48); + LL_C2_EXTI_EnableIT_32_63(LL_EXTI_LINE_48); + +#else + /* Disable debugger EXTI lines */ + LL_EXTI_DisableIT_32_63(LL_EXTI_LINE_48); + LL_C2_EXTI_DisableIT_32_63(LL_EXTI_LINE_48); + + GPIO_InitTypeDef gpio_config = { 0 }; + + gpio_config.Pull = GPIO_NOPULL; + gpio_config.Mode = GPIO_MODE_ANALOG; + + gpio_config.Pin = GPIO_PIN_15 | GPIO_PIN_14 | GPIO_PIN_13; + __HAL_RCC_GPIOA_CLK_ENABLE(); + HAL_GPIO_Init(GPIOA, &gpio_config); + __HAL_RCC_GPIOA_CLK_DISABLE(); + + gpio_config.Pin = GPIO_PIN_4 | GPIO_PIN_3; + __HAL_RCC_GPIOB_CLK_ENABLE(); + HAL_GPIO_Init(GPIOB, &gpio_config); + __HAL_RCC_GPIOB_CLK_DISABLE(); + + /** + * Do not keep debugger enabled while in any low power mode + */ + HAL_DBGMCU_DisableDBGSleepMode(); + HAL_DBGMCU_DisableDBGStopMode(); + HAL_DBGMCU_DisableDBGStandbyMode(); +#endif /* (CFG_DEBUGGER_SUPPORTED == 1) */ + +#if (CFG_DEBUG_TRACE != 0) + DbgTraceInit(); +#endif + + return; +} + +/** + * @brief Configure the system for power optimization + * + * @note This API configures the system to be ready for low power mode + * + * @param None + * @retval None + */ +static void SystemPower_Config(void) +{ + // Before going to stop or standby modes, do the settings so that system clock and IP80215.4 clock + // start on HSI automatically + LL_RCC_HSI_EnableAutoFromStop(); + + /** + * Select HSI as system clock source after Wake Up from Stop mode + */ + LL_RCC_SetClkAfterWakeFromStop(LL_RCC_STOP_WAKEUPCLOCK_HSI); + + /* Initialize low power manager */ + UTIL_LPM_Init(); + + /* Disable low power mode until INIT is complete */ + UTIL_LPM_SetOffMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE); + UTIL_LPM_SetStopMode(1 << CFG_LPM_APP, UTIL_LPM_DISABLE); + + /* Enable RAM1 (because OT instance.o is located here for Concurrent Mode */ + LL_C2_AHB1_GRP1_EnableClock(LL_C2_AHB1_GRP1_PERIPH_SRAM1); + LL_C2_AHB1_GRP1_EnableClockSleep(LL_C2_AHB1_GRP1_PERIPH_SRAM1); + + return; +} + +static void appe_Tl_Init(void) +{ + TL_MM_Config_t tl_mm_config; + SHCI_TL_HciInitConf_t SHci_Tl_Init_Conf; + + /**< Reference table initialization */ + TL_Init(); + + /**< System channel initialization */ + SHci_Tl_Init_Conf.p_cmdbuffer = (uint8_t *) &SystemCmdBuffer; + SHci_Tl_Init_Conf.StatusNotCallBack = APPE_SysStatusNot; + shci_init(APPE_SysUserEvtRx, (void *) &SHci_Tl_Init_Conf); + + /**< Memory Manager channel initialization */ + tl_mm_config.p_BleSpareEvtBuffer = BleSpareEvtBuffer; + tl_mm_config.p_SystemSpareEvtBuffer = SystemSpareEvtBuffer; + tl_mm_config.p_AsynchEvtPool = EvtPool; + tl_mm_config.AsynchEvtPoolSize = POOL_SIZE; + TL_MM_Init(&tl_mm_config); + + TL_Enable(); + + return; +} + +static void APPE_SysStatusNot(SHCI_TL_CmdStatus_t status) +{ + UNUSED(status); + return; +} + +/** + * The type of the payload for a system user event is tSHCI_UserEvtRxParam + * When the system event is both : + * - a ready event (subevtcode = SHCI_SUB_EVT_CODE_READY) + * - reported by the FUS (sysevt_ready_rsp == FUS_FW_RUNNING) + * The buffer shall not be released + * ( eg ((tSHCI_UserEvtRxParam*)pPayload)->status shall be set to SHCI_TL_UserEventFlow_Disable ) + * When the status is not filled, the buffer is released by default + */ +static void APPE_SysUserEvtRx(void * pPayload) +{ + TL_AsynchEvt_t * p_sys_event; + p_sys_event = (TL_AsynchEvt_t *) (((tSHCI_UserEvtRxParam *) pPayload)->pckt->evtserial.evt.payload); + + switch (p_sys_event->subevtcode) + { + case SHCI_SUB_EVT_CODE_READY: + APPE_SysEvtReadyProcessing(); + break; + + case SHCI_SUB_EVT_ERROR_NOTIF: + APPE_SysEvtError((SCHI_SystemErrCode_t)(p_sys_event->payload[0])); + break; + + default: + break; + } + return; +} + +/** + * @brief Notify a system error coming from the M0 firmware + * @param ErrorCode : errorCode detected by the M0 firmware + * + * @retval None + */ +static void APPE_SysEvtError(SCHI_SystemErrCode_t ErrorCode) +{ + switch (ErrorCode) + { + case ERR_THREAD_LLD_FATAL_ERROR: + APP_DBG("** ERR_THREAD : LLD_FATAL_ERROR \n"); + break; + + case ERR_THREAD_UNKNOWN_CMD: + APP_DBG("** ERR_THREAD : UNKNOWN_CMD \n"); + break; + + default: + APP_DBG("** ERR_THREAD : ErroCode=%d \n", ErrorCode); + break; + } + return; +} + +static void APPE_SysEvtReadyProcessing(void) +{ + /* Traces channel initialization */ + TL_TRACES_Init(); + + /* In the Context of Dynamic Concurrent mode, the Init and start of each stack must be split and executed + * in the following order : + * APP_BLE_Init : BLE Stack Init until it's ready to start ADV + * APP_THREAD_Init_Dyn_1() : Thread Stack Init until it's ready to be configured (default channel, PID, etc...) + */ + APP_DBG("1- Initialisation of BLE Stack..."); + APP_BLE_Init_Dyn_1(); + APP_DBG("2- Initialisation of OpenThread Stack. FW info :"); + APP_THREAD_Init(); + APP_BLE_Init_Dyn_2(); + + APP_DBG("Start init matter"); + GetAppTask().StartAppTask(); + +#if (CFG_LPM_SUPPORTED == 1) + /* Thread stack is initialized, low power mode can be enabled */ + UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE); + UTIL_LPM_SetStopMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE); +#endif + + return; +} + +static void Led_Init(void) +{ +#if (CFG_LED_SUPPORTED == 1U) + /** + * Leds Initialization + */ + +#endif + + return; +} + +static void Button_Init(void) +{ + +#if (CFG_BUTTON_SUPPORTED == 1U) + /** + * Button Initialization + */ + + BSP_PB_Init(BUTTON_USER1, BUTTON_MODE_EXTI); +#endif + + return; +} + +#if (CFG_HW_EXTPA_ENABLED == 1) +static void ExtPA_Init(void) +{ + GPIO_InitTypeDef GPIO_InitStruct; + + // configure the GPIO PB0 in AF6 to be used as RF_TX_MOD_EXT_PA + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Alternate = GPIO_AF6_RF_DTB0; + GPIO_InitStruct.Pin = GPIO_EXT_PA_TX_PIN; + HAL_GPIO_Init(GPIO_EXT_PA_TX_PORT, &GPIO_InitStruct); + + // configure the GPIO which will be managed by M0 stack to enable Ext PA + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Pin = GPIO_EXT_PA_EN_PIN; + HAL_GPIO_Init(GPIO_EXT_PA_EN_PORT, &GPIO_InitStruct); + + // Indicate to M0 which GPIO must be managed + SHCI_C2_ExtpaConfig((uint32_t) GPIO_EXT_PA_EN_PORT, GPIO_EXT_PA_EN_PIN, EXT_PA_ENABLED_HIGH, EXT_PA_ENABLED); +} +#endif /* CFG_HW_EXTPA_ENABLED */ + +/************************************************************* + * + * WRAP FUNCTIONS + * + *************************************************************/ +static void PushButtonEvtProcess(void * argument) +{ + UNUSED(argument); + for (;;) + { + /* USER CODE BEGIN SHCI_USER_EVT_PROCESS_1 */ + + /* USER CODE END SHCI_USER_EVT_PROCESS_1 */ + osThreadFlagsWait(1, osFlagsWaitAny, osWaitForever); + Push_Button_st Message; + Message.Pushed_Button = BUTTON_USER1; + Message.State = 1; + PbCb(&Message); // call matter callback to handle push button + /* USER CODE BEGIN SHCI_USER_EVT_PROCESS_2 */ + + /* USER CODE END SHCI_USER_EVT_PROCESS_2 */ + } +} + +static void ShciUserEvtProcess(void * argument) +{ + UNUSED(argument); + for (;;) + { + /* USER CODE BEGIN SHCI_USER_EVT_PROCESS_1 */ + + /* USER CODE END SHCI_USER_EVT_PROCESS_1 */ + // osThreadFlagsWait(1, osFlagsWaitAny, osWaitForever); + osSemaphoreAcquire(SemShciUserEvtProcessId, osWaitForever); + shci_user_evt_proc(); + /* USER CODE BEGIN SHCI_USER_EVT_PROCESS_2 */ + + /* USER CODE END SHCI_USER_EVT_PROCESS_2 */ + } +} + +void shci_notify_asynch_evt(void * pdata) +{ + UNUSED(pdata); + osSemaphoreRelease(SemShciUserEvtProcessId); + return; +} + +void shci_cmd_resp_release(uint32_t flag) +{ + UNUSED(flag); + osSemaphoreRelease(SemShciId); + return; +} + +void shci_cmd_resp_wait(uint32_t timeout) +{ + UNUSED(timeout); + osSemaphoreAcquire(SemShciId, osWaitForever); + return; +} + +/* Received trace buffer from M0 */ +void TL_TRACES_EvtReceived(TL_EvtPacket_t * hcievt) +{ +#if (CFG_DEBUG_TRACE != 0) + /* Call write/print function using DMA from dbg_trace */ + /* - Cast to TL_AsynchEvt_t* to get "real" payload (without Sub Evt code 2bytes), + - (-2) to size to remove Sub Evt Code */ + DbgTraceWrite(1U, (const unsigned char *) ((TL_AsynchEvt_t *) (hcievt->evtserial.evt.payload))->payload, + hcievt->evtserial.evt.plen - 2U); +#endif /* CFG_DEBUG_TRACE */ + /* Release buffer */ + TL_MM_EvtDone(hcievt); +} +/** + * @brief Initialization of the trace mechanism + * @param None + * @retval None + */ +#if (CFG_DEBUG_TRACE != 0) +void DbgOutputInit(void) +{ +#if (CFG_HW_USART1_ENABLED == 1) + HW_UART_Init(CFG_DEBUG_TRACE_UART); +#endif + return; +} + +/** + * @brief Management of the traces + * @param p_data : data + * @param size : size + * @param call-back : + * @retval None + */ +void DbgOutputTraces(uint8_t * p_data, uint16_t size, void (*cb)(void)) +{ + HW_UART_Transmit_DMA(CFG_DEBUG_TRACE_UART, p_data, size, cb); + + return; +} +#endif + +/** + * @brief This function manage the Push button action + * @param GPIO_Pin : GPIO pin which has been activated + * @retval None + */ +void BSP_PB_Callback(Button_TypeDef Button) +{ + switch (Button) + { + case BUTTON_USER1: + APP_DBG("BUTTON 1 PUSHED !"); + osThreadFlagsSet(OsPushButtonProcessId, 1); + break; + + case BUTTON_USER2: + APP_DBG("BUTTON 2 PUSHED !"); + /* Set "Switch Protocol" Task */ + break; + + default: + break; + } + + return; +} +#ifdef __cplusplus +} +#endif diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/entropy_hardware_poll.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/entropy_hardware_poll.c new file mode 100644 index 00000000000000..db25dccdf97cf0 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/entropy_hardware_poll.c @@ -0,0 +1,76 @@ + +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : entropy_hardware_poll.c + * Description : This file provides code for the entropy collector. + * author :MCD Application Team + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +#include "main.h" +#include "stm32wbxx_hal.h" +#include "stm32wbxx_ll_hsem.h" +#include + +int mbedtls_hardware_poll(void * data, unsigned char * output, size_t len, size_t * olen); + +int mbedtls_hardware_poll(void * data, unsigned char * output, size_t len, size_t * olen) +{ + HAL_StatusTypeDef status = HAL_OK; + uint32_t random_number = 0; + /** + * Static random Address + * The two upper bits shall be set to 1 + * The lowest 32bits is read from the UDN to differentiate between devices + * The RNG may be used to provide a random number on each power on + */ + /* Get RNG semaphore */ + while (LL_HSEM_1StepLock(HSEM, 0)) + ; + + /* Enable RNG */ + __HAL_RNG_ENABLE(&hrng); + + /* Enable HSI48 oscillator */ + LL_RCC_HSI48_Enable(); + /* Wait until HSI48 is ready */ + while (!LL_RCC_HSI48_IsReady()) + ; + + if (HAL_RNG_GenerateRandomNumber(&hrng, &random_number) != HAL_OK) + { + } + + /* Disable HSI48 oscillator */ + LL_RCC_HSI48_Disable(); + + /* Disable RNG */ + __HAL_RNG_DISABLE(&hrng); + + /* Release RNG semaphore */ + LL_HSEM_ReleaseLock(HSEM, 0, 0); + ((void) data); + *olen = 0; + + if ((len < sizeof(uint32_t)) || (HAL_OK != status)) + { + return 0; + } + + memcpy(output, &random_number, sizeof(uint32_t)); + *olen = sizeof(uint32_t); + + return 0; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_driver.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_driver.c new file mode 100644 index 00000000000000..fcf4534a327003 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_driver.c @@ -0,0 +1,322 @@ +/** + ****************************************************************************** + * @file : flash_driver.c + * @author : MCD Application Team + * @brief : Dual core Flash driver + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "flash_driver.h" +#include "app_common.h" +#include "main.h" +#include "shci.h" +#include "utilities_conf.h" + +/* Private typedef -----------------------------------------------------------*/ +typedef enum +{ + SEM_LOCK_SUCCESSFUL, + SEM_LOCK_BUSY, +} SemStatus_t; + +typedef enum +{ + FLASH_ERASE, + FLASH_WRITE, +} FlashOperationType_t; + +/* Private defines -----------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +static SingleFlashOperationStatus_t ProcessSingleFlashOperation(FlashOperationType_t FlashOperationType, + uint32_t SectorNumberOrDestAddress, uint64_t Data); +/* Public functions ----------------------------------------------------------*/ +uint32_t FD_EraseSectors(uint32_t FirstSector, uint32_t NbrOfSectors) +{ + uint32_t loop_flash; + uint32_t return_value; + SingleFlashOperationStatus_t single_flash_operation_status; + + single_flash_operation_status = SINGLE_FLASH_OPERATION_DONE; + + /** + * Take the semaphore to take ownership of the Flash IP + */ + while (LL_HSEM_1StepLock(HSEM, CFG_HW_FLASH_SEMID)) + ; + + HAL_FLASH_Unlock(); + + /** + * Notify the CPU2 that some flash erase activity may be executed + * On reception of this command, the CPU2 enables the BLE timing protection versus flash erase processing + * The Erase flash activity will be executed only when the BLE RF is idle for at least 25ms + * The CPU2 will prevent all flash activity (write or erase) in all cases when the BL RF Idle is shorter than 25ms. + */ + SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_ON); + + for (loop_flash = 0; (loop_flash < NbrOfSectors) && (single_flash_operation_status == SINGLE_FLASH_OPERATION_DONE); + loop_flash++) + { + single_flash_operation_status = FD_EraseSingleSector(FirstSector + loop_flash); + } + + if (single_flash_operation_status != SINGLE_FLASH_OPERATION_DONE) + { + return_value = NbrOfSectors - loop_flash + 1; + } + else + { + /** + * Notify the CPU2 there will be no request anymore to erase the flash + * On reception of this command, the CPU2 will disables the BLE timing protection versus flash erase processing + * The protection is active until next end of radio event. + */ + SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_OFF); + + HAL_FLASH_Lock(); + + /** + * Release the ownership of the Flash IP + */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_FLASH_SEMID, 0); + + return_value = 0; + } + + return return_value; +} + +uint32_t FD_WriteData(uint32_t DestAddress, uint64_t * pSrcBuffer, uint32_t NbrOfData) +{ + uint32_t loop_flash; + uint32_t return_value; + SingleFlashOperationStatus_t single_flash_operation_status; + + single_flash_operation_status = SINGLE_FLASH_OPERATION_DONE; + + /** + * Take the semaphore to take ownership of the Flash IP + */ + while (LL_HSEM_1StepLock(HSEM, CFG_HW_FLASH_SEMID)) + ; + + HAL_FLASH_Unlock(); + + for (loop_flash = 0; (loop_flash < NbrOfData) && (single_flash_operation_status == SINGLE_FLASH_OPERATION_DONE); loop_flash++) + { + single_flash_operation_status = FD_WriteSingleData(DestAddress + (8 * loop_flash), *(pSrcBuffer + loop_flash)); + } + + if (single_flash_operation_status != SINGLE_FLASH_OPERATION_DONE) + { + return_value = NbrOfData - loop_flash + 1; + } + else + { + HAL_FLASH_Lock(); + + /** + * Release the ownership of the Flash IP + */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_FLASH_SEMID, 0); + + return_value = 0; + } + + return return_value; +} + +SingleFlashOperationStatus_t FD_EraseSingleSector(uint32_t SectorNumber) +{ + SingleFlashOperationStatus_t return_value; + + /* The last parameter is unused in that case and set to 0 */ + return_value = ProcessSingleFlashOperation(FLASH_ERASE, SectorNumber, 0); + + return return_value; +} + +SingleFlashOperationStatus_t FD_WriteSingleData(uint32_t DestAddress, uint64_t Data) +{ + SingleFlashOperationStatus_t return_value; + + return_value = ProcessSingleFlashOperation(FLASH_WRITE, DestAddress, Data); + + return return_value; +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +static SingleFlashOperationStatus_t ProcessSingleFlashOperation(FlashOperationType_t FlashOperationType, + uint32_t SectorNumberOrDestAddress, uint64_t Data) +{ + SemStatus_t cpu1_sem_status; + SemStatus_t cpu2_sem_status; + WaitedSemStatus_t waited_sem_status; + SingleFlashOperationStatus_t return_status; + + uint32_t page_error; + FLASH_EraseInitTypeDef p_erase_init; + + waited_sem_status = WAITED_SEM_FREE; + + p_erase_init.TypeErase = FLASH_TYPEERASE_PAGES; + p_erase_init.NbPages = 1; + p_erase_init.Page = SectorNumberOrDestAddress; + + do + { + /** + * When the PESD bit mechanism is used by CPU2 to protect its timing, the PESD bit should be polled here. + * If the PESD is set, the CPU1 will be stalled when reading literals from an ISR that may occur after + * the flash processing has been requested but suspended due to the PESD bit. + * + * Note: This code is required only when the PESD mechanism is used to protect the CPU2 timing. + * However, keeping that code make it compatible with the two mechanisms. + */ + while (LL_FLASH_IsActiveFlag_OperationSuspended()) + ; + + UTILS_ENTER_CRITICAL_SECTION(); + + /** + * Depending on the application implementation, in case a multitasking is possible with an OS, + * it should be checked here if another task in the application disallowed flash processing to protect + * some latency in critical code execution + * When flash processing is ongoing, the CPU cannot access the flash anymore. + * Trying to access the flash during that time stalls the CPU. + * The only way for CPU1 to disallow flash processing is to take CFG_HW_BLOCK_FLASH_REQ_BY_CPU1_SEMID. + */ + cpu1_sem_status = (SemStatus_t) LL_HSEM_GetStatus(HSEM, CFG_HW_BLOCK_FLASH_REQ_BY_CPU1_SEMID); + if (cpu1_sem_status == SEM_LOCK_SUCCESSFUL) + { + /** + * Check now if the CPU2 disallows flash processing to protect its timing. + * If the semaphore is locked, the CPU2 does not allow flash processing + * + * Note: By default, the CPU2 uses the PESD mechanism to protect its timing, + * therefore, it is useless to get/release the semaphore. + * + * However, keeping that code make it compatible with the two mechanisms. + * The protection by semaphore is enabled on CPU2 side with the command SHCI_C2_SetFlashActivityControl() + * + */ + cpu2_sem_status = (SemStatus_t) LL_HSEM_1StepLock(HSEM, CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID); + if (cpu2_sem_status == SEM_LOCK_SUCCESSFUL) + { + /** + * When CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID is taken, it is allowed to only erase one sector or + * write one single 64bits data + * When either several sectors need to be erased or several 64bits data need to be written, + * the application shall first exit from the critical section and try again. + */ + if (FlashOperationType == FLASH_ERASE) + { + HAL_FLASHEx_Erase(&p_erase_init, &page_error); + } + else + { + HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, SectorNumberOrDestAddress, Data); + } + /** + * Release the semaphore to give the opportunity to CPU2 to protect its timing versus the next flash operation + * by taking this semaphore. + * Note that the CPU2 is polling on this semaphore so CPU1 shall release it as fast as possible. + * This is why this code is protected by a critical section. + */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID, 0); + } + } + + UTILS_EXIT_CRITICAL_SECTION(); + + if (cpu1_sem_status != SEM_LOCK_SUCCESSFUL) + { + /** + * To avoid looping in ProcessSingleFlashOperation(), FD_WaitForSemAvailable() should implement a mechanism to + * continue only when CFG_HW_BLOCK_FLASH_REQ_BY_CPU1_SEMID is free + */ + waited_sem_status = FD_WaitForSemAvailable(WAIT_FOR_SEM_BLOCK_FLASH_REQ_BY_CPU1); + } + else if (cpu2_sem_status != SEM_LOCK_SUCCESSFUL) + { + /** + * To avoid looping in ProcessSingleFlashOperation(), FD_WaitForSemAvailable() should implement a mechanism to + * continue only when CFG_HW_BLOCK_FLASH_REQ_BY_CPU2_SEMID is free + */ + waited_sem_status = FD_WaitForSemAvailable(WAIT_FOR_SEM_BLOCK_FLASH_REQ_BY_CPU2); + } + } while (((cpu2_sem_status != SEM_LOCK_SUCCESSFUL) || (cpu1_sem_status != SEM_LOCK_SUCCESSFUL)) && + (waited_sem_status != WAITED_SEM_BUSY)); + + /** + * In most BLE application, the flash should not be blocked by the CPU2 longer than FLASH_TIMEOUT_VALUE (1000ms) + * However, it could be that for some marginal application, this time is longer. + * In that case either HAL_FLASHEx_Erase() or HAL_FLASH_Program() will exit with FLASH_TIMEOUT_VALUE value. + * This is not a failing case and there is no other way than waiting the operation to be completed. + * If for any reason this test is never passed, this means there is a failure in the system and there is no other + * way to recover than applying a device reset. + * + * Note: This code is required only when the PESD mechanism is used to protect the CPU2 timing. + * However, keeping that code make it compatible with the two mechanisms. + */ + while (__HAL_FLASH_GET_FLAG(FLASH_FLAG_CFGBSY)) + ; + + if (waited_sem_status != WAITED_SEM_BUSY) + { + /** + * The flash processing has been done. It has not been checked whether it has been successful or not. + * The only commitment is that it is possible to request a new flash processing + */ + return_status = SINGLE_FLASH_OPERATION_DONE; + } + else + { + /** + * The flash processing has not been executed due to timing protection from either the CPU1 or the CPU2. + * This status is reported up to the user that should retry after checking that each CPU do not + * protect its timing anymore. + */ + return_status = SINGLE_FLASH_OPERATION_NOT_EXECUTED; + } + + return return_status; +} + +/************************************************************* + * + * WEAK FUNCTIONS + * + *************************************************************/ +__WEAK WaitedSemStatus_t FD_WaitForSemAvailable(WaitedSemId_t WaitedSemId) +{ + /** + * The timing protection is enabled by either CPU1 or CPU2. It should be decided here if the driver shall + * keep trying to erase/write the flash until successful or if it shall exit and report to the user that the action + * has not been executed. + * WAITED_SEM_BUSY returns to the user + * WAITED_SEM_FREE keep looping in the driver until the action is executed. This will result in the current stack looping + * until this is done. In a bare metal implementation, only the code within interrupt handler can be executed. With an OS, + * only task with higher priority can be processed + * + */ + return WAITED_SEM_BUSY; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_wb.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_wb.c new file mode 100644 index 00000000000000..d1e0f613b70b4b --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/flash_wb.c @@ -0,0 +1,357 @@ +/** + ****************************************************************************** + * @file flash_wb.c + * @author MCD Application Team + * @brief Middleware between keymanager and flahs_driver , + * to manage key needed for Matter + ****************************************************************************** + * @attention + * + * Copyright (c) 2023 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "flash_wb.h" +#include "flash_driver.h" + +#include +#include +#include + +/* Private defines -----------------------------------------------------------*/ +#define MATTER_KEY_NAME_MAX_LENGTH (15 * 2) // ADD Max key name string size is 30 "keyType...;KeyName..." +// ^ STM32STORE_MAX_KEY_SIZE +#define NVM_OFFSET_KEY 512 +#define NVM_END_FLASH +#define NVM_BLOCK_SIZE NVM_OFFSET_KEY +#define FLASH_START 0x08000000 +#define DEFAULT_VALUE 0xFF +#define NB_SECTOR 3 +#define NVM_MATTER_ADDR_INIT_SECURE 0x08082000 +#define NVM_MATTER_ADDR_INIT_SECURE_PTR ((void * const) NVM_MATTER_ADDR_INIT_SECURE) +#define SECTOR_SIZE_SECURE 4096 * 2 +#define NVM_MATTER_ADDR_INIT_NO_SECURE NVM_MATTER_ADDR_INIT_SECURE + SECTOR_SIZE_SECURE +#define NVM_MATTER_ADDR_INIT_NOSECURE_PTR ((void * const) NVM_MATTER_ADDR_INIT_NO_SECURE) +#define SECTOR_SIZE_NO_SECURE 4096 +#define NVM_SIZE_FLASH (SECTOR_SIZE_SECURE + SECTOR_SIZE_NO_SECURE) +#define NVM_MAX_KEY NVM_SIZE_FLASH / NVM_OFFSET_KEY + +typedef struct +{ + NVM_Sector id_sector; + uint8_t * ram_ptr; + size_t sector_size; + +} NVM_Sector_Struct; + +/* Private macros ------------------------------------------------------------*/ + +/* Private variables ---------------------------------------------------------*/ +uint8_t ram_nvm[SECTOR_SIZE_SECURE + SECTOR_SIZE_NO_SECURE] = { 0 }; + +const NVM_Sector_Struct sector_no_secure = { .id_sector = SECTOR_NO_SECURE, + .ram_ptr = ram_nvm + SECTOR_SIZE_SECURE, + .sector_size = SECTOR_SIZE_NO_SECURE }; + +//*SIMULATE TO EXAMPLE* +const NVM_Sector_Struct sector_secure = { .id_sector = SECTOR_SECURE, .ram_ptr = ram_nvm, .sector_size = SECTOR_SIZE_SECURE }; + +uint8_t CheckSanity = 0; +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ + +static uint8_t flash_get(uint8_t * KeyValue, uint8_t * KeyAddr, size_t KeySize, size_t * read_by_size); +static uint8_t flash_update(const NVM_Sector_Struct select_sector, uint8_t * KeyName, uint8_t * KeyValue, size_t KeySize); +static NVM_StatusTypeDef flash_replace(const NVM_Sector_Struct select_sector, uint8_t * PtKeyfind, uint8_t * KeyName, + uint8_t * KeyValue, size_t KeySize); +static NVM_StatusTypeDef flash_write(uint8_t * PtKeyFree, uint8_t * key, uint8_t * value, size_t value_size); +static uint8_t * SearchKey(uint8_t * PtPage, uint8_t * KeyName); +static NVM_StatusTypeDef delete_key(const NVM_Sector_Struct select_sector, uint8_t * PtkeyFind); + +/* Public functions ----------------------------------------------------------*/ + +void NM_Init(void) +{ + // Copy Nvm flash to ram, it used one time for boot + // copy no secure nvm to no secure ram + memcpy(sector_no_secure.ram_ptr, NVM_MATTER_ADDR_INIT_NOSECURE_PTR, sector_no_secure.sector_size); + + // copy secure nvm to secure ram *SIMULATE TO EXAMPLE* + memcpy(sector_secure.ram_ptr, NVM_MATTER_ADDR_INIT_SECURE_PTR, sector_secure.sector_size); +} + +NVM_StatusTypeDef NM_Check_Validity(void) +{ + NVM_StatusTypeDef err = NVM_OK; + if (CheckSanity != 0) + { + err = NVM_FLASH_CORRUPTION; + } + return err; +} + +NVM_StatusTypeDef NM_Dump(void) +{ + NVM_StatusTypeDef err = NVM_DELETE_FAILED; + + err = FD_EraseSectors((NVM_MATTER_ADDR_INIT_SECURE - FLASH_START) / (NVM_SIZE_FLASH / NB_SECTOR), NB_SECTOR); + if (err == 0) + { + err = FD_WriteData(NVM_MATTER_ADDR_INIT_SECURE, (uint64_t *) ram_nvm, (uint32_t)(NVM_SIZE_FLASH / sizeof(uint64_t))); + if (err != 0) + { + err = NVM_WRITE_FAILED; + } + else + { + if (memcmp(ram_nvm, (void *) NVM_MATTER_ADDR_INIT_SECURE, (size_t) NVM_SIZE_FLASH)) + { + err = NVM_WRITE_FAILED; + } + else + { + err = NVM_OK; + } + } + } + return err; +} + +NVM_StatusTypeDef NM_GetKeyValue(void * KeyValue, const char * KeyName, uint32_t KeySize, size_t * read_by_size, NVM_Sector sector) +{ + + NVM_Sector_Struct select_nvm = { 0 }; + switch (sector) + { + case SECTOR_NO_SECURE: + select_nvm = sector_no_secure; + break; + + case SECTOR_SECURE: + select_nvm = sector_secure; + break; + + default: + return NVM_WRITE_FAILED; + } + + uint8_t * key_search = SearchKey(select_nvm.ram_ptr, (uint8_t *) KeyName); + if (key_search != NULL) + { + // copy Keyname's value in KeyValue and copy the size of KeyValue in read_by_size + return flash_get(KeyValue, key_search, KeySize, read_by_size); + } + return NVM_KEY_NOT_FOUND; +} + +NVM_StatusTypeDef NM_SetKeyValue(char * KeyValue, char * KeyName, uint32_t KeySize, NVM_Sector sector) +{ + + NVM_Sector_Struct select_nvm = { 0 }; + void * Ptkey = NULL; + + switch (sector) + { + case SECTOR_NO_SECURE: + select_nvm = sector_no_secure; + break; + + case SECTOR_SECURE: + select_nvm = sector_secure; + break; + + default: + return NVM_WRITE_FAILED; + } + + if (KeySize > NVM_BLOCK_SIZE) + { + return NVM_BLOCK_SIZE_OVERFLOW; + } + // call function to search the pointer of key if it exist else return null + Ptkey = SearchKey(select_nvm.ram_ptr, (uint8_t *) KeyName); + + if (Ptkey == NULL) + { + return flash_update(select_nvm, (uint8_t *) KeyName, (uint8_t *) KeyValue, KeySize); + } + else + { + if (!flash_replace(select_nvm, Ptkey, (uint8_t *) KeyName, (uint8_t *) KeyValue, KeySize)) + { + return NVM_OK; + } + } + return NVM_WRITE_FAILED; +} + +uint8_t NM_DeleteKey(const char * Keyname, NVM_Sector sector) +{ + + NVM_Sector_Struct select_nvm = { 0 }; + switch (sector) + { + case SECTOR_NO_SECURE: + select_nvm = sector_no_secure; + break; + + case SECTOR_SECURE: + select_nvm = sector_secure; + break; + + default: + return NVM_WRITE_FAILED; + } + uint8_t * Ptkey = SearchKey(select_nvm.ram_ptr, (uint8_t *) Keyname); + if (Ptkey != NULL) + { + return delete_key(select_nvm, Ptkey); + } + return NVM_KEY_NOT_FOUND; +} + +void NM_ResetFactory(void) +{ + while (1) + { + FD_EraseSectors((NVM_MATTER_ADDR_INIT_SECURE - FLASH_START) / (NVM_SIZE_FLASH / NB_SECTOR), NB_SECTOR); + NVIC_SystemReset(); + } +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ + +static uint8_t * SearchKey(uint8_t * PtPage, uint8_t * KeyName) +{ + + uint8_t * i = PtPage; + size_t read_by_size = 0; + + while ((i >= PtPage) || (i < (PtPage + NVM_SIZE_FLASH))) + { + if (*i != DEFAULT_VALUE) + { + if (strcmp((char *) KeyName, (char *) i) == 0) + { + return i; + } + read_by_size = *(size_t *) ((uint8_t *) i + MATTER_KEY_NAME_MAX_LENGTH); + i += read_by_size + sizeof(size_t) + MATTER_KEY_NAME_MAX_LENGTH; + // Flash is corrupted + if ((i < PtPage) || (i > (PtPage + NVM_SIZE_FLASH))) + { + NM_ResetFactory(); + } + } + else + { + return NULL; + } + } + return NULL; +} + +static uint8_t flash_get(uint8_t * KeyValue, uint8_t * KeyAddr, size_t KeySize, size_t * read_by_size) +{ + *read_by_size = *(size_t *) ((uint8_t *) KeyAddr + MATTER_KEY_NAME_MAX_LENGTH); + if (KeySize >= *read_by_size) + { + memcpy(KeyValue, KeyAddr + MATTER_KEY_NAME_MAX_LENGTH + sizeof(size_t), *read_by_size); + return NVM_OK; + } + else + { + return NVM_BUFFER_TOO_SMALL; + } +} + +static NVM_StatusTypeDef flash_update(const NVM_Sector_Struct select_sector, uint8_t * KeyName, uint8_t * KeyValue, size_t KeySize) +{ + + uint8_t * i = select_sector.ram_ptr; + size_t read_by_size = 0; + while (i < (select_sector.ram_ptr + select_sector.sector_size)) + { + if (*i == DEFAULT_VALUE) + { + return flash_write(i, KeyName, KeyValue, KeySize); + } + read_by_size = *(size_t *) ((uint8_t *) i + MATTER_KEY_NAME_MAX_LENGTH); + if (read_by_size > NVM_BLOCK_SIZE) + { + return NVM_ERROR_BLOCK_ALIGN; + } + i += read_by_size + sizeof(size_t) + MATTER_KEY_NAME_MAX_LENGTH; + } + return NVM_SIZE_FULL; +} + +static NVM_StatusTypeDef flash_replace(const NVM_Sector_Struct select_sector, uint8_t * PtKeyfind, uint8_t * KeyName, + uint8_t * KeyValue, size_t KeySize) +{ + + NVM_StatusTypeDef err = NVM_OK; + if ((PtKeyfind != NULL) && (KeyName != NULL) && (KeyValue != NULL)) + { + err = delete_key(select_sector, PtKeyfind); + if (err != NVM_OK) + return err; + + err = flash_update(select_sector, KeyName, KeyValue, KeySize); + if (err != NVM_OK) + return err; + return err; + } + return NVM_WRITE_FAILED; +} + +static NVM_StatusTypeDef delete_key(const NVM_Sector_Struct select_sector, uint8_t * PtkeyFind) +{ + uint8_t * PtKeyNext = NULL; + uint8_t * PtKeyCpy = NULL; + size_t size_key = 0; + + if (PtkeyFind != NULL) + { + size_key = *(size_t *) ((uint8_t *) PtkeyFind + MATTER_KEY_NAME_MAX_LENGTH); + PtKeyNext = PtkeyFind + size_key + MATTER_KEY_NAME_MAX_LENGTH + sizeof(size_key); + PtKeyCpy = PtkeyFind; + while ((*PtKeyNext != 0xFF) && (PtKeyNext < (ram_nvm + NVM_SIZE_FLASH))) + { + size_key = *(size_t *) ((uint8_t *) PtKeyNext + MATTER_KEY_NAME_MAX_LENGTH); + memcpy(PtKeyCpy, PtKeyNext, size_key + sizeof(size_t) + MATTER_KEY_NAME_MAX_LENGTH); + PtKeyCpy += size_key + sizeof(size_t) + MATTER_KEY_NAME_MAX_LENGTH; + PtKeyNext += size_key + MATTER_KEY_NAME_MAX_LENGTH + sizeof(size_key); + } + memset(PtKeyCpy, DEFAULT_VALUE, (ram_nvm + NVM_SIZE_FLASH - PtKeyCpy)); + return NVM_OK; + } + return NVM_DELETE_FAILED; +} + +static NVM_StatusTypeDef flash_write(uint8_t * PtKeyFree, uint8_t * key, uint8_t * value, size_t value_size) +{ + + if ((PtKeyFree != NULL) && (key != NULL) && (value != NULL)) + { + + memset(PtKeyFree, DEFAULT_VALUE, value_size); + memset(PtKeyFree, 0x00, MATTER_KEY_NAME_MAX_LENGTH); + memcpy(PtKeyFree, key, strlen((char *) key)); + memcpy(PtKeyFree + MATTER_KEY_NAME_MAX_LENGTH, &value_size, sizeof(size_t)); + memcpy(PtKeyFree + MATTER_KEY_NAME_MAX_LENGTH + sizeof(size_t), value, value_size); + return NVM_OK; + } + return NVM_WRITE_FAILED; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/freertos_port.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/freertos_port.c new file mode 100644 index 00000000000000..ab2043c9b9139f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/freertos_port.c @@ -0,0 +1,322 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : freertos_port.c + * Description : Custom porting of FreeRTOS functionalities + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" + +#include "FreeRTOS.h" +#include "stm32_lpm.h" +#include "task.h" +#include + +/* Private typedef -----------------------------------------------------------*/ +typedef struct +{ + uint32_t LpTimeLeftOnEntry; + uint8_t LpTimerFreeRTOS_Id; +} LpTimerContext_t; + +/* Private defines -----------------------------------------------------------*/ +#ifndef configSYSTICK_CLOCK_HZ +#define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ +/* Ensure the SysTick is clocked at the same frequency as the core. */ +#define portNVIC_SYSTICK_CLK_BIT (1UL << 2UL) +#else +/* The way the SysTick is clocked is not modified in case it is not the same + as the core. */ +#define portNVIC_SYSTICK_CLK_BIT (0) +#endif + +#define CPU_CLOCK_KHZ (configCPU_CLOCK_HZ / 1000) + +/* Constants required to manipulate the core. Registers first... */ +#define portNVIC_SYSTICK_CTRL_REG (*((volatile uint32_t *) 0xe000e010)) +#define portNVIC_SYSTICK_LOAD_REG (*((volatile uint32_t *) 0xe000e014)) +#define portNVIC_SYSTICK_CURRENT_VALUE_REG (*((volatile uint32_t *) 0xe000e018)) +#define portNVIC_SYSTICK_INT_BIT (1UL << 1UL) +#define portNVIC_SYSTICK_ENABLE_BIT (1UL << 0UL) +#define portNVIC_SYSTICK_COUNT_FLAG_BIT (1UL << 16UL) + +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* + * The number of SysTick increments that make up one tick period. + */ +#if (CFG_LPM_SUPPORTED != 0) +static uint32_t ulTimerCountsForOneTick; + +static LpTimerContext_t LpTimerContext; +#endif +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +#if (CFG_LPM_SUPPORTED != 0) +static void LpTimerInit(void); +static void LpTimerCb(void); +static void LpTimerStart(uint32_t time_to_sleep); +static void LpEnter(void); +static uint32_t LpGetElapsedTime(void); +void vPortSetupTimerInterrupt(void); +#endif + +/* Functions Definition ------------------------------------------------------*/ + +/** + * @brief Implement the tickless feature + * + * + * @param: xExpectedIdleTime is given in number of FreeRTOS Ticks + * @retval: None + */ +void vPortSuppressTicksAndSleep(TickType_t xExpectedIdleTime) +{ + /* If low power is not used, do not stop the SysTick and continue execution */ +#if (CFG_LPM_SUPPORTED != 0) + /** + * Although this is not documented as such, when xExpectedIdleTime = 0xFFFFFFFF = (~0), + * it likely means the system may enter low power for ever ( from a FreeRTOS point of view ). + * Otherwise, for a FreeRTOS tick set to 1ms, that would mean it is requested to wakeup in 8 years from now. + * When the system may enter low power mode for ever, FreeRTOS is not really interested to maintain a + * systick count and when the system exits from low power mode, there is no need to update the count with + * the time spent in low power mode + */ + uint32_t ulCompleteTickPeriods; + + /* Stop the SysTick to avoid the interrupt to occur while in the critical section. + * Otherwise, this will prevent the device to enter low power mode + * At this time, an update of the systick will not be considered + * + */ + portNVIC_SYSTICK_CTRL_REG &= ~portNVIC_SYSTICK_ENABLE_BIT; + + /* Enter a critical section but don't use the taskENTER_CRITICAL() + method as that will mask interrupts that should exit sleep mode. */ + __disable_irq(); + __DSB(); + __ISB(); + + /* If a context switch is pending or a task is waiting for the scheduler + to be unsuspended then abandon the low power entry. */ + if (eTaskConfirmSleepModeStatus() == eAbortSleep) + { + /* Restart SysTick. */ + portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT; + + /* Re-enable interrupts - see comments above __disable_interrupt() + call above. */ + __enable_irq(); + } + else + { + if (xExpectedIdleTime != (~0)) + { + /* Remove one tick to wake up before the event occurs */ + xExpectedIdleTime--; + /* Start the low power timer */ + LpTimerStart(xExpectedIdleTime); + } + + /* Enter low power mode */ + LpEnter(); + + if (xExpectedIdleTime != (~0)) + { + /** + * Get the number of FreeRTOS ticks that has been suppressed + * In the current implementation, this shall be kept in critical section + * so that the timer server return the correct elapsed time + */ + ulCompleteTickPeriods = LpGetElapsedTime(); + vTaskStepTick(ulCompleteTickPeriods); + } + + /* Restart SysTick */ + portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL; + portNVIC_SYSTICK_CTRL_REG |= portNVIC_SYSTICK_ENABLE_BIT; + portNVIC_SYSTICK_LOAD_REG = ulTimerCountsForOneTick - 1UL; + + /* Exit with interrUpts enabled. */ + __enable_irq(); + } +#endif +} + +/* + * Setup the systick timer to generate the tick interrupts at the required + * frequency and initialize a low power timer + * The current implementation is kept as close as possible to the default tickless + * mode provided. + * The systick is still used when there is no need to go in low power mode. + * When the system needs to enter low power mode, the tick is suppressed and a low power timer + * is used over that time + * Note that in sleep mode, the system clock is still running and the default tickless implementation + * using systick could have been kept. + * However, as at that time, it is not yet known whereas the low power mode that will be used is stop mode or + * sleep mode, it is easier and simpler to go with a low power timer as soon as the tick need to be + * suppressed. + */ +#if (CFG_LPM_SUPPORTED != 0) +void vPortSetupTimerInterrupt(void) +{ + LpTimerInit(); + + /* Calculate the constants required to configure the tick interrupt. */ + ulTimerCountsForOneTick = (configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ); + + /* Stop and clear the SysTick. */ + portNVIC_SYSTICK_CTRL_REG = 0UL; + portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL; + + /* Configure SysTick to interrupt at the requested rate. */ + portNVIC_SYSTICK_LOAD_REG = (configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ) - 1UL; + portNVIC_SYSTICK_CTRL_REG = (portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT); +} +#endif + +/** + * @brief The current implementation uses the hw_timerserver to provide a low power timer + * This may be replaced by another low power timer. + * + * @param None + * @retval None + */ +#if (CFG_LPM_SUPPORTED != 0) +static void LpTimerInit(void) +{ + (void) HW_TS_Create(CFG_TIM_PROC_ID_ISR, &(LpTimerContext.LpTimerFreeRTOS_Id), hw_ts_SingleShot, LpTimerCb); + + return; +} +#endif + +/** + * @brief Low power timer callback + * + * @param None + * @retval None + */ +#if (CFG_LPM_SUPPORTED != 0) +static void LpTimerCb(void) +{ + /** + * Nothing to be done + */ + + return; +} +#endif + +/** + * @brief Request to start a low power timer ( running is stop mode ) + * + * @param time_to_sleep : Number of FreeRTOS ticks + * @retval None + */ +#if (CFG_LPM_SUPPORTED != 0) +static void LpTimerStart(uint32_t time_to_sleep) +{ + uint64_t time; + + /* Converts the number of FreeRTOS ticks into hw timer tick */ + if (time_to_sleep > (ULLONG_MAX / 1e12)) /* Prevent overflow in else statement */ + { + time = 0xFFFF0000; /* Maximum value equal to 24 days */ + } + else + { + /* The result always fits in uint32_t and is always less than 0xFFFF0000 */ + time = time_to_sleep * 1000000000000ULL; + time = (uint64_t)(time / (CFG_TS_TICK_VAL_PS * configTICK_RATE_HZ)); + } + + HW_TS_Start(LpTimerContext.LpTimerFreeRTOS_Id, (uint32_t) time); + + /** + * There might be other timers already running in the timer server that may elapse + * before this one. + * Store how long before the next event so that on wakeup, it will be possible to calculate + * how long the tick has been suppressed + */ + LpTimerContext.LpTimeLeftOnEntry = HW_TS_RTC_ReadLeftTicksToCount(); + + return; +} +#endif + +/** + * @brief Enter low power mode + * + * @param None + * @retval None + */ +#if (CFG_LPM_SUPPORTED != 0) +static void LpEnter(void) +{ +#if (CFG_LPM_SUPPORTED == 1) + UTIL_LPM_EnterLowPower(); +#endif + return; +} +#endif + +/** + * @brief Read how long the tick has been suppressed + * + * @param None + * @retval The number of tick rate (FreeRTOS tick) + */ +#if (CFG_LPM_SUPPORTED != 0) +static uint32_t LpGetElapsedTime(void) +{ + uint64_t val_ticks, time_ps; + uint32_t LpTimeLeftOnExit; + + LpTimeLeftOnExit = HW_TS_RTC_ReadLeftTicksToCount(); + /* This cannot overflow. Max result is ~ 1.6e13 */ + time_ps = (uint64_t)((CFG_TS_TICK_VAL_PS) * (uint64_t)(LpTimerContext.LpTimeLeftOnEntry - LpTimeLeftOnExit)); + + /* time_ps can be less than 1 RTOS tick in following situations + * a) MCU didn't go to STOP2 due to wake-up unrelated to Timer Server or woke up from STOP2 very shortly after. + * Advancing RTOS clock by 1 FreeRTOS tick doesn't hurt in this case. + * b) vPortSuppressTicksAndSleep(xExpectedIdleTime) was called with xExpectedIdleTime = 2 which is minimum value defined by + * configEXPECTED_IDLE_TIME_BEFORE_SLEEP. The xExpectedIdleTime is decremented by one RTOS tick to wake-up in advance. Ex: RTOS + * tick is 1ms, the timer Server wakes the MCU in ~977 us. RTOS clock should be advanced by 1 ms. + * */ + if (time_ps <= (1e12 / configTICK_RATE_HZ)) /* time_ps < RTOS tick */ + { + val_ticks = 1; + } + else + { + /* Convert pS time into OS ticks */ + val_ticks = time_ps * configTICK_RATE_HZ; /* This cannot overflow. Max result is ~ 1.6e16 */ + val_ticks = (uint64_t)(val_ticks / (1e12)); /* The result always fits in uint32_t */ + } + + /** + * The system may have been out from another reason than the timer + * Stop the timer after the elapsed time is calculated other wise, HW_TS_RTC_ReadLeftTicksToCount() + * may return 0xFFFF ( TIMER LIST EMPTY ) + * It does not hurt stopping a timer that exists but is not running. + */ + HW_TS_Stop(LpTimerContext.LpTimerFreeRTOS_Id); + + return (uint32_t) val_ticks; +} +#endif diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_timerserver.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_timerserver.c new file mode 100644 index 00000000000000..7409e7f8910319 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_timerserver.c @@ -0,0 +1,899 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file hw_timerserver.c + * @author MCD Application Team + * @brief Hardware timerserver source file for STM32WPAN Middleware. + ****************************************************************************** + * @attention + * + * Copyright (c) 2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" +#include "hw_conf.h" + +/* Private typedef -----------------------------------------------------------*/ +typedef enum +{ + TimerID_Free, + TimerID_Created, + TimerID_Running +} TimerIDStatus_t; + +typedef enum +{ + SSR_Read_Requested, + SSR_Read_Not_Requested +} RequestReadSSR_t; + +typedef enum +{ + WakeupTimerValue_Overpassed, + WakeupTimerValue_LargeEnough +} WakeupTimerLimitation_Status_t; + +typedef struct +{ + HW_TS_pTimerCb_t pTimerCallBack; + uint32_t CounterInit; + uint32_t CountLeft; + TimerIDStatus_t TimerIDStatus; + HW_TS_Mode_t TimerMode; + uint32_t TimerProcessID; + uint8_t PreviousID; + uint8_t NextID; +} TimerContext_t; + +/* Private defines -----------------------------------------------------------*/ +#define SSR_FORBIDDEN_VALUE 0xFFFFFFFF +#define TIMER_LIST_EMPTY 0xFFFF + +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ + +/** + * START of Section TIMERSERVER_CONTEXT + */ + +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile TimerContext_t aTimerContext[CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER]; +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t CurrentRunningTimerID; +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint8_t PreviousRunningTimerID; +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile uint32_t SSRValueOnLastSetup; +PLACE_IN_SECTION("TIMERSERVER_CONTEXT") static volatile WakeupTimerLimitation_Status_t WakeupTimerLimitation; + +/** + * END of Section TIMERSERVER_CONTEXT + */ + +static RTC_HandleTypeDef * phrtc; /**< RTC handle */ +static uint8_t WakeupTimerDivider; +static uint8_t AsynchPrescalerUserConfig; +static uint16_t SynchPrescalerUserConfig; +static volatile uint16_t MaxWakeupTimerSetup; + +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +static void RestartWakeupCounter(uint16_t Value); +static uint16_t ReturnTimeElapsed(void); +static void RescheduleTimerList(void); +static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR); +static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID); +static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID); +static uint16_t linkTimer(uint8_t TimerID); +static uint32_t ReadRtcSsrValue(void); + +__weak void HW_TS_RTC_CountUpdated_AppNot(void); + +/* Functions Definition ------------------------------------------------------*/ + +/** + * @brief Read the RTC_SSR value + * As described in the reference manual, the RTC_SSR shall be read twice to ensure + * reliability of the value + * @param None + * @retval SSR value read + */ +static uint32_t ReadRtcSsrValue(void) +{ + uint32_t first_read; + uint32_t second_read; + + first_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS)); + + second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS)); + + while (first_read != second_read) + { + first_read = second_read; + + second_read = (uint32_t)(READ_BIT(RTC->SSR, RTC_SSR_SS)); + } + + return second_read; +} + +/** + * @brief Insert a Timer in the list after the Timer ID specified + * @param TimerID: The ID of the Timer + * @param RefTimerID: The ID of the Timer to be linked after + * @retval None + */ +static void LinkTimerAfter(uint8_t TimerID, uint8_t RefTimerID) +{ + uint8_t next_id; + + next_id = aTimerContext[RefTimerID].NextID; + + if (next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + aTimerContext[next_id].PreviousID = TimerID; + } + aTimerContext[TimerID].NextID = next_id; + aTimerContext[TimerID].PreviousID = RefTimerID; + aTimerContext[RefTimerID].NextID = TimerID; + + return; +} + +/** + * @brief Insert a Timer in the list before the ID specified + * @param TimerID: The ID of the Timer + * @param RefTimerID: The ID of the Timer to be linked before + * @retval None + */ +static void LinkTimerBefore(uint8_t TimerID, uint8_t RefTimerID) +{ + uint8_t previous_id; + + if (RefTimerID != CurrentRunningTimerID) + { + previous_id = aTimerContext[RefTimerID].PreviousID; + + aTimerContext[previous_id].NextID = TimerID; + aTimerContext[TimerID].NextID = RefTimerID; + aTimerContext[TimerID].PreviousID = previous_id; + aTimerContext[RefTimerID].PreviousID = TimerID; + } + else + { + aTimerContext[TimerID].NextID = RefTimerID; + aTimerContext[RefTimerID].PreviousID = TimerID; + } + + return; +} + +/** + * @brief Insert a Timer in the list + * @param TimerID: The ID of the Timer + * @retval None + */ +static uint16_t linkTimer(uint8_t TimerID) +{ + uint32_t time_left; + uint16_t time_elapsed; + uint8_t timer_id_lookup; + uint8_t next_id; + + if (CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + /** + * No timer in the list + */ + PreviousRunningTimerID = CurrentRunningTimerID; + CurrentRunningTimerID = TimerID; + aTimerContext[TimerID].NextID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; + + SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE; + time_elapsed = 0; + } + else + { + time_elapsed = ReturnTimeElapsed(); + + /** + * update count of the timer to be linked + */ + aTimerContext[TimerID].CountLeft += time_elapsed; + time_left = aTimerContext[TimerID].CountLeft; + + /** + * Search for index where the new timer shall be linked + */ + if (aTimerContext[CurrentRunningTimerID].CountLeft <= time_left) + { + /** + * Search for the ID after the first one + */ + timer_id_lookup = CurrentRunningTimerID; + next_id = aTimerContext[timer_id_lookup].NextID; + while ((next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[next_id].CountLeft <= time_left)) + { + timer_id_lookup = aTimerContext[timer_id_lookup].NextID; + next_id = aTimerContext[timer_id_lookup].NextID; + } + + /** + * Link after the ID + */ + LinkTimerAfter(TimerID, timer_id_lookup); + } + else + { + /** + * Link before the first ID + */ + LinkTimerBefore(TimerID, CurrentRunningTimerID); + PreviousRunningTimerID = CurrentRunningTimerID; + CurrentRunningTimerID = TimerID; + } + } + + return time_elapsed; +} + +/** + * @brief Remove a Timer from the list + * @param TimerID: The ID of the Timer + * @param RequestReadSSR: Request to read the SSR register or not + * @retval None + */ +static void UnlinkTimer(uint8_t TimerID, RequestReadSSR_t RequestReadSSR) +{ + uint8_t previous_id; + uint8_t next_id; + + if (TimerID == CurrentRunningTimerID) + { + PreviousRunningTimerID = CurrentRunningTimerID; + CurrentRunningTimerID = aTimerContext[TimerID].NextID; + } + else + { + previous_id = aTimerContext[TimerID].PreviousID; + next_id = aTimerContext[TimerID].NextID; + + aTimerContext[previous_id].NextID = aTimerContext[TimerID].NextID; + if (next_id != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + aTimerContext[next_id].PreviousID = aTimerContext[TimerID].PreviousID; + } + } + + /** + * Timer is out of the list + */ + aTimerContext[TimerID].TimerIDStatus = TimerID_Created; + + if ((CurrentRunningTimerID == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (RequestReadSSR == SSR_Read_Requested)) + { + SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE; + } + + return; +} + +/** + * @brief Return the number of ticks counted by the wakeuptimer since it has been started + * @note The API is reading the SSR register to get how many ticks have been counted + * since the time the timer has been started + * @param None + * @retval Time expired in Ticks + */ +static uint16_t ReturnTimeElapsed(void) +{ + uint32_t return_value; + uint32_t wrap_counter; + + if (SSRValueOnLastSetup != SSR_FORBIDDEN_VALUE) + { + return_value = ReadRtcSsrValue(); /**< Read SSR register first */ + + if (SSRValueOnLastSetup >= return_value) + { + return_value = SSRValueOnLastSetup - return_value; + } + else + { + wrap_counter = SynchPrescalerUserConfig - return_value; + return_value = SSRValueOnLastSetup + wrap_counter; + } + + /** + * At this stage, ReturnValue holds the number of ticks counted by SSR + * Need to translate in number of ticks counted by the Wakeuptimer + */ + return_value = return_value * AsynchPrescalerUserConfig; + return_value = return_value >> WakeupTimerDivider; + } + else + { + return_value = 0; + } + + return (uint16_t) return_value; +} + +/** + * @brief Set the wakeup counter + * @note The API is writing the counter value so that the value is decreased by one to cope with the fact + * the interrupt is generated with 1 extra clock cycle (See RefManuel) + * It assumes all condition are met to be allowed to write the wakeup counter + * @param Value: Value to be written in the counter + * @retval None + */ +static void RestartWakeupCounter(uint16_t Value) +{ + /** + * The wakeuptimer has been disabled in the calling function to reduce the time to poll the WUTWF + * FLAG when the new value will have to be written + * __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); + */ + + if (Value == 0) + { + SSRValueOnLastSetup = ReadRtcSsrValue(); + + /** + * Simulate that the Timer expired + */ + HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); + } + else + { + if ((Value > 1) || (WakeupTimerDivider != 1)) + { + Value -= 1; + } + + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET) + ; + + /** + * make sure to clear the flags after checking the WUTWF. + * It takes 2 RTCCLK between the time the WUTE bit is disabled and the + * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable + * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between + * due to the autoreload feature + */ + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */ + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */ + HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */ + + MODIFY_REG(RTC->WUTR, RTC_WUTR_WUT, Value); + + /** + * Update the value here after the WUTWF polling that may take some time + */ + SSRValueOnLastSetup = ReadRtcSsrValue(); + + __HAL_RTC_WAKEUPTIMER_ENABLE(phrtc); /**< Enable the Wakeup Timer */ + + HW_TS_RTC_CountUpdated_AppNot(); + } + + return; +} + +/** + * @brief Reschedule the list of timer + * @note 1) Update the count left for each timer in the list + * 2) Setup the wakeuptimer + * @param None + * @retval None + */ +static void RescheduleTimerList(void) +{ + uint8_t localTimerID; + uint32_t timecountleft; + uint16_t wakeup_timer_value; + uint16_t time_elapsed; + + /** + * The wakeuptimer is disabled now to reduce the time to poll the WUTWF + * FLAG when the new value will have to be written + */ + if ((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET) + { + /** + * Wait for the flag to be back to 0 when the wakeup timer is enabled + */ + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET) + ; + } + __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */ + + localTimerID = CurrentRunningTimerID; + + /** + * Calculate what will be the value to write in the wakeuptimer + */ + timecountleft = aTimerContext[localTimerID].CountLeft; + + /** + * Read how much has been counted + */ + time_elapsed = ReturnTimeElapsed(); + + if (timecountleft < time_elapsed) + { + /** + * There is no tick left to count + */ + wakeup_timer_value = 0; + WakeupTimerLimitation = WakeupTimerValue_LargeEnough; + } + else + { + if (timecountleft > (time_elapsed + MaxWakeupTimerSetup)) + { + /** + * The number of tick left is greater than the Wakeuptimer maximum value + */ + wakeup_timer_value = MaxWakeupTimerSetup; + + WakeupTimerLimitation = WakeupTimerValue_Overpassed; + } + else + { + wakeup_timer_value = timecountleft - time_elapsed; + WakeupTimerLimitation = WakeupTimerValue_LargeEnough; + } + } + + /** + * update ticks left to be counted for each timer + */ + while (localTimerID != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + if (aTimerContext[localTimerID].CountLeft < time_elapsed) + { + aTimerContext[localTimerID].CountLeft = 0; + } + else + { + aTimerContext[localTimerID].CountLeft -= time_elapsed; + } + localTimerID = aTimerContext[localTimerID].NextID; + } + + /** + * Write next count + */ + RestartWakeupCounter(wakeup_timer_value); + + return; +} + +/* Public functions ----------------------------------------------------------*/ + +/** + * For all public interface except that may need write access to the RTC, the RTC + * shall be unlock at the beginning and locked at the output + * In order to ease maintainability, the unlock is done at the top and the lock at then end + * in case some new implementation is coming in the future + */ + +void HW_TS_RTC_Wakeup_Handler(void) +{ + HW_TS_pTimerCb_t ptimer_callback; + uint32_t timer_process_id; + uint8_t local_current_running_timer_id; +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + uint32_t primask_bit; +#endif + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ +#endif + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + + /** + * Disable the Wakeup Timer + * This may speed up a bit the processing to wait the timer to be disabled + * The timer is still counting 2 RTCCLK + */ + __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); + + local_current_running_timer_id = CurrentRunningTimerID; + + if (aTimerContext[local_current_running_timer_id].TimerIDStatus == TimerID_Running) + { + ptimer_callback = aTimerContext[local_current_running_timer_id].pTimerCallBack; + timer_process_id = aTimerContext[local_current_running_timer_id].TimerProcessID; + + /** + * It should be good to check whether the TimeElapsed is greater or not than the tick left to be counted + * However, due to the inaccuracy of the reading of the time elapsed, it may return there is 1 tick + * to be left whereas the count is over + * A more secure implementation has been done with a flag to state whereas the full count has been written + * in the wakeuptimer or not + */ + if (WakeupTimerLimitation != WakeupTimerValue_Overpassed) + { + if (aTimerContext[local_current_running_timer_id].TimerMode == hw_ts_Repeated) + { + UnlinkTimer(local_current_running_timer_id, SSR_Read_Not_Requested); +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + HW_TS_Start(local_current_running_timer_id, aTimerContext[local_current_running_timer_id].CounterInit); + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + } + else + { +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + HW_TS_Stop(local_current_running_timer_id); + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + } + + HW_TS_RTC_Int_AppNot(timer_process_id, local_current_running_timer_id, ptimer_callback); + } + else + { + RescheduleTimerList(); +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + } + } + else + { + /** + * We should never end up in this case + * However, if due to any bug in the timer server this is the case, the mistake may not impact the user. + * We could just clean the interrupt flag and get out from this unexpected interrupt + */ + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET) + ; + + /** + * make sure to clear the flags after checking the WUTWF. + * It takes 2 RTCCLK between the time the WUTE bit is disabled and the + * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable + * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between + * due to the autoreload feature + */ + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */ + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */ + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + } + + /* Enable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_ENABLE(phrtc); + + return; +} + +void HW_TS_Init(HW_TS_InitMode_t TimerInitMode, RTC_HandleTypeDef * hrtc) +{ + uint8_t loop; + uint32_t localmaxwakeuptimersetup; + + /** + * Get RTC handler + */ + phrtc = hrtc; + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + + SET_BIT(RTC->CR, RTC_CR_BYPSHAD); + + /** + * Readout the user config + */ + WakeupTimerDivider = (4 - ((uint32_t)(READ_BIT(RTC->CR, RTC_CR_WUCKSEL)))); + + AsynchPrescalerUserConfig = (uint8_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_A) >> (uint32_t) POSITION_VAL(RTC_PRER_PREDIV_A)) + 1; + + SynchPrescalerUserConfig = (uint16_t)(READ_BIT(RTC->PRER, RTC_PRER_PREDIV_S)) + 1; + + /** + * Margin is taken to avoid wrong calculation when the wrap around is there and some + * application interrupts may have delayed the reading + */ + localmaxwakeuptimersetup = + ((((SynchPrescalerUserConfig - 1) * AsynchPrescalerUserConfig) - CFG_HW_TS_RTC_HANDLER_MAX_DELAY) >> WakeupTimerDivider); + + if (localmaxwakeuptimersetup >= 0xFFFF) + { + MaxWakeupTimerSetup = 0xFFFF; + } + else + { + MaxWakeupTimerSetup = (uint16_t) localmaxwakeuptimersetup; + } + + /** + * Configure EXTI module + */ + LL_EXTI_EnableRisingTrig_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT); + LL_EXTI_EnableIT_0_31(RTC_EXTI_LINE_WAKEUPTIMER_EVENT); + + if (TimerInitMode == hw_ts_InitMode_Full) + { + WakeupTimerLimitation = WakeupTimerValue_LargeEnough; + SSRValueOnLastSetup = SSR_FORBIDDEN_VALUE; + + /** + * Initialize the timer server + */ + for (loop = 0; loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; loop++) + { + aTimerContext[loop].TimerIDStatus = TimerID_Free; + } + + CurrentRunningTimerID = CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER; /**< Set ID to non valid value */ + + __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */ + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */ + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */ + HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */ + __HAL_RTC_WAKEUPTIMER_ENABLE_IT(phrtc, RTC_IT_WUT); /**< Enable interrupt in RTC module */ + } + else + { + if (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTF) != RESET) + { + /** + * Simulate that the Timer expired + */ + HAL_NVIC_SetPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); + } + } + + /* Enable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_ENABLE(phrtc); + + HAL_NVIC_SetPriority(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID, CFG_HW_TS_NVIC_RTC_WAKEUP_IT_PREEMPTPRIO, + CFG_HW_TS_NVIC_RTC_WAKEUP_IT_SUBPRIO); /**< Set NVIC priority */ + HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */ + + return; +} + +HW_TS_ReturnStatus_t HW_TS_Create(uint32_t TimerProcessID, uint8_t * pTimerId, HW_TS_Mode_t TimerMode, + HW_TS_pTimerCb_t pftimeout_handler) +{ + HW_TS_ReturnStatus_t localreturnstatus; + uint8_t loop = 0; +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + uint32_t primask_bit; +#endif + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ +#endif + + while ((loop < CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) && (aTimerContext[loop].TimerIDStatus != TimerID_Free)) + { + loop++; + } + + if (loop != CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + aTimerContext[loop].TimerIDStatus = TimerID_Created; + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + + aTimerContext[loop].TimerProcessID = TimerProcessID; + aTimerContext[loop].TimerMode = TimerMode; + aTimerContext[loop].pTimerCallBack = pftimeout_handler; + *pTimerId = loop; + + localreturnstatus = hw_ts_Successful; + } + else + { +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + + localreturnstatus = hw_ts_Failed; + } + + return (localreturnstatus); +} + +void HW_TS_Delete(uint8_t timer_id) +{ + HW_TS_Stop(timer_id); + + aTimerContext[timer_id].TimerIDStatus = TimerID_Free; /**< release ID */ + + return; +} + +void HW_TS_Stop(uint8_t timer_id) +{ + uint8_t localcurrentrunningtimerid; + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + uint32_t primask_bit; +#endif + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ +#endif + + HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */ + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + + if (aTimerContext[timer_id].TimerIDStatus == TimerID_Running) + { + UnlinkTimer(timer_id, SSR_Read_Requested); + localcurrentrunningtimerid = CurrentRunningTimerID; + + if (localcurrentrunningtimerid == CFG_HW_TS_MAX_NBR_CONCURRENT_TIMER) + { + /** + * List is empty + */ + + /** + * Disable the timer + */ + if ((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET) + { + /** + * Wait for the flag to be back to 0 when the wakeup timer is enabled + */ + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == SET) + ; + } + __HAL_RTC_WAKEUPTIMER_DISABLE(phrtc); /**< Disable the Wakeup Timer */ + + while (__HAL_RTC_WAKEUPTIMER_GET_FLAG(phrtc, RTC_FLAG_WUTWF) == RESET) + ; + + /** + * make sure to clear the flags after checking the WUTWF. + * It takes 2 RTCCLK between the time the WUTE bit is disabled and the + * time the timer is disabled. The WUTWF bit somehow guarantee the system is stable + * Otherwise, when the timer is periodic with 1 Tick, it may generate an extra interrupt in between + * due to the autoreload feature + */ + __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(phrtc, RTC_FLAG_WUTF); /**< Clear flag in RTC module */ + __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG(); /**< Clear flag in EXTI module */ + HAL_NVIC_ClearPendingIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Clear pending bit in NVIC */ + } + else if (PreviousRunningTimerID != localcurrentrunningtimerid) + { + RescheduleTimerList(); + } + } + + /* Enable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_ENABLE(phrtc); + + HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */ + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + + return; +} + +void HW_TS_Start(uint8_t timer_id, uint32_t timeout_ticks) +{ + uint16_t time_elapsed; + uint8_t localcurrentrunningtimerid; + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + uint32_t primask_bit; +#endif + + if (aTimerContext[timer_id].TimerIDStatus == TimerID_Running) + { + HW_TS_Stop(timer_id); + } + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ +#endif + + HAL_NVIC_DisableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Disable NVIC */ + + /* Disable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_DISABLE(phrtc); + + aTimerContext[timer_id].TimerIDStatus = TimerID_Running; + + aTimerContext[timer_id].CountLeft = timeout_ticks; + aTimerContext[timer_id].CounterInit = timeout_ticks; + + time_elapsed = linkTimer(timer_id); + + localcurrentrunningtimerid = CurrentRunningTimerID; + + if (PreviousRunningTimerID != localcurrentrunningtimerid) + { + RescheduleTimerList(); + } + else + { + aTimerContext[timer_id].CountLeft -= time_elapsed; + } + + /* Enable the write protection for RTC registers */ + __HAL_RTC_WRITEPROTECTION_ENABLE(phrtc); + + HAL_NVIC_EnableIRQ(CFG_HW_TS_RTC_WAKEUP_HANDLER_ID); /**< Enable NVIC */ + +#if (CFG_HW_TS_USE_PRIMASK_AS_CRITICAL_SECTION == 1) + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ +#endif + + return; +} + +uint16_t HW_TS_RTC_ReadLeftTicksToCount(void) +{ + uint32_t primask_bit; + uint16_t return_value, auro_reload_value, elapsed_time_value; + + primask_bit = __get_PRIMASK(); /**< backup PRIMASK bit */ + __disable_irq(); /**< Disable all interrupts by setting PRIMASK bit on Cortex*/ + + if ((READ_BIT(RTC->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)) == SET) + { + auro_reload_value = (uint32_t)(READ_BIT(RTC->WUTR, RTC_WUTR_WUT)); + + elapsed_time_value = ReturnTimeElapsed(); + + if (auro_reload_value > elapsed_time_value) + { + return_value = auro_reload_value - elapsed_time_value; + } + else + { + return_value = 0; + } + } + else + { + return_value = TIMER_LIST_EMPTY; + } + + __set_PRIMASK(primask_bit); /**< Restore PRIMASK bit*/ + + return (return_value); +} + +__weak void HW_TS_RTC_Int_AppNot(uint32_t TimerProcessID, uint8_t TimerID, HW_TS_pTimerCb_t pTimerCallBack) +{ + pTimerCallBack(); + + return; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_uart.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_uart.c new file mode 100644 index 00000000000000..f647dc4f87993f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/hw_uart.c @@ -0,0 +1,469 @@ +/** + ****************************************************************************** + * @file hw_uart.c + * @author MCD Application Team + * @brief hardware access + ****************************************************************************** + * @attention + * + * Copyright (c) 2018(-2021) STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "app_common.h" +#include "hw_conf.h" + +/* Macros --------------------------------------------------------------------*/ +#define HW_UART_INIT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + (__HANDLE__).Instance = (__USART_BASE__); \ + (__HANDLE__).Init.BaudRate = CFG_HW_##__USART_BASE__##_BAUDRATE; \ + (__HANDLE__).Init.WordLength = CFG_HW_##__USART_BASE__##_WORDLENGTH; \ + (__HANDLE__).Init.StopBits = CFG_HW_##__USART_BASE__##_STOPBITS; \ + (__HANDLE__).Init.Parity = CFG_HW_##__USART_BASE__##_PARITY; \ + (__HANDLE__).Init.HwFlowCtl = CFG_HW_##__USART_BASE__##_HWFLOWCTL; \ + (__HANDLE__).Init.Mode = CFG_HW_##__USART_BASE__##_MODE; \ + (__HANDLE__).Init.OverSampling = CFG_HW_##__USART_BASE__##_OVERSAMPLING; \ + (__HANDLE__).AdvancedInit.AdvFeatureInit = CFG_HW_##__USART_BASE__##_ADVFEATUREINIT; \ + HAL_UART_Init(&(__HANDLE__)); \ + } while (0) + +#define HW_UART_RX_IT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + HW_##__HANDLE__##RxCb = cb; \ + (__HANDLE__).Instance = (__USART_BASE__); \ + HAL_UART_Receive_IT(&(__HANDLE__), p_data, size); \ + } while (0) + +#define HW_UART_TX_IT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + HW_##__HANDLE__##TxCb = cb; \ + (__HANDLE__).Instance = (__USART_BASE__); \ + HAL_UART_Transmit_IT(&(__HANDLE__), p_data, size); \ + } while (0) + +#define HW_UART_TX(__HANDLE__, __USART_BASE__) \ + do \ + { \ + (__HANDLE__).Instance = (__USART_BASE__); \ + hal_status = HAL_UART_Transmit(&(__HANDLE__), p_data, size, timeout); \ + } while (0) + +#define HW_UART_MSP_UART_INIT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + /* Enable GPIO clock */ \ + CFG_HW_##__USART_BASE__##_TX_PORT_CLK_ENABLE(); \ + \ + /* Enable USART clock */ \ + __HAL_RCC_##__USART_BASE__##_CLK_ENABLE(); \ + \ + GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_TX_PIN; \ + GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_TX_MODE; \ + GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_TX_PULL; \ + GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_TX_SPEED; \ + GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_TX_ALTERNATE; \ + \ + HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_TX_PORT, &GPIO_InitStruct); \ + \ + CFG_HW_##__USART_BASE__##_RX_PORT_CLK_ENABLE(); \ + \ + GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_RX_PIN; \ + GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_RX_MODE; \ + GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_RX_PULL; \ + GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_RX_SPEED; \ + GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_RX_ALTERNATE; \ + \ + HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_RX_PORT, &GPIO_InitStruct); \ + \ + CFG_HW_##__USART_BASE__##_CTS_PORT_CLK_ENABLE(); \ + \ + GPIO_InitStruct.Pin = CFG_HW_##__USART_BASE__##_CTS_PIN; \ + GPIO_InitStruct.Mode = CFG_HW_##__USART_BASE__##_CTS_MODE; \ + GPIO_InitStruct.Pull = CFG_HW_##__USART_BASE__##_CTS_PULL; \ + GPIO_InitStruct.Speed = CFG_HW_##__USART_BASE__##_CTS_SPEED; \ + GPIO_InitStruct.Alternate = CFG_HW_##__USART_BASE__##_CTS_ALTERNATE; \ + \ + HAL_GPIO_Init(CFG_HW_##__USART_BASE__##_CTS_PORT, &GPIO_InitStruct); \ + \ + HAL_NVIC_SetPriority(__USART_BASE__##_IRQn, CFG_HW_##__USART_BASE__##_PREEMPTPRIORITY, \ + CFG_HW_##__USART_BASE__##_SUBPRIORITY); \ + HAL_NVIC_EnableIRQ(__USART_BASE__##_IRQn); \ + } while (0) + +#define HW_UART_MSP_TX_DMA_INIT(__HANDLE__, __USART_BASE__) \ + do \ + { \ + /* Configure the DMA handler for Transmission process */ \ + /* Enable DMA clock */ \ + CFG_HW_##__USART_BASE__##_DMA_CLK_ENABLE(); \ + /* Enable DMA MUX clock */ \ + CFG_HW_##__USART_BASE__##_DMAMUX_CLK_ENABLE(); \ + \ + HW_hdma_##__HANDLE__##_tx.Instance = CFG_HW_##__USART_BASE__##_TX_DMA_CHANNEL; \ + HW_hdma_##__HANDLE__##_tx.Init.Request = CFG_HW_##__USART_BASE__##_TX_DMA_REQ; \ + HW_hdma_##__HANDLE__##_tx.Init.Direction = DMA_MEMORY_TO_PERIPH; \ + HW_hdma_##__HANDLE__##_tx.Init.PeriphInc = DMA_PINC_DISABLE; \ + HW_hdma_##__HANDLE__##_tx.Init.MemInc = DMA_MINC_ENABLE; \ + HW_hdma_##__HANDLE__##_tx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE; \ + HW_hdma_##__HANDLE__##_tx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE; \ + HW_hdma_##__HANDLE__##_tx.Init.Mode = DMA_NORMAL; \ + HW_hdma_##__HANDLE__##_tx.Init.Priority = DMA_PRIORITY_LOW; \ + \ + HAL_DMA_Init(&HW_hdma_##__HANDLE__##_tx); \ + \ + /* Associate the initialized DMA handle to the UART handle */ \ + __HAL_LINKDMA(huart, hdmatx, HW_hdma_##__HANDLE__##_tx); \ + \ + /* NVIC configuration for DMA transfer complete interrupt */ \ + HAL_NVIC_SetPriority(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn, CFG_HW_##__USART_BASE__##_DMA_TX_PREEMPTPRIORITY, \ + CFG_HW_##__USART_BASE__##_DMA_TX_SUBPRIORITY); \ + HAL_NVIC_EnableIRQ(CFG_HW_##__USART_BASE__##_TX_DMA_IRQn); \ + } while (0) + +/* Variables ------------------------------------------------------------------*/ +#if (CFG_HW_USART1_ENABLED == 1) +UART_HandleTypeDef huart1 = { 0 }; +#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1) +DMA_HandleTypeDef HW_hdma_huart1_tx = { 0 }; +#endif +void (*HW_huart1RxCb)(void); +void (*HW_huart1TxCb)(void); +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) +UART_HandleTypeDef lpuart1 = { 0 }; +#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1) +DMA_HandleTypeDef HW_hdma_lpuart1_tx = { 0 }; +#endif +void (*HW_lpuart1RxCb)(void); +void (*HW_lpuart1TxCb)(void); +#endif + +void HW_UART_Init(hw_uart_id_t hw_uart_id) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_UART_INIT(huart1, USART1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_UART_INIT(lpuart1, LPUART1); + break; +#endif + + default: + break; + } + + return; +} + +void HW_UART_Receive_IT(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, void (*cb)(void)) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_UART_RX_IT(huart1, USART1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_UART_RX_IT(lpuart1, LPUART1); + break; +#endif + + default: + break; + } + + return; +} + +void HW_UART_Transmit_IT(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, void (*cb)(void)) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_UART_TX_IT(huart1, USART1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_UART_TX_IT(lpuart1, LPUART1); + break; +#endif + + default: + break; + } + + return; +} + +hw_status_t HW_UART_Transmit(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, uint32_t timeout) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + hw_status_t hw_status = hw_uart_ok; + + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_UART_TX(huart1, USART1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_UART_TX(lpuart1, LPUART1); + break; +#endif + + default: + break; + } + + switch (hal_status) + { + case HAL_OK: + hw_status = hw_uart_ok; + break; + + case HAL_ERROR: + hw_status = hw_uart_error; + break; + + case HAL_BUSY: + hw_status = hw_uart_busy; + break; + + case HAL_TIMEOUT: + hw_status = hw_uart_to; + break; + + default: + break; + } + + return hw_status; +} + +hw_status_t HW_UART_Transmit_DMA(hw_uart_id_t hw_uart_id, uint8_t * p_data, uint16_t size, void (*cb)(void)) +{ + HAL_StatusTypeDef hal_status = HAL_OK; + hw_status_t hw_status = hw_uart_ok; + + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HW_huart1TxCb = cb; + huart1.Instance = USART1; + hal_status = HAL_UART_Transmit_DMA(&huart1, p_data, size); + break; +#endif + +#if (CFG_HW_USART2_ENABLED == 1) + case hw_uart2: + HW_huart2TxCb = cb; + huart2.Instance = USART2; + hal_status = HAL_UART_Transmit_DMA(&huart2, p_data, size); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HW_lpuart1TxCb = cb; + lpuart1.Instance = LPUART1; + hal_status = HAL_UART_Transmit_DMA(&lpuart1, p_data, size); + break; +#endif + + default: + break; + } + + switch (hal_status) + { + case HAL_OK: + hw_status = hw_uart_ok; + break; + + case HAL_ERROR: + hw_status = hw_uart_error; + break; + + case HAL_BUSY: + hw_status = hw_uart_busy; + break; + + case HAL_TIMEOUT: + hw_status = hw_uart_to; + break; + + default: + break; + } + + return hw_status; +} + +void HW_UART_Interrupt_Handler(hw_uart_id_t hw_uart_id) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_ENABLED == 1) + case hw_uart1: + HAL_UART_IRQHandler(&huart1); + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case hw_lpuart1: + HAL_UART_IRQHandler(&lpuart1); + break; +#endif + + default: + break; + } + + return; +} + +void HW_UART_DMA_Interrupt_Handler(hw_uart_id_t hw_uart_id) +{ + switch (hw_uart_id) + { +#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1) + case hw_uart1: + HAL_DMA_IRQHandler(huart1.hdmatx); + break; +#endif + +#if (CFG_HW_USART2_DMA_TX_SUPPORTED == 1) + case hw_uart2: + HAL_DMA_IRQHandler(huart2.hdmatx); + break; +#endif + +#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1) + case hw_lpuart1: + HAL_DMA_IRQHandler(lpuart1.hdmatx); + break; +#endif + + default: + break; + } + + return; +} + +void HAL_UART_MspInit(UART_HandleTypeDef * huart) +{ + GPIO_InitTypeDef GPIO_InitStruct = { 0 }; + + switch ((uint32_t) huart->Instance) + { +#if (CFG_HW_USART1_ENABLED == 1) + case (uint32_t) USART1: + HW_UART_MSP_UART_INIT(huart1, USART1); +#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1) + HW_UART_MSP_TX_DMA_INIT(huart1, USART1); +#endif + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case (uint32_t) LPUART1: + HW_UART_MSP_UART_INIT(lpuart1, LPUART1); +#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1) + HW_UART_MSP_TX_DMA_INIT(lpuart1, LPUART1); +#endif + break; +#endif + + default: + break; + } + + return; +} + +void HAL_UART_RxCpltCallback(UART_HandleTypeDef * huart) +{ + switch ((uint32_t) huart->Instance) + { +#if (CFG_HW_USART1_ENABLED == 1) + case (uint32_t) USART1: + if (HW_huart1RxCb) + { + HW_huart1RxCb(); + } + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case (uint32_t) LPUART1: + if (HW_lpuart1RxCb) + { + HW_lpuart1RxCb(); + } + break; +#endif + + default: + break; + } + + return; +} + +void HAL_UART_TxCpltCallback(UART_HandleTypeDef * huart) +{ + switch ((uint32_t) huart->Instance) + { +#if (CFG_HW_USART1_ENABLED == 1) + case (uint32_t) USART1: + if (HW_huart1TxCb) + { + HW_huart1TxCb(); + } + break; +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) + case (uint32_t) LPUART1: + if (HW_lpuart1TxCb) + { + HW_lpuart1TxCb(); + } + break; +#endif + + default: + break; + } + + return; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/main.cpp b/examples/platform/stm32/common/STM32WB5MM-DK/Src/main.cpp new file mode 100644 index 00000000000000..a48e8b88dc6101 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/main.cpp @@ -0,0 +1,439 @@ +/** + ****************************************************************************** + * @file : app_main.cpp + * @author : MCD Application Team + * @brief : Main program body + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### IMPORTANT NOTE ##### + ============================================================================== + + This application requests having the stm32wb5x_BLE_Thread_ForMatter_fw.bin binary + flashed on the Wireless Coprocessor. + If it is not the case, you need to use STM32CubeProgrammer to load the appropriate + binary. + + All available binaries are located under following directory: + /Projects/STM32_Copro_Wireless_Binaries + + Refer to UM2237 to learn how to use/install STM32CubeProgrammer. + Refer to /Projects/STM32_Copro_Wireless_Binaries/ReleaseNote.html for the + detailed procedure to change the Wireless Coprocessor binary. + + @endverbatim + ****************************************************************************** + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +#include "AppTask.h" +#include "STM32FreeRtosHooks.h" +#include "app_common.h" +#include "app_entry.h" +#include "app_thread.h" +#include "cmsis_os.h" +#include "dbg_trace.h" +#include "flash_wb.h" +#include "stm32_lpm.h" + +/* Private typedef -----------------------------------------------------------*/ +/* Private defines -----------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Global variables ---------------------------------------------------------*/ + +RTC_HandleTypeDef hrtc = { 0 }; /**< RTC handler declaration */ +RNG_HandleTypeDef hrng; +IPCC_HandleTypeDef hipcc; + +void Error_Handler(void); +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +static void Reset_BackupDomain(void); +static void Init_RTC(void); +static void Reset_Device(void); +static void Reset_IPCC(void); +static void Init_Exti(void); +static void MX_GPIO_Init(void); +static void MX_RNG_Init(void); +static void MX_IPCC_Init(void); +static void PeriphCommonClock_Config(void); +static void SystemClock_Config(void); +/* USER CODE BEGIN PFP */ + +/* Functions Definition ------------------------------------------------------*/ + +/** + * @brief Main program + * @param None + * @retval None + */ +int main(void) +{ + /* STM32WBxx HAL library initialization: + - Configure the Flash prefetch + - Systick timer is configured by default as source of time base, but user + can eventually implement his proper time base source (a general purpose + timer for example or other time source), keeping in mind that Time base + duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and + handled in milliseconds basis. + - Set NVIC Group Priority to 4 + - Low Level Initialization + */ + /* USER CODE END 1 */ + /** + * The OPTVERR flag is wrongly set at power on + * It shall be cleared before using any HAL_FLASH_xxx() api + */ + __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_OPTVERR); + + /** + * Reset some configurations so that the system behave in the same way + * when either out of nReset or Power On + */ + Reset_Device(); + + /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ + HAL_Init(); + /* USER CODE BEGIN Init */ + + /* USER CODE END Init */ + + /* Configure the system clock */ + SystemClock_Config(); + PeriphCommonClock_Config(); + /* USER CODE BEGIN SysInit */ + /* Set default off value for each leds */ + + /* USER CODE END SysInit */ + + /* Initialize all configured peripherals */ + Init_Exti(); + MX_RNG_Init(); + Init_RTC(); + osKernelInitialize(); + MX_GPIO_Init(); + /* IPCC initialisation */ + MX_IPCC_Init(); + NM_Init(); + freertos_mbedtls_init(); + + APPE_Init(); + GetAppTask().InitMatter(); + osKernelStart(); + while (1) + { + } +} + +static void MX_RNG_Init(void) +{ + + /* USER CODE BEGIN RNG_Init 0 */ + + /* USER CODE END RNG_Init 0 */ + + /* USER CODE BEGIN RNG_Init 1 */ + + /* USER CODE END RNG_Init 1 */ + hrng.Instance = RNG; + hrng.Init.ClockErrorDetection = RNG_CED_ENABLE; + if (HAL_RNG_Init(&hrng) != HAL_OK) + { + } + /* USER CODE BEGIN RNG_Init 2 */ + + /* USER CODE END RNG_Init 2 */ +} + +/** + * @brief IPCC Initialization Function + * @param None + * @retval None + */ +static void MX_IPCC_Init(void) +{ + + /* USER CODE BEGIN IPCC_Init 0 */ + + /* USER CODE END IPCC_Init 0 */ + + /* USER CODE BEGIN IPCC_Init 1 */ + + /* USER CODE END IPCC_Init 1 */ + hipcc.Instance = IPCC; + if (HAL_IPCC_Init(&hipcc) != HAL_OK) + { + Error_Handler(); + } + /* USER CODE BEGIN IPCC_Init 2 */ + + /* USER CODE END IPCC_Init 2 */ +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +static void Init_Exti(void) +{ + /**< Disable all wakeup interrupt on CPU1 except LPUART(25), IPCC(36), HSEM(38) */ + LL_EXTI_DisableIT_0_31((~0) & (~(LL_EXTI_LINE_25))); + LL_EXTI_DisableIT_32_63((~0) & (~(LL_EXTI_LINE_36 | LL_EXTI_LINE_38))); + + return; +} + +static void Reset_Device(void) +{ +#if (CFG_HW_RESET_BY_FW == 1) + Reset_BackupDomain(); + + Reset_IPCC(); +#endif + + return; +} + +static void Reset_IPCC(void) +{ + LL_AHB3_GRP1_EnableClock(LL_AHB3_GRP1_PERIPH_IPCC); + + LL_C1_IPCC_ClearFlag_CHx(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | LL_IPCC_CHANNEL_5 | + LL_IPCC_CHANNEL_6); + + LL_C2_IPCC_ClearFlag_CHx(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | LL_IPCC_CHANNEL_5 | + LL_IPCC_CHANNEL_6); + + LL_C1_IPCC_DisableTransmitChannel(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | + LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6); + + LL_C2_IPCC_DisableTransmitChannel(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | + LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6); + + LL_C1_IPCC_DisableReceiveChannel(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | + LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6); + + LL_C2_IPCC_DisableReceiveChannel(IPCC, + LL_IPCC_CHANNEL_1 | LL_IPCC_CHANNEL_2 | LL_IPCC_CHANNEL_3 | LL_IPCC_CHANNEL_4 | + LL_IPCC_CHANNEL_5 | LL_IPCC_CHANNEL_6); + + return; +} + +static void Reset_BackupDomain(void) +{ + if ((LL_RCC_IsActiveFlag_PINRST() != FALSE) && (LL_RCC_IsActiveFlag_SFTRST() == FALSE)) + { + HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */ + + /** + * Write twice the value to flush the APB-AHB bridge + * This bit shall be written in the register before writing the next one + */ + HAL_PWR_EnableBkUpAccess(); + + __HAL_RCC_BACKUPRESET_FORCE(); + __HAL_RCC_BACKUPRESET_RELEASE(); + } + + return; +} + +static void Init_RTC(void) +{ + HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */ + + /** + * Write twice the value to flush the APB-AHB bridge + * This bit shall be written in the register before writing the next one + */ + HAL_PWR_EnableBkUpAccess(); + + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSI as RTC Input */ + + __HAL_RCC_RTC_ENABLE(); /**< Enable RTC */ + + hrtc.Instance = RTC; /**< Define instance */ + + /** + * Set the Asynchronous prescaler + */ + hrtc.Init.AsynchPrediv = CFG_RTC_ASYNCH_PRESCALER; + hrtc.Init.SynchPrediv = CFG_RTC_SYNCH_PRESCALER; + HAL_RTC_Init(&hrtc); + + /* Disable RTC registers write protection */ + LL_RTC_DisableWriteProtection(RTC); + + LL_RTC_WAKEUP_SetClock(RTC, CFG_RTC_WUCKSEL_DIVIDER); + + /* Enable RTC registers write protection */ + LL_RTC_EnableWriteProtection(RTC); + + return; +} + +/** + * @brief Configure the system clock + * + * @note This API configures + * - The system clock source + * - The AHBCLK, APBCLK dividers + * - The flash latency + * - The PLL settings (when required) + * + * @param None + * @retval None + */ +static void PeriphCommonClock_Config(void) +{ + + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 }; + + /** Initializes the peripherals clock + */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS; + PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSI; + PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE1; + + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) + { + Error_Handler(); + } +} + +static void SystemClock_Config(void) +{ + /** + * Write twice the value to flush the APB-AHB bridge to ensure the bit is written + */ + HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */ + HAL_PWR_EnableBkUpAccess(); + /** + * Select LSE clock + */ + LL_RCC_LSE_Enable(); + while (!LL_RCC_LSE_IsReady()) + ; + /** + * Select wakeup source of BLE RF + */ + LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_LSE); + + RCC_OscInitTypeDef RCC_OscInitStruct = { 0 }; + RCC_ClkInitTypeDef RCC_ClkInitStruct = { 0 }; + + /** Configure the main internal regulator output voltage + */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + /** Initializes the RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; + RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1; + RCC_OscInitStruct.PLL.PLLN = 16; + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; + RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV4; + RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) + { + Error_Handler(); + } + /** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK4 | RCC_CLOCKTYPE_HCLK2 | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | + RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.AHBCLK2Divider = RCC_SYSCLK_DIV2; + RCC_ClkInitStruct.AHBCLK4Divider = RCC_SYSCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK) + { + Error_Handler(); + } + + return; +} + +static void MX_GPIO_Init(void) +{ + + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + __HAL_RCC_GPIOE_CLK_ENABLE(); +} + +/************************************************************* + * + * WRAP FUNCTIONS + * + *************************************************************/ +/** + * @brief Period elapsed callback in non blocking mode + * @note This function is called when TIM17 interrupt took place, inside + * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment + * a global variable "uwTick" used as application time base. + * @param htim : TIM handle + * @retval None + */ +void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef * htim) +{ + /* USER CODE BEGIN Callback 0 */ + + /* USER CODE END Callback 0 */ + if (htim->Instance == TIM17) + { + HAL_IncTick(); + } + /* USER CODE BEGIN Callback 1 */ + + /* USER CODE END Callback 1 */ +} + +void Error_Handler(void) +{ + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + while (1) + { + HAL_Delay(100); + } + /* USER CODE END Error_Handler_Debug */ +} + +void RTOS_AppConfigureTimerForRuntimeStats() {} + +uint32_t RTOS_AppGetRuntimeCounterValueFromISR() + +{ + + return HAL_GetTick(); +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/otp.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/otp.c new file mode 100644 index 00000000000000..ee2d71467514b5 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/otp.c @@ -0,0 +1,49 @@ +/** + ****************************************************************************** + * @file otp.c + * @author MCD Application Team + * @brief OTP manager + ****************************************************************************** + * @attention + * + * Copyright (c) 2018-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "utilities_common.h" + +#include "otp.h" + +/* Private typedef -----------------------------------------------------------*/ +/* Private defines -----------------------------------------------------------*/ +/* Private macros ------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Global variables ----------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Functions Definition ------------------------------------------------------*/ + +uint8_t * OTP_Read(uint8_t id) +{ + uint8_t * p_id; + + p_id = (uint8_t *) (CFG_OTP_END_ADDRESS - 7); + + while (((*(p_id + 7)) != id) && (p_id != (uint8_t *) CFG_OTP_BASE_ADDRESS)) + { + p_id -= 8; + } + + if ((*(p_id + 7)) != id) + { + p_id = 0; + } + + return p_id; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32_lpm_if.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32_lpm_if.c new file mode 100644 index 00000000000000..93c75f71f6aa40 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32_lpm_if.c @@ -0,0 +1,349 @@ +/* USER CODE BEGIN Header */ +/** + *************************************************************************************** + * File Name : stm32_lpm_if.c + * Description : Low layer function to enter/exit low power modes (stop, sleep). + *************************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32_lpm_if.h" +#include "app_conf.h" +#include "stm32_lpm.h" +/* USER CODE BEGIN include */ + +/* USER CODE END include */ + +/* Exported variables --------------------------------------------------------*/ +const struct UTIL_LPM_Driver_s UTIL_PowerDriver = { + PWR_EnterSleepMode, PWR_ExitSleepMode, + + PWR_EnterStopMode, PWR_ExitStopMode, + + PWR_EnterOffMode, PWR_ExitOffMode, +}; + +/* Private function prototypes -----------------------------------------------*/ +static void Switch_On_HSI(void); +static void EnterLowPower(void); +static void ExitLowPower(void); +/* USER CODE BEGIN Private_Function_Prototypes */ + +/* USER CODE END Private_Function_Prototypes */ +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN Private_Typedef */ + +/* USER CODE END Private_Typedef */ +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Private_Define */ + +/* USER CODE END Private_Define */ +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Private_Macro */ + +/* USER CODE END Private_Macro */ +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN Private_Variables */ + +/* USER CODE END Private_Variables */ + +/* Functions Definition ------------------------------------------------------*/ +/** + * @brief Enters Low Power Off Mode + * @param none + * @retval none + */ +void PWR_EnterOffMode(void) +{ + /* USER CODE BEGIN PWR_EnterOffMode_1 */ + + /* USER CODE END PWR_EnterOffMode_1 */ + /** + * The systick should be disabled for the same reason than when the device enters stop mode because + * at this time, the device may enter either OffMode or StopMode. + */ + HAL_SuspendTick(); + + EnterLowPower(); + + /************************************************************************************ + * ENTER OFF MODE + ***********************************************************************************/ + /* + * There is no risk to clear all the WUF here because in the current implementation, this API is called + * in critical section. If an interrupt occurs while in that critical section before that point, + * the flag is set and will be cleared here but the system will not enter Off Mode + * because an interrupt is pending in the NVIC. The ISR will be executed when moving out + * of this critical section + */ + LL_PWR_ClearFlag_WU(); + + LL_PWR_SetPowerMode(LL_PWR_MODE_STANDBY); + + LL_LPM_EnableDeepSleep(); /**< Set SLEEPDEEP bit of Cortex System Control Register */ + + /** + * This option is used to ensure that store operations are completed + */ +#if defined(__CC_ARM) + __force_stores(); +#endif + + __WFI(); + + /* USER CODE BEGIN PWR_EnterOffMode_2 */ + + /* USER CODE END PWR_EnterOffMode_2 */ + return; +} + +/** + * @brief Exits Low Power Off Mode + * @param none + * @retval none + */ +void PWR_ExitOffMode(void) +{ + /* USER CODE BEGIN PWR_ExitOffMode_1 */ + + /* USER CODE END PWR_ExitOffMode_1 */ + HAL_ResumeTick(); + /* USER CODE BEGIN PWR_ExitOffMode_2 */ + + /* USER CODE END PWR_ExitOffMode_2 */ + return; +} + +/** + * @brief Enters Low Power Stop Mode + * @note ARM exists the function when waking up + * @param none + * @retval none + */ +void PWR_EnterStopMode(void) +{ + /* USER CODE BEGIN PWR_EnterStopMode_1 */ + + /* USER CODE END PWR_EnterStopMode_1 */ + /** + * When HAL_DBGMCU_EnableDBGStopMode() is called to keep the debugger active in Stop Mode, + * the systick shall be disabled otherwise the cpu may crash when moving out from stop mode + * + * When in production, the HAL_DBGMCU_EnableDBGStopMode() is not called so that the device can reach best power consumption + * However, the systick should be disabled anyway to avoid the case when it is about to expire at the same time the device + * enters stop mode ( this will abort the Stop Mode entry ). + */ + HAL_SuspendTick(); + + /** + * This function is called from CRITICAL SECTION + */ + EnterLowPower(); + + /************************************************************************************ + * ENTER STOP MODE + ***********************************************************************************/ + LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2); + + LL_LPM_EnableDeepSleep(); /**< Set SLEEPDEEP bit of Cortex System Control Register */ + + /** + * This option is used to ensure that store operations are completed + */ +#if defined(__CC_ARM) + __force_stores(); +#endif + + __WFI(); + + /* USER CODE BEGIN PWR_EnterStopMode_2 */ + + /* USER CODE END PWR_EnterStopMode_2 */ + return; +} + +/** + * @brief Exits Low Power Stop Mode + * @note Enable the pll at 32MHz + * @param none + * @retval none + */ +void PWR_ExitStopMode(void) +{ + /* USER CODE BEGIN PWR_ExitStopMode_1 */ + + /* USER CODE END PWR_ExitStopMode_1 */ + /** + * This function is called from CRITICAL SECTION + */ + ExitLowPower(); + + HAL_ResumeTick(); + /* USER CODE BEGIN PWR_ExitStopMode_2 */ + + /* USER CODE END PWR_ExitStopMode_2 */ + return; +} + +/** + * @brief Enters Low Power Sleep Mode + * @note ARM exits the function when waking up + * @param none + * @retval none + */ +void PWR_EnterSleepMode(void) +{ + /* USER CODE BEGIN PWR_EnterSleepMode_1 */ + + /* USER CODE END PWR_EnterSleepMode_1 */ + + HAL_SuspendTick(); + + /************************************************************************************ + * ENTER SLEEP MODE + ***********************************************************************************/ + LL_LPM_EnableSleep(); /**< Clear SLEEPDEEP bit of Cortex System Control Register */ + + /** + * This option is used to ensure that store operations are completed + */ +#if defined(__CC_ARM) + __force_stores(); +#endif + + __WFI(); + /* USER CODE BEGIN PWR_EnterSleepMode_2 */ + + /* USER CODE END PWR_EnterSleepMode_2 */ + return; +} + +/** + * @brief Exits Low Power Sleep Mode + * @note ARM exits the function when waking up + * @param none + * @retval none + */ +void PWR_ExitSleepMode(void) +{ + /* USER CODE BEGIN PWR_ExitSleepMode_1 */ + + /* USER CODE END PWR_ExitSleepMode_1 */ + HAL_ResumeTick(); + /* USER CODE BEGIN PWR_ExitSleepMode_2 */ + + /* USER CODE END PWR_ExitSleepMode_2 */ + return; +} + +/************************************************************* + * + * LOCAL FUNCTIONS + * + *************************************************************/ +/** + * @brief Setup the system to enter either stop or off mode + * @param none + * @retval none + */ +static void EnterLowPower(void) +{ + /** + * This function is called from CRITICAL SECTION + */ + + while (LL_HSEM_1StepLock(HSEM, CFG_HW_RCC_SEMID)) + ; + + if (!LL_HSEM_1StepLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID)) + { + if (LL_PWR_IsActiveFlag_C2DS() || LL_PWR_IsActiveFlag_C2SB()) + { + /* Release ENTRY_STOP_MODE semaphore */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0); + + Switch_On_HSI(); + } + } + else + { + Switch_On_HSI(); + } + + /* Release RCC semaphore */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_RCC_SEMID, 0); + + return; +} + +/** + * @brief Restore the system to exit stop mode + * @param none + * @retval none + */ +static void ExitLowPower(void) +{ + /* Release ENTRY_STOP_MODE semaphore */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0); + + while (LL_HSEM_1StepLock(HSEM, CFG_HW_RCC_SEMID)) + ; + + if (LL_RCC_GetSysClkSource() == LL_RCC_SYS_CLKSOURCE_STATUS_HSI) + { + /* Restore the clock configuration of the application in this user section */ + /* USER CODE BEGIN ExitLowPower_1 */ + LL_RCC_HSE_Enable(); + __HAL_FLASH_SET_LATENCY(FLASH_LATENCY_1); + while (!LL_RCC_HSE_IsReady()) + ; + LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE); + while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSE) + ; + /* USER CODE END ExitLowPower_1 */ + } + else + { + /* If the application is not running on HSE restore the clock configuration in this user section */ + /* USER CODE BEGIN ExitLowPower_2 */ + + /* USER CODE END ExitLowPower_2 */ + } + + /* Release RCC semaphore */ + LL_HSEM_ReleaseLock(HSEM, CFG_HW_RCC_SEMID, 0); + + return; +} + +/** + * @brief Switch the system clock on HSI + * @param none + * @retval none + */ +static void Switch_On_HSI(void) +{ + LL_RCC_HSI_Enable(); + while (!LL_RCC_HSI_IsReady()) + ; + LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSI); + LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI); + while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSI) + ; + return; +} + +/* USER CODE BEGIN Private_Functions */ + +/* USER CODE END Private_Functions */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c new file mode 100644 index 00000000000000..b5fa5b234e778f --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_msp.c @@ -0,0 +1,385 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * File Name : stm32wbxx_hal_msp.c + * Description : This file provides code for the MSP Initialization + * and de-Initialization codes. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" +/* USER CODE BEGIN Includes */ +#include "app_conf.h" +/* USER CODE END Includes */ +extern DMA_HandleTypeDef hdma_lpuart1_tx; +extern DMA_HandleTypeDef hdma_quadspi; +extern DMA_HandleTypeDef hdma_usart1_tx; + +/* Private typedef -----------------------------------------------------------*/ +/* USER CODE BEGIN TD */ +void Error_Handler(void) +{ + /* USER CODE BEGIN Error_Handler_Debug */ + /* User can add his own implementation to report the HAL error return state */ + while (1) + { + HAL_Delay(100); + } + /* USER CODE END Error_Handler_Debug */ +} +/* USER CODE END TD */ + +/* Private define ------------------------------------------------------------*/ +/* USER CODE BEGIN Define */ + +/* USER CODE END Define */ + +/* Private macro -------------------------------------------------------------*/ +/* USER CODE BEGIN Macro */ + +/* USER CODE END Macro */ + +/* Private variables ---------------------------------------------------------*/ +/* USER CODE BEGIN PV */ + +/* USER CODE END PV */ + +/* Private function prototypes -----------------------------------------------*/ +/* USER CODE BEGIN PFP */ + +/* USER CODE END PFP */ + +/* External functions --------------------------------------------------------*/ +/* USER CODE BEGIN ExternalFunctions */ + +/* USER CODE END ExternalFunctions */ + +/* USER CODE BEGIN 0 */ + +/* USER CODE END 0 */ +/** + * Initializes the Global MSP. + */ +void HAL_MspInit(void) +{ + /* USER CODE BEGIN MspInit 0 */ + + /* USER CODE END MspInit 0 */ + + __HAL_RCC_HSEM_CLK_ENABLE(); + + /* System interrupt init*/ + /* PendSV_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); + + /* Peripheral interrupt init */ + /* PVD_PVM_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PVD_PVM_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(PVD_PVM_IRQn); + /* FLASH_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(FLASH_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(FLASH_IRQn); + /* RCC_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(RCC_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(RCC_IRQn); + /* C2SEV_PWR_C2H_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(C2SEV_PWR_C2H_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(C2SEV_PWR_C2H_IRQn); + /* PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQn); + /* HSEM_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(HSEM_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(HSEM_IRQn); + /* FPU_IRQn interrupt configuration */ + HAL_NVIC_SetPriority(FPU_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(FPU_IRQn); + + /* USER CODE BEGIN MspInit 1 */ + /* USER CODE END MspInit 1 */ +} + +/** + * @brief IPCC MSP Initialization + * This function configures the hardware resources used in this example + * @param hipcc: IPCC handle pointer + * @retval None + */ +void HAL_IPCC_MspInit(IPCC_HandleTypeDef * hipcc) +{ + if (hipcc->Instance == IPCC) + { + /* USER CODE BEGIN IPCC_MspInit 0 */ + + /* USER CODE END IPCC_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_IPCC_CLK_ENABLE(); + /* IPCC interrupt Init */ + HAL_NVIC_SetPriority(IPCC_C1_RX_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(IPCC_C1_RX_IRQn); + HAL_NVIC_SetPriority(IPCC_C1_TX_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(IPCC_C1_TX_IRQn); + /* USER CODE BEGIN IPCC_MspInit 1 */ + + /* USER CODE END IPCC_MspInit 1 */ + } +} + +/** + * @brief IPCC MSP De-Initialization + * This function freeze the hardware resources used in this example + * @param hipcc: IPCC handle pointer + * @retval None + */ +void HAL_IPCC_MspDeInit(IPCC_HandleTypeDef * hipcc) +{ + if (hipcc->Instance == IPCC) + { + /* USER CODE BEGIN IPCC_MspDeInit 0 */ + + /* USER CODE END IPCC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_IPCC_CLK_DISABLE(); + + /* IPCC interrupt DeInit */ + HAL_NVIC_DisableIRQ(IPCC_C1_RX_IRQn); + HAL_NVIC_DisableIRQ(IPCC_C1_TX_IRQn); + /* USER CODE BEGIN IPCC_MspDeInit 1 */ + + /* USER CODE END IPCC_MspDeInit 1 */ + } +} + +/** + * @brief RTC MSP Initialization + * This function configures the hardware resources used in this example + * @param hrtc: RTC handle pointer + * @retval None + */ +void HAL_RTC_MspInit(RTC_HandleTypeDef * hrtc) +{ + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 }; + if (hrtc->Instance == RTC) + { + /* USER CODE BEGIN RTC_MspInit 0 */ + HAL_PWR_EnableBkUpAccess(); /**< Enable access to the RTC registers */ + + /** + * Write twice the value to flush the APB-AHB bridge + * This bit shall be written in the register before writing the next one + */ + HAL_PWR_EnableBkUpAccess(); + + __HAL_RCC_RTC_CONFIG(RCC_RTCCLKSOURCE_LSE); /**< Select LSE as RTC Input */ + + /* USER CODE END RTC_MspInit 0 */ + + /** Initializes the peripherals clock + */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; + + PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) + { + // Error_Handler(); + } + + /* Peripheral clock enable */ + __HAL_RCC_RTC_ENABLE(); + __HAL_RCC_RTCAPB_CLK_ENABLE(); + /* RTC interrupt Init */ + HAL_NVIC_SetPriority(RTC_WKUP_IRQn, 5, 0); + HAL_NVIC_EnableIRQ(RTC_WKUP_IRQn); + /* USER CODE BEGIN RTC_MspInit 1 */ + + MODIFY_REG(RTC->CR, RTC_CR_WUCKSEL, CFG_RTC_WUCKSEL_DIVIDER); + /* USER CODE END RTC_MspInit 1 */ + } +} + +/** + * @brief RTC MSP De-Initialization + * This function freeze the hardware resources used in this example + * @param hrtc: RTC handle pointer + * @retval None + */ +void HAL_RTC_MspDeInit(RTC_HandleTypeDef * hrtc) +{ + if (hrtc->Instance == RTC) + { + /* USER CODE BEGIN RTC_MspDeInit 0 */ + + /* USER CODE END RTC_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RTC_DISABLE(); + __HAL_RCC_RTCAPB_CLK_DISABLE(); + + /* RTC interrupt DeInit */ + HAL_NVIC_DisableIRQ(RTC_WKUP_IRQn); + /* USER CODE BEGIN RTC_MspDeInit 1 */ + + /* USER CODE END RTC_MspDeInit 1 */ + } +} + +/* USER CODE BEGIN 1 */ +/** + * @brief RNG MSP Initialization + * This function configures the hardware resources used in this example + * @param hrng: RNG handle pointer + * @retval None + */ +void HAL_RNG_MspInit(RNG_HandleTypeDef * hrng) +{ + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = { 0 }; + if (hrng->Instance == RNG) + { + /* USER CODE BEGIN RNG_MspInit 0 */ + + /* USER CODE END RNG_MspInit 0 */ + + /** Initializes the peripherals clock + */ + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RNG; + PeriphClkInitStruct.RngClockSelection = RCC_RNGCLKSOURCE_HSI48; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) + { + } + + /* Peripheral clock enable */ + __HAL_RCC_RNG_CLK_ENABLE(); + /* USER CODE BEGIN RNG_MspInit 1 */ + + /* USER CODE END RNG_MspInit 1 */ + } +} + +/** + * @brief RNG MSP De-Initialization + * This function freeze the hardware resources used in this example + * @param hrng: RNG handle pointer + * @retval None + */ +void HAL_RNG_MspDeInit(RNG_HandleTypeDef * hrng) +{ + if (hrng->Instance == RNG) + { + /* USER CODE BEGIN RNG_MspDeInit 0 */ + + /* USER CODE END RNG_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_RNG_CLK_DISABLE(); + /* USER CODE BEGIN RNG_MspDeInit 1 */ + + /* USER CODE END RNG_MspDeInit 1 */ + } +} + +/** + * @brief QSPI MSP Initialization + * This function configures the hardware resources used in this example + * @param hqspi: QSPI handle pointer + * @retval None + */ +void HAL_QSPI_MspInit(QSPI_HandleTypeDef * hqspi) +{ + GPIO_InitTypeDef GPIO_InitStruct = { 0 }; + if (hqspi->Instance == QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspInit 0 */ + + /* USER CODE END QUADSPI_MspInit 0 */ + /* Peripheral clock enable */ + __HAL_RCC_QSPI_CLK_ENABLE(); + + __HAL_RCC_GPIOB_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOD_CLK_ENABLE(); + /**QUADSPI GPIO Configuration + PB9 ------> QUADSPI_BK1_IO0 + PA3 ------> QUADSPI_CLK + PD7 ------> QUADSPI_BK1_IO3 + PD3 ------> QUADSPI_BK1_NCS + PD5 ------> QUADSPI_BK1_IO1 + PD6 ------> QUADSPI_BK1_IO2 + */ + GPIO_InitStruct.Pin = GPIO_PIN_9; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI; + HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_3; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI; + HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); + + GPIO_InitStruct.Pin = GPIO_PIN_7 | GPIO_PIN_3 | GPIO_PIN_5 | GPIO_PIN_6; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + GPIO_InitStruct.Alternate = GPIO_AF10_QUADSPI; + HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); + + /* USER CODE BEGIN QUADSPI_MspInit 1 */ + + /* USER CODE END QUADSPI_MspInit 1 */ + } +} + +/** + * @brief QSPI MSP De-Initialization + * This function freeze the hardware resources used in this example + * @param hqspi: QSPI handle pointer + * @retval None + */ +void HAL_QSPI_MspDeInit(QSPI_HandleTypeDef * hqspi) +{ + if (hqspi->Instance == QUADSPI) + { + /* USER CODE BEGIN QUADSPI_MspDeInit 0 */ + + /* USER CODE END QUADSPI_MspDeInit 0 */ + /* Peripheral clock disable */ + __HAL_RCC_QSPI_CLK_DISABLE(); + + /**QUADSPI GPIO Configuration + PB9 ------> QUADSPI_BK1_IO0 + PA3 ------> QUADSPI_CLK + PD7 ------> QUADSPI_BK1_IO3 + PD3 ------> QUADSPI_BK1_NCS + PD5 ------> QUADSPI_BK1_IO1 + PD6 ------> QUADSPI_BK1_IO2 + */ + HAL_GPIO_DeInit(GPIOB, GPIO_PIN_9); + + HAL_GPIO_DeInit(GPIOA, GPIO_PIN_3); + + HAL_GPIO_DeInit(GPIOD, GPIO_PIN_7 | GPIO_PIN_3 | GPIO_PIN_5 | GPIO_PIN_6); + + /* QUADSPI DMA DeInit */ + HAL_DMA_DeInit(hqspi->hdma); + + /* QUADSPI interrupt DeInit */ + HAL_NVIC_DisableIRQ(QUADSPI_IRQn); + /* USER CODE BEGIN QUADSPI_MspDeInit 1 */ + + /* USER CODE END QUADSPI_MspDeInit 1 */ + } +} +/* USER CODE END 1 */ diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_timebase_tim.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_timebase_tim.c new file mode 100644 index 00000000000000..c2f795f4dd0c43 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_hal_timebase_tim.c @@ -0,0 +1,149 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file stm32wbxx_hal_timebase_tim.c + * @author MCD Application Team + * @brief HAL time base based on the hardware TIM. + * + * This file overrides the native HAL time base functions (defined as weak) + * the TIM time base: + * + Initializes the TIM peripheral to generate a Period elapsed Event each 1ms + * + HAL_IncTick is called inside HAL_TIM_PeriodElapsedCallback ie each 1ms + * + ****************************************************************************** + * @attention + * + * Copyright (c) STMicroelectronics +(-2021) STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + @verbatim + ============================================================================== + ##### How to use this driver ##### + ============================================================================== + [..] + This file must be copied to the application folder and modified as follows: + (#) Rename it to 'stm32wbxx_hal_timebase_tim.c' + (#) Add this file and the TIM HAL driver files to your project and make sure + HAL_TIM_MODULE_ENABLED is defined in stm32wbxx_hal_conf.h + + [..] + (@) The application needs to ensure that the time base is always set to 1 millisecond + to have correct HAL operation. + + @endverbatim + ****************************************************************************** + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_hal.h" +#include "stm32wbxx_hal_tim.h" + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +TIM_HandleTypeDef htim17; +/* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ + +/** + * @brief This function configures the TIM17 as a time base source. + * The time source is configured to have 1ms time base with a dedicated + * Tick interrupt priority. + * @note This function is called automatically at the beginning of program after + * reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig(). + * @param TickPriority: Tick interrupt priority. + * @retval HAL status + */ +HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) +{ + RCC_ClkInitTypeDef clkconfig; + uint32_t uwTimclock = 0; + uint32_t uwPrescalerValue = 0; + uint32_t pFLatency; + /*Configure the TIM17 IRQ priority */ + HAL_NVIC_SetPriority(TIM1_TRG_COM_TIM17_IRQn, TickPriority, 0); + + /* Enable the TIM17 global Interrupt */ + HAL_NVIC_EnableIRQ(TIM1_TRG_COM_TIM17_IRQn); + + /* Enable TIM17 clock */ + __HAL_RCC_TIM17_CLK_ENABLE(); + + /* Get clock configuration */ + HAL_RCC_GetClockConfig(&clkconfig, &pFLatency); + + /* Compute TIM17 clock */ + uwTimclock = HAL_RCC_GetPCLK2Freq(); + /* Compute the prescaler value to have TIM17 counter clock equal to 1MHz */ + uwPrescalerValue = (uint32_t)((uwTimclock / 1000000U) - 1U); + + /* Initialize TIM17 */ + htim17.Instance = TIM17; + + /* Initialize TIMx peripheral as follow: + + Period = [(TIM17CLK/1000) - 1]. to have a (1/1000) s time base. + + Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock. + + ClockDivision = 0 + + Counter direction = Up + */ + htim17.Init.Period = (1000000U / 1000U) - 1U; + htim17.Init.Prescaler = uwPrescalerValue; + htim17.Init.ClockDivision = 0; + htim17.Init.CounterMode = TIM_COUNTERMODE_UP; + + if (HAL_TIM_Base_Init(&htim17) == HAL_OK) + { + /* Start the TIM time Base generation in interrupt mode */ + return HAL_TIM_Base_Start_IT(&htim17); + } + + return HAL_ERROR; +} + +/** + * @brief Suspend Tick increment. + * @note Disable the tick increment by disabling TIM17 update interrupt. + * @param None + * @retval None + */ +void HAL_SuspendTick(void) +{ + /* Disable TIM17 update Interrupt */ + __HAL_TIM_DISABLE_IT(&htim17, TIM_IT_UPDATE); +} + +/** + * @brief Resume Tick increment. + * @note Enable the tick increment by Enabling TIM17 update interrupt. + * @param None + * @retval None + */ +void HAL_ResumeTick(void) +{ + /* Enable TIM17 Update interrupt */ + __HAL_TIM_ENABLE_IT(&htim17, TIM_IT_UPDATE); +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_it.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_it.c new file mode 100644 index 00000000000000..aa13c0fb6ada54 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm32wbxx_it.c @@ -0,0 +1,193 @@ +/** + ****************************************************************************** + * @file stm32wbxx_it.c + * @author MCD Application Team + * @brief Main Interrupt Service Routines. + * This file provides template for all exceptions handler and + * peripherals interrupt service routine. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes ------------------------------------------------------------------*/ +#include "stm32wbxx_it.h" +#include "app_common.h" + +/* CONCURRENT MODE BLE/THREAD */ +/* External variables -----------------------------------------------------------*/ +extern uint8_t ThreadEnable; +extern TIM_HandleTypeDef htim17; + +/* /THREAD */ + +/* Private typedef -----------------------------------------------------------*/ +/* Private define ------------------------------------------------------------*/ +/* Private macro -------------------------------------------------------------*/ +/* Private variables ---------------------------------------------------------*/ +/* Private function prototypes -----------------------------------------------*/ +/* Private functions ---------------------------------------------------------*/ + +/******************************************************************************/ +/* Cortex-M4 Processor Exceptions Handlers */ +/******************************************************************************/ + +/** + * @brief This function handles NMI exception. + * @param None + * @retval None + */ +void NMI_Handler(void) {} + +/** + * @brief This function handles Hard Fault exception. + * @param None + * @retval None + */ +void HardFault_Handler(void) +{ + /* Go to infinite loop when Hard Fault exception occurs */ + while (1) + { + } +} + +/** + * @brief This function handles Memory management fault. + */ +void MemManage_Handler(void) +{ + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + /* USER CODE END W1_MemoryManagement_IRQn 0 */ + } +} +/** + * @brief This function handles SVCall exception. + * @param None + * @retval None + */ +/*void SVC_Handler(void) +{ +}*/ + +/** + * @brief This function handles Debug Monitor exception. + * @param None + * @retval None + */ +void DebugMon_Handler(void) {} + +/** + * @brief This function handles PendSVC exception. + * @param None + * @retval None + */ +/*void PendSV_Handler(void) +{ +}*/ + +/** + * @brief This function handles SysTick Handler. + * @param None + * @retval None + */ +/*void SysTick_Handler(void) +{ + HAL_IncTick(); +}*/ + +void IPCC_C1_TX_IRQHandler(void) +{ + HW_IPCC_Tx_Handler(); + + return; +} + +void IPCC_C1_RX_IRQHandler(void) +{ + HW_IPCC_Rx_Handler(); + return; +} + +/** + * @brief This function handles TIM1 trigger and commutation interrupts and TIM17 global interrupt. + */ +void TIM1_TRG_COM_TIM17_IRQHandler(void) +{ + /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 0 */ + /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 0 */ + + HAL_TIM_IRQHandler(&htim17); + + /* USER CODE BEGIN TIM1_TRG_COM_TIM17_IRQn 1 */ + /* USER CODE END TIM1_TRG_COM_TIM17_IRQn 1 */ +} + +/** + * @brief This function handles External line + * interrupt request. + * @param None + * @retval None + */ + +void EXTI15_10_IRQHandler(void) +{ + BSP_PB_IRQHandler(BUTTON_USER1); +} + +#if (CFG_HW_USART1_ENABLED == 1) +void USART1_IRQHandler(void) +{ + HW_UART_Interrupt_Handler(hw_uart1); +} +#endif + +#if (CFG_HW_USART1_DMA_TX_SUPPORTED == 1) +void CFG_HW_USART1_DMA_TX_IRQHandler(void) +{ + HW_UART_DMA_Interrupt_Handler(hw_uart1); +} +#endif + +#if (CFG_HW_LPUART1_ENABLED == 1) +void LPUART1_IRQHandler(void) +{ + HW_UART_Interrupt_Handler(hw_lpuart1); +} +#endif + +#if (CFG_HW_LPUART1_DMA_TX_SUPPORTED == 1) +void CFG_HW_LPUART1_DMA_TX_IRQHandler(void) +{ + HW_UART_DMA_Interrupt_Handler(hw_lpuart1); +} +#endif + +/******************************************************************************/ +/* STM32L0xx Peripherals Interrupt Handlers */ +/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */ +/* available peripheral interrupt handler's name please refer to the startup */ +/* file (startup_stm32l0xx.s). */ +/******************************************************************************/ +/** + * @brief This function handles RTC Auto wake-up interrupt request. + * @param None + * @retval None + */ +void RTC_WKUP_IRQHandler(void) +{ + HW_TS_RTC_Wakeup_Handler(); +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm_logging.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm_logging.c new file mode 100644 index 00000000000000..910a401c70eef5 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/stm_logging.c @@ -0,0 +1,207 @@ + +/** + ****************************************************************************** + * @file stm_logging.c + * @author MCD Application Team + * @brief This file contains all the defines and functions used for logging + * on Application examples. + * + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/** + * @file + * This file implements logging functions to used in Application examples. + * + */ + +#include +#include +#include +#include +#include +#include + +#include "app_conf.h" +#include "stm_logging.h" + +#define LOG_PARSE_BUFFER_SIZE 256U + +#define LOG_TIMESTAMP_ENABLE 0 +#define LOG_REGION_ENABLE 1U +#define LOG_RTT_COLOR_ENABLE 1U + +#if (LOG_RTT_COLOR_ENABLE == 1U) +#define RTT_COLOR_CODE_DEFAULT "\x1b[0m" +#define RTT_COLOR_CODE_RED "\x1b[0;91m" +#define RTT_COLOR_CODE_GREEN "\x1b[0;92m" +#define RTT_COLOR_CODE_YELLOW "\x1b[0;93m" +#define RTT_COLOR_CODE_CYAN "\x1b[0;96m" + +#else /* LOG_RTT_COLOR_ENABLE == 1 */ +#define RTT_COLOR_CODE_DEFAULT "" +#define RTT_COLOR_CODE_RED "" +#define RTT_COLOR_CODE_GREEN "" +#define RTT_COLOR_CODE_YELLOW "" +#define RTT_COLOR_CODE_CYAN "" +#endif /* LOG_RTT_COLOR_ENABLE == 1 */ + +#if (CFG_DEBUG_TRACE != 0) +/** + * Function for outputting code region string. + * + * @param[inout] aLogString Pointer to log buffer. + * @param[in] aMaxSize Maximum size of log buffer. + * @param[in] otLogRegion The region ID. + * + * @returns String with a log level color value. + */ +static inline uint16_t logRegion(char * aLogString, uint16_t aMaxSize, appliLogRegion_t aLogRegion) +{ + char logRegionString[30U]; + + switch (aLogRegion) + { + case APPLI_LOG_REGION_GENERAL: + strcpy(logRegionString, "[M4 APPLICATION]"); + break; + case APPLI_LOG_REGION_OPENTHREAD_API: + strcpy(logRegionString, "[M4 OPENTHREAD API]"); + break; + case APPLI_LOG_REGION_OT_API_LINK: + strcpy(logRegionString, "[M4 LINK API]"); + break; + case APPLI_LOG_REGION_OT_API_INSTANCE: + strcpy(logRegionString, "[M4 INSTANCE API]"); + break; + case APPLI_LOG_REGION_OT_API_MESSAGE: + strcpy(logRegionString, "[M4 MESSAGE API]"); + break; + default: + strcpy(logRegionString, "[M4]"); + break; + } + + return snprintf(aLogString, aMaxSize, "%s ", logRegionString); +} +#endif /* CFG_DEBUG_TRACE */ + +#if (LOG_RTT_COLOR_ENABLE == 1U) +#if (CFG_DEBUG_TRACE != 0) +/** + * Function for getting color of a given level log. + * + * @param[in] aLogLevel The log level. + * + * @returns String with a log level color value. + */ +static inline const char * levelToString(appliLogLevel_t aLogLevel) +{ + switch (aLogLevel) + { + case LOG_LEVEL_CRIT: + return RTT_COLOR_CODE_RED; + + case LOG_LEVEL_WARN: + return RTT_COLOR_CODE_YELLOW; + + case LOG_LEVEL_INFO: + return RTT_COLOR_CODE_GREEN; + + case LOG_LEVEL_DEBG: + default: + return RTT_COLOR_CODE_DEFAULT; + } +} +#endif /* CFG_DEBUG_TRACE */ + +#if (CFG_DEBUG_TRACE != 0) +/** + * Function for printing log level. + * + * @param[inout] aLogString Pointer to log buffer. + * @param[in] aMaxSize Maximum size of log buffer. + * @param[in] aLogLevel Log level. + * + * @returns Number of bytes successfully written to the log buffer. + */ +static inline uint16_t logLevel(char * aLogString, uint16_t aMaxSize, appliLogLevel_t aLogLevel) +{ + return snprintf(aLogString, aMaxSize, "%s", levelToString(aLogLevel)); +} +#endif /* CFG_DEBUG_TRACE */ +#endif /* LOG_RTT_COLOR_ENABLE */ + +#if (LOG_TIMESTAMP_ENABLE == 1U) +/** + * Function for printing actual timestamp. + * + * @param[inout] aLogString Pointer to the log buffer. + * @param[in] aMaxSize Maximum size of the log buffer. + * + * @returns Number of bytes successfully written to the log buffer. + */ +static inline uint16_t logTimestamp(char * aLogString, uint16_t aMaxSize) +{ + return snprintf(aLogString, aMaxSize, "%s[%010ld]", RTT_COLOR_CODE_DEFAULT, otPlatAlarmMilliGetNow()); +} +#endif /* LOG_TIMESTAMP_ENABLE */ + +/** + * Function for printing application log + * + * @param[in] aLogLevel Log level. + * @param[in] aLogRegion The region ID. + * @param[in] aFormat User string format. + * + * @returns Number of bytes successfully written to the log buffer. + */ +void logApplication(appliLogLevel_t aLogLevel, appliLogRegion_t aLogRegion, const char * aFormat, ...) +{ +#if (CFG_DEBUG_TRACE != 0) /* Since the traces are disabled, there is nothing to print */ + uint16_t length = 0; + char logString[LOG_PARSE_BUFFER_SIZE + 1U]; + +#if (LOG_TIMESTAMP_ENABLE == 1U) + length += logTimestamp(logString, LOG_PARSE_BUFFER_SIZE); +#endif + +#if (LOG_RTT_COLOR_ENABLE == 1U) + /* Add level information */ + length += logLevel(&logString[length], (LOG_PARSE_BUFFER_SIZE - length), aLogLevel); +#endif + +#if (LOG_REGION_ENABLE == 1U) + /* Add Region information */ + length += logRegion(&logString[length], (LOG_PARSE_BUFFER_SIZE - length), aLogRegion); +#endif + + /* Parse user string */ + va_list paramList; + va_start(paramList, aFormat); + length += vsnprintf(&logString[length], (LOG_PARSE_BUFFER_SIZE - length), aFormat, paramList); + logString[length++] = '\r'; + logString[length++] = '\n'; + logString[length++] = 0; + va_end(paramList); + + if (aLogLevel <= APPLI_CONFIG_LOG_LEVEL) + { + printf("%s", logString); + } + else + { + /* Print nothing */ + } +#endif /* CFG_DEBUG_TRACE */ +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/syscalls.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/syscalls.c new file mode 100644 index 00000000000000..5e62d7dc9c33ff --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/syscalls.c @@ -0,0 +1,156 @@ +/** + ****************************************************************************** + * @file syscalls.c + * @author Auto-generated by STM32CubeIDE + * @brief STM32CubeIDE Minimal System calls file + * + * For more information about which c-functions + * need which of these lowlevel functions + * please consult the Newlib libc-manual + ****************************************************************************** + * @attention + * + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Variables */ +//#undef errno +extern int errno; +extern int __io_putchar(int ch) __attribute__((weak)); +extern int __io_getchar(void) __attribute__((weak)); + +register char * stack_ptr asm("sp"); + +char * __env[1] = { 0 }; +char ** environ = __env; + +/* Functions */ +void initialise_monitor_handles() {} + +int _getpid(void) +{ + return 1; +} + +int _kill(int pid, int sig) +{ + errno = EINVAL; + return -1; +} + +void _exit(int status) +{ + _kill(status, -1); + while (1) + { + } /* Make sure we hang here */ +} + +__attribute__((weak)) int _read(int file, char * ptr, int len) +{ + int DataIdx; + + for (DataIdx = 0; DataIdx < len; DataIdx++) + { + *ptr++ = __io_getchar(); + } + + return len; +} + +__attribute__((weak)) int _write(int file, char * ptr, int len) +{ + int DataIdx; + + for (DataIdx = 0; DataIdx < len; DataIdx++) + { + __io_putchar(*ptr++); + } + return len; +} + +int _close(int file) +{ + return -1; +} + +int _fstat(int file, struct stat * st) +{ + st->st_mode = S_IFCHR; + return 0; +} + +int _isatty(int file) +{ + return 1; +} + +int _lseek(int file, int ptr, int dir) +{ + return 0; +} + +int _open(char * path, int flags, ...) +{ + /* Pretend like we always fail */ + return -1; +} + +int _wait(int * status) +{ + errno = ECHILD; + return -1; +} + +int _unlink(char * name) +{ + errno = ENOENT; + return -1; +} + +int _times(struct tms * buf) +{ + return -1; +} + +int _stat(char * file, struct stat * st) +{ + st->st_mode = S_IFCHR; + return 0; +} + +int _link(char * old, char * new) +{ + errno = EMLINK; + return -1; +} + +int _fork(void) +{ + errno = EAGAIN; + return -1; +} + +int _execve(char * name, char ** argv, char ** env) +{ + errno = ENOMEM; + return -1; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/sysmem.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/sysmem.c new file mode 100644 index 00000000000000..7231d53efafcb2 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/sysmem.c @@ -0,0 +1,57 @@ +/** + ****************************************************************************** + * @file sysmem.c + * @author Auto-generated by STM32CubeIDE + * @brief STM32CubeIDE Minimal System Memory calls file + * + * For more information about which c-functions + * need which of these lowlevel functions + * please consult the Newlib libc-manual + ****************************************************************************** + * @attention + * + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/* Includes */ +#include +#include +#include + +/* Variables */ +extern int errno; +register char * stack_ptr asm("sp"); + +/* Functions */ + +/** + _sbrk + Increase program data space. Malloc and related functions depend on this +**/ +caddr_t _sbrk(int incr) +{ + extern char end asm("end"); + static char * heap_end; + char * prev_heap_end; + + if (heap_end == 0) + heap_end = &end; + + prev_heap_end = heap_end; + if (heap_end + incr > stack_ptr) + { + errno = ENOMEM; + return (caddr_t) -1; + } + + heap_end += incr; + + return (caddr_t) prev_heap_end; +} diff --git a/examples/platform/stm32/common/STM32WB5MM-DK/Src/system_stm32wbxx.c b/examples/platform/stm32/common/STM32WB5MM-DK/Src/system_stm32wbxx.c new file mode 100644 index 00000000000000..533cc4f0aa9671 --- /dev/null +++ b/examples/platform/stm32/common/STM32WB5MM-DK/Src/system_stm32wbxx.c @@ -0,0 +1,345 @@ +/** + ****************************************************************************** + * @file system_stm32wbxx.c + * @author MCD Application Team + * @brief CMSIS Cortex Device Peripheral Access Layer System Source File + * + * This file provides two functions and one global variable to be called from + * user application: + * - SystemInit(): This function is called at startup just after reset and + * before branch to main program. This call is made inside + * the "startup_stm32wbxx.s" file. + * + * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used + * by the user application to setup the SysTick + * timer or configure other parameters. + * + * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must + * be called whenever the core clock is changed + * during program execution. + * + * After each device reset the MSI (4 MHz) is used as system clock source. + * Then SystemInit() function is called, in "startup_stm32wbxx.s" file, to + * configure the system clock before to branch to main program. + * + * This file configures the system clock as follows: + *============================================================================= + *----------------------------------------------------------------------------- + * System Clock source | MSI + *----------------------------------------------------------------------------- + * SYSCLK(Hz) | 4000000 + *----------------------------------------------------------------------------- + * HCLK(Hz) | 4000000 + *----------------------------------------------------------------------------- + * AHB Prescaler | 1 + *----------------------------------------------------------------------------- + * APB1 Prescaler | 1 + *----------------------------------------------------------------------------- + * APB2 Prescaler | 1 + *----------------------------------------------------------------------------- + * PLL_M | 1 + *----------------------------------------------------------------------------- + * PLL_N | 8 + *----------------------------------------------------------------------------- + * PLL_P | 7 + *----------------------------------------------------------------------------- + * PLL_Q | 2 + *----------------------------------------------------------------------------- + * PLL_R | 2 + *----------------------------------------------------------------------------- + * PLLSAI1_P | NA + *----------------------------------------------------------------------------- + * PLLSAI1_Q | NA + *----------------------------------------------------------------------------- + * PLLSAI1_R | NA + *----------------------------------------------------------------------------- + * Require 48MHz for USB OTG FS, | Disabled + * SDIO and RNG clock | + *----------------------------------------------------------------------------- + *============================================================================= + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +/** @addtogroup CMSIS + * @{ + */ + +/** @addtogroup stm32WBxx_system + * @{ + */ + +/** @addtogroup stm32WBxx_System_Private_Includes + * @{ + */ + +#include "app_common.h" +#include "otp.h" + +#if !defined(HSE_VALUE) +#define HSE_VALUE (32000000UL) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined(MSI_VALUE) +#define MSI_VALUE (4000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +#if !defined(HSI_VALUE) +#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +#if !defined(LSI_VALUE) +#define LSI_VALUE (32000UL) /*!< Value of LSI in Hz*/ +#endif /* LSI_VALUE */ + +#if !defined(LSE_VALUE) +#define LSE_VALUE (32768UL) /*!< Value of LSE in Hz*/ +#endif /* LSE_VALUE */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_TypesDefinitions + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_Defines + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_Macros + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_Variables + * @{ + */ +/* The SystemCoreClock variable is updated in three ways: + 1) by calling CMSIS function SystemCoreClockUpdate() + 2) by calling HAL API function HAL_RCC_GetHCLKFreq() + 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency + Note: If you use this function to configure the system clock; then there + is no need to call the 2 first functions listed above, since SystemCoreClock + variable is updated automatically. + */ +uint32_t SystemCoreClock = 4000000UL; /*CPU1: M4 on MSI clock after startup (4MHz)*/ + +const uint32_t AHBPrescTable[16UL] = { 1UL, 3UL, 5UL, 1UL, 1UL, 6UL, 10UL, 32UL, 2UL, 4UL, 8UL, 16UL, 64UL, 128UL, 256UL, 512UL }; + +const uint32_t APBPrescTable[8UL] = { 0UL, 0UL, 0UL, 0UL, 1UL, 2UL, 3UL, 4UL }; + +const uint32_t MSIRangeTable[16UL] = { + 100000UL, 200000UL, 400000UL, 800000UL, 1000000UL, 2000000UL, 4000000UL, 8000000UL, + 16000000UL, 24000000UL, 32000000UL, 48000000UL, 0UL, 0UL, 0UL, 0UL +}; /* 0UL values are incorrect cases */ + +#if defined(STM32WB55xx) || defined(STM32WB5Mxx) || defined(STM32WB35xx) || defined(STM32WB15xx) +const uint32_t SmpsPrescalerTable[4UL][6UL] = { { 1UL, 3UL, 2UL, 2UL, 1UL, 2UL }, + { 2UL, 6UL, 4UL, 3UL, 2UL, 4UL }, + { 4UL, 12UL, 8UL, 6UL, 4UL, 8UL }, + { 4UL, 12UL, 8UL, 6UL, 4UL, 8UL } }; +#endif + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_FunctionPrototypes + * @{ + */ + +/** + * @} + */ + +/** @addtogroup STM32WBxx_System_Private_Functions + * @{ + */ + +/** + * @brief Setup the microcontroller system. + * @param None + * @retval None + */ +void SystemInit(void) +{ + OTP_ID0_t * p_otp; + + /* FPU settings ------------------------------------------------------------*/ +#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) + SCB->CPACR |= ((3UL << (10UL * 2UL)) | (3UL << (11UL * 2UL))); /* set CP10 and CP11 Full Access */ +#endif + + /** + * Read HSE_Tuning from OTP + */ + p_otp = (OTP_ID0_t *) OTP_Read(0); + if (p_otp) + { + LL_RCC_HSE_SetCapacitorTuning(p_otp->hse_tuning); + } + + LL_RCC_HSE_Enable(); + + /** + * Set FLASH latency to 1WS + */ + LL_FLASH_SetLatency(LL_FLASH_LATENCY_1); + while (LL_FLASH_GetLatency() != LL_FLASH_LATENCY_1) + ; + + /** + * Switch to HSE + * + */ + while (!LL_RCC_HSE_IsReady()) + ; + LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_HSE); + while (LL_RCC_GetSysClkSource() != LL_RCC_SYS_CLKSOURCE_STATUS_HSE) + ; + + /** + * Switch OFF MSI + */ + LL_RCC_MSI_Disable(); +} + +/** + * @brief Update SystemCoreClock variable according to Clock Register Values. + * The SystemCoreClock variable contains the core clock (HCLK), it can + * be used by the user application to setup the SysTick timer or configure + * other parameters. + * + * @note Each time the core clock (HCLK) changes, this function must be called + * to update SystemCoreClock variable value. Otherwise, any configuration + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined + * constant and the selected clock source: + * + * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*) + * + * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**) + * + * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***) + * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors. + * + * (*) MSI_VALUE is a constant defined in stm32wbxx_hal.h file (default value + * 4 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * + * (**) HSI_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value + * 16 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * + * (***) HSE_VALUE is a constant defined in stm32wbxx_hal_conf.h file (default value + * 32 MHz), user has to ensure that HSE_VALUE is same as the real + * frequency of the crystal used. Otherwise, this function may + * have wrong result. + * + * - The result of this function could be not correct when using fractional + * value for HSE crystal. + * + * @param None + * @retval None + */ +void SystemCoreClockUpdate(void) +{ + uint32_t tmp, msirange, pllvco, pllr, pllsource, pllm; + + /* Get MSI Range frequency--------------------------------------------------*/ + + /*MSI frequency range in Hz*/ + msirange = MSIRangeTable[(RCC->CR & RCC_CR_MSIRANGE) >> RCC_CR_MSIRANGE_Pos]; + + /*SystemCoreClock=HAL_RCC_GetSysClockFreq();*/ + /* Get SYSCLK source -------------------------------------------------------*/ + switch (RCC->CFGR & RCC_CFGR_SWS) + { + case 0x00: /* MSI used as system clock source */ + SystemCoreClock = msirange; + break; + + case 0x04: /* HSI used as system clock source */ + /* HSI used as system clock source */ + SystemCoreClock = HSI_VALUE; + break; + + case 0x08: /* HSE used as system clock source */ + SystemCoreClock = HSE_VALUE; + break; + + case 0x0C: /* PLL used as system clock source */ + /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN + SYSCLK = PLL_VCO / PLLR + */ + pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC); + pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> RCC_PLLCFGR_PLLM_Pos) + 1UL; + + if (pllsource == 0x02UL) /* HSI used as PLL clock source */ + { + pllvco = (HSI_VALUE / pllm); + } + else if (pllsource == 0x03UL) /* HSE used as PLL clock source */ + { + pllvco = (HSE_VALUE / pllm); + } + else /* MSI used as PLL clock source */ + { + pllvco = (msirange / pllm); + } + + pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> RCC_PLLCFGR_PLLN_Pos); + pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> RCC_PLLCFGR_PLLR_Pos) + 1UL); + + SystemCoreClock = pllvco / pllr; + break; + + default: + SystemCoreClock = msirange; + break; + } + + /* Compute HCLK clock frequency --------------------------------------------*/ + /* Get HCLK1 prescaler */ + tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)]; + /* HCLK clock frequency */ + SystemCoreClock = SystemCoreClock / tmp; +} + +/** + * @} + */ + +/** + * @} + */ + +/** + * @} + */ diff --git a/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h b/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h new file mode 100644 index 00000000000000..5423994ea0bc12 --- /dev/null +++ b/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h @@ -0,0 +1,191 @@ +/* USER CODE BEGIN Header */ +/* + * FreeRTOS Kernel V10.0.1 + * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://www.FreeRTOS.org + * http://aws.amazon.com/freertos + * + * 1 tab == 4 spaces! + */ +/* USER CODE END Header */ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * These parameters and more are described within the 'configuration' section of the + * FreeRTOS API documentation available on the FreeRTOS.org web site. + * + * See http://www.freertos.org/a00110.html + *----------------------------------------------------------*/ + +/* USER CODE BEGIN Includes */ +/* Section where include file can be added */ +/* USER CODE END Includes */ + +/* Ensure definitions are only used by the compiler, and not by the assembler. */ +#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) +#include +extern uint32_t SystemCoreClock; +#endif +#ifndef CMSIS_device_header +#define CMSIS_device_header "stm32wbxx.h" +#endif /* CMSIS_device_header */ + +#define configENABLE_FPU 0 +#define configENABLE_MPU 0 + +#define configUSE_PREEMPTION 1 +#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_DYNAMIC_ALLOCATION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configCPU_CLOCK_HZ (SystemCoreClock) +#define configTICK_RATE_HZ ((TickType_t) 1000) +#define configMAX_PRIORITIES (56) +#define configMINIMAL_STACK_SIZE ((uint16_t) 128) +#define configTOTAL_HEAP_SIZE ((size_t) 1024 * 25) +#define configMAX_TASK_NAME_LEN (32) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 +#define configUSE_TICKLESS_IDLE 0 +/* USER CODE BEGIN MESSAGE_BUFFER_LENGTH_TYPE */ +/* Defaults to size_t for backward compatibility, but can be changed + if lengths will always be less than the number of bytes in a size_t. */ +#define configMESSAGE_BUFFER_LENGTH_TYPE size_t +/* USER CODE END MESSAGE_BUFFER_LENGTH_TYPE */ + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES (2) + +/* Software timer definitions. */ +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY (2) +#define configTIMER_QUEUE_LENGTH 10 +#define configTIMER_TASK_STACK_DEPTH 256 + +/* CMSIS-RTOS V2 flags */ +#define configUSE_OS2_THREAD_SUSPEND_RESUME 1 +#define configUSE_OS2_THREAD_ENUMERATE 1 +#define configUSE_OS2_EVENTFLAGS_FROM_ISR 1 +#define configUSE_OS2_THREAD_FLAGS 1 +#define configUSE_OS2_TIMER 1 +#define configUSE_OS2_MUTEX 1 + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_xTaskGetSchedulerState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xQueueGetMutexHolder 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_xTaskGetCurrentTaskHandle 1 +#define INCLUDE_eTaskGetState 1 + +/* + * The CMSIS-RTOS V2 FreeRTOS wrapper is dependent on the heap implementation used + * by the application thus the correct define need to be enabled below + */ +#define USE_FreeRTOS_HEAP_4 + +/* Cortex-M specific definitions. */ +#ifdef __NVIC_PRIO_BITS +/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ +#define configPRIO_BITS __NVIC_PRIO_BITS +#else +#define configPRIO_BITS 4 +#endif + +/* The lowest interrupt priority that can be used in a call to a "set priority" +function. */ +#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 + +/* The highest interrupt priority that can be used by any interrupt service +routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL +INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER +PRIORITY THAN THIS! (higher priorities are lower numeric values. */ +#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 + +/* Interrupt priorities used by the kernel port layer itself. These are generic +to all Cortex-M ports, and do not rely on any particular library functions. */ +#define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) +/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! +See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ +#define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS)) + +/* Normal assert() semantics without relying on the provision of an assert.h +header file. */ +/* USER CODE BEGIN 1 */ +#define configASSERT(x) \ + if ((x) == 0) \ + { \ + taskDISABLE_INTERRUPTS(); \ + for (;;) \ + ; \ + } +/* USER CODE END 1 */ + +/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS +standard names. */ +#define vPortSVCHandler SVC_Handler +#define xPortPendSVHandler PendSV_Handler + +/* IMPORTANT: After 10.3.1 update, Systick_Handler comes from NVIC (if SYS timebase = systick), otherwise from cmsis_os2.c */ + +#define USE_CUSTOM_SYSTICK_HANDLER_IMPLEMENTATION 0 + +/* USER CODE BEGIN Defines */ +/* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ +//#define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 1 /* required only for Keil but does not hurt otherwise */ +#define configGENERATE_RUN_TIME_STATS 1 + +#if (configGENERATE_RUN_TIME_STATS == 1) + +extern void RTOS_AppConfigureTimerForRuntimeStats(); + +extern uint32_t RTOS_AppGetRuntimeCounterValueFromISR(); + +#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() RTOS_AppConfigureTimerForRuntimeStats() + +#define portGET_RUN_TIME_COUNTER_VALUE() RTOS_AppGetRuntimeCounterValueFromISR() + +#endif + +/* USER CODE END Defines */ + +#endif /* FREERTOS_CONFIG_H */ diff --git a/examples/platform/stm32/config_files/STM32WB5/matter_config.h b/examples/platform/stm32/config_files/STM32WB5/matter_config.h new file mode 100644 index 00000000000000..3ab112ea03b75a --- /dev/null +++ b/examples/platform/stm32/config_files/STM32WB5/matter_config.h @@ -0,0 +1,139 @@ +/** + ****************************************************************************** + * @file matter_config.h + * @author MCD Application Team + * @brief config file for mbedtls + ****************************************************************************** + * @attention + * + * Copyright (c) 2019-2021 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + +#pragma once + +#include +#include +#include + +//#if CHIP_HAVE_CONFIG_H +//#include +//#endif // CHIP_HAVE_CONFIG_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Enable H Crypto and Entropy modules + */ +#define MBEDTLS_AES_C +#define MBEDTLS_ECP_C +#define MBEDTLS_ECDH_C +#define MBEDTLS_ENTROPY_C +#define MBEDTLS_SHA224_C +#define MBEDTLS_SHA256_C + +#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf + +#define MBEDTLS_AES_ROM_TABLES +#define MBEDTLS_ASN1_PARSE_C +#define MBEDTLS_ASN1_WRITE_C +#define MBEDTLS_BASE64_C +#define MBEDTLS_BIGNUM_C +#define MBEDTLS_CCM_C +#define MBEDTLS_CIPHER_C +#define MBEDTLS_CMAC_C +#define MBEDTLS_CTR_DRBG_C +#define MBEDTLS_ECDH_LEGACY_CONTEXT +#define MBEDTLS_ECDSA_C +#define MBEDTLS_ECDSA_DETERMINISTIC +#define MBEDTLS_ECJPAKE_C +#define MBEDTLS_ECP_DP_SECP256R1_ENABLED +#define MBEDTLS_ECP_NIST_OPTIM +#define MBEDTLS_ENTROPY_FORCE_SHA256 +#define MBEDTLS_ENTROPY_HARDWARE_ALT +#define MBEDTLS_ERROR_STRERROR_DUMMY +#define MBEDTLS_HAVE_ASM +#define MBEDTLS_HKDF_C +#define MBEDTLS_HMAC_DRBG_C +#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED +#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED +#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED +#define MBEDTLS_MD_C + +#define MBEDTLS_NO_PLATFORM_ENTROPY +#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES + +#define MBEDTLS_OID_C +#define MBEDTLS_PEM_PARSE_C +#define MBEDTLS_PEM_WRITE_C +#define MBEDTLS_PK_C +#define MBEDTLS_PK_PARSE_C +#define MBEDTLS_PK_WRITE_C +#if CHIP_CRYPTO_MBEDTLS +#define MBEDTLS_PKCS5_C +#endif +#define MBEDTLS_PLATFORM_C +#define MBEDTLS_PLATFORM_MEMORY +#define MBEDTLS_SHA256_SMALLER +#define MBEDTLS_SSL_CLI_C +#define MBEDTLS_SSL_COOKIE_C +#define MBEDTLS_SSL_DTLS_ANTI_REPLAY +#define MBEDTLS_SSL_DTLS_HELLO_VERIFY +#define MBEDTLS_SSL_EXPORT_KEYS +#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE +#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH +#define MBEDTLS_SSL_PROTO_TLS1_2 +#define MBEDTLS_SSL_PROTO_DTLS +#define MBEDTLS_SSL_SRV_C +#define MBEDTLS_SSL_TLS_C + +#if CHIP_CRYPTO_PLATFORM +#define MBEDTLS_USE_PSA_CRYPTO +#endif + +#define MBEDTLS_X509_CREATE_C +#define MBEDTLS_X509_CSR_WRITE_C +#define MBEDTLS_X509_CRL_PARSE_C +#define MBEDTLS_X509_CRT_PARSE_C +#define MBEDTLS_X509_CSR_PARSE_C +#define MBEDTLS_X509_USE_C + +#define MBEDTLS_MPI_WINDOW_SIZE 1 /**< Maximum windows size used. */ +#define MBEDTLS_MPI_MAX_SIZE 32 /**< Maximum number of bytes for usable MPIs. */ +#define MBEDTLS_ECP_MAX_BITS 256 /**< Maximum bit size of groups */ +#define MBEDTLS_ECP_WINDOW_SIZE 2 /**< Maximum window size used */ +#define MBEDTLS_ECP_FIXED_POINT_OPTIM 0 /**< Enable fixed-point speed-up */ +#define MBEDTLS_ENTROPY_MAX_SOURCES 2 /**< Maximum number of sources supported */ + +#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE +#define MBEDTLS_SSL_MAX_CONTENT_LEN 900 /**< Maxium fragment length in bytes */ +#else +#define MBEDTLS_SSL_MAX_CONTENT_LEN 768 /**< Maxium fragment length in bytes */ +#endif + +#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 + +#define MBEDTLS_CIPHER_MODE_WITH_PADDING + +#define MBEDTLS_THREADING_ALT +#define MBEDTLS_THREADING_C +#define MBEDTLS_MEMORY_BUFFER_ALLOC_C +#define MBEDTLS_PKCS5_C + +#define MBEDTLS_ERROR_C 1 + +//#include "check_crypto_config.h" +#include "mbedtls/check_config.h" +#include "mbedtls/config_psa.h" + +#ifdef __cplusplus +} +#endif diff --git a/examples/platform/stm32/config_files/STM32WB5/threading_alt.h b/examples/platform/stm32/config_files/STM32WB5/threading_alt.h new file mode 100644 index 00000000000000..253ddd9c0048a0 --- /dev/null +++ b/examples/platform/stm32/config_files/STM32WB5/threading_alt.h @@ -0,0 +1,50 @@ +/* + * FreeRTOS PKCS #11 V2.0.3 + * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * http://aws.amazon.com/freertos + * http://www.FreeRTOS.org + */ + +#ifndef __THREADING_ALT_H__ +#define __THREADING_ALT_H__ + +#include "FreeRTOS.h" +#include "semphr.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct +{ + SemaphoreHandle_t mutex; + char is_valid; +} mbedtls_threading_mutex_t; + +extern void mbedtls_threading_set_alt(void (*mutex_init)(mbedtls_threading_mutex_t *), + void (*mutex_free)(mbedtls_threading_mutex_t *), + int (*mutex_lock)(mbedtls_threading_mutex_t *), + int (*mutex_unlock)(mbedtls_threading_mutex_t *)); + +#ifdef __cplusplus +} +#endif +#endif /* ifndef __THREADING_ALT_H__ */ diff --git a/examples/platform/stm32/ldscripts/STM32WB5MMGHX_FLASH.ld b/examples/platform/stm32/ldscripts/STM32WB5MMGHX_FLASH.ld new file mode 100644 index 00000000000000..56292a5b88ac1b --- /dev/null +++ b/examples/platform/stm32/ldscripts/STM32WB5MMGHX_FLASH.ld @@ -0,0 +1,198 @@ +/* +****************************************************************************** +** +** File : LinkerScript.ld +** +** Author : STM32CubeIDE +** +** Abstract : Linker script for STM32WB5MMG Device +** 1024Kbytes FLASH +** 256Kbytes RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Distribution: The file is distributed as is without any warranty +** of any kind. +** +***************************************************************************** +** @attention +** +** Copyright (c) 2020 STMicroelectronics. +** All rights reserved. +** +** This software is licensed under terms that can be found in the LICENSE file +** in the root directory of this software component. +** If no LICENSE file comes with this software, it is provided AS-IS. +** +***************************************************************************** +*/ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = 0x20026EC4; /* end of RAM */ +/* Generate a link error if heap and stack don't fit into RAM */ +_Min_Heap_Size = 0x400 ; /* required amount of heap */ +_Min_Stack_Size = 0x1000 ; /* required amount of stack */ + +/* Specify the memory areas */ +MEMORY +{ +FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 520K +NVM_MATTER : ORIGIN = 0x08082000, LENGTH = 0x3000 +RAM1 (xrw) : ORIGIN = 0x20000008, LENGTH = 0x26EC4 +RAM_SHARED (xrw) : ORIGIN = 0x20030000, LENGTH = 10K +} + +/* Define output sections */ +SECTIONS +{ + /* The startup code goes first into FLASH */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data goes into FLASH */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM : { + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + } >FLASH + +_nvm_matter_init_base = LOADADDR(.nvm_matter); +_nvm_matter_init_length = SIZEOF(.nvm_matter); + + .nvm_matter : + { + . = ALIGN(4); + _nvm_matter_start = .; /* create a global symbol at nvm_matter start */ + *(.nvm_matter) /* .nvm_matter sections */ + *(.nvm_matter*) /* .nvm_matter* sections */ + . = ALIGN(4); + _nvm_matter_end = .; /* define a global symbols at end of nvm_matter */ + + } >NVM_MATTER + + + .preinit_array : + { + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + } >FLASH + .init_array : + { + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + } >FLASH + .fini_array : + { + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + } >FLASH + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + *(.RamFunc) /* .RamFunc sections */ + *(.RamFunc*) /* .RamFunc* sections */ + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM1 AT> FLASH + + /* Uninitialized data section */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss section */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM1 + + /* User_heap_stack section, used to check that there is enough RAM left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM1 + + /* Remove information from the standard libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } + MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED + MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED + MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED + + + + + + +} + + + + diff --git a/examples/platform/stm32/startup_files/startup_STM32WB5MMGHX.s b/examples/platform/stm32/startup_files/startup_STM32WB5MMGHX.s new file mode 100644 index 00000000000000..53c16dab9acbe4 --- /dev/null +++ b/examples/platform/stm32/startup_files/startup_STM32WB5MMGHX.s @@ -0,0 +1,443 @@ +/** + ****************************************************************************** + * @file startup_stm32wb5mxx_cm4.s + * @author MCD Application Team + * @brief STM32WB5Mxx devices vector table GCC toolchain. + * This module performs: + * - Set the initial SP + * - Set the initial PC == Reset_Handler, + * - Set the vector table entries with the exceptions ISR address + * - Branches to main in the C library (which eventually + * calls main()). + * After Reset the Cortex-M4 processor is in Thread mode, + * priority is Privileged, and the Stack is set to Main. + ****************************************************************************** + * @attention + * + * Copyright (c) 2019 STMicroelectronics. + * All rights reserved. + * + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. + * + ****************************************************************************** + */ + + .syntax unified + .cpu cortex-m4 + .fpu softvfp + .thumb + +.global g_pfnVectors +.global Default_Handler + +/* start address for the initialization values of the .data section. +defined in linker script */ +.word _sidata +/* start address for the .data section. defined in linker script */ +.word _sdata +/* end address for the .data section. defined in linker script */ +.word _edata +/* start address for the .bss section. defined in linker script */ +.word _sbss +/* end address for the .bss section. defined in linker script */ +.word _ebss +/* start address for the .MB_MEM2 section. defined in linker script */ +.word _sMB_MEM2 +/* end address for the .MB_MEM2 section. defined in linker script */ +.word _eMB_MEM2 + +/* INIT_BSS macro is used to fill the specified region [start : end] with zeros */ +.macro INIT_BSS start, end + ldr r0, =\start + ldr r1, =\end + movs r3, #0 + bl LoopFillZerobss +.endm + +/* INIT_DATA macro is used to copy data in the region [start : end] starting from 'src' */ +.macro INIT_DATA start, end, src + ldr r0, =\start + ldr r1, =\end + ldr r2, =\src + movs r3, #0 + bl LoopCopyDataInit +.endm + +.section .text.data_initializers +CopyDataInit: + ldr r4, [r2, r3] + str r4, [r0, r3] + adds r3, r3, #4 + +LoopCopyDataInit: + adds r4, r0, r3 + cmp r4, r1 + bcc CopyDataInit + bx lr + +FillZerobss: + str r3, [r0] + adds r0, r0, #4 + +LoopFillZerobss: + cmp r0, r1 + bcc FillZerobss + bx lr + + .section .text.Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function +Reset_Handler: +ldr r0, =_estack + mov sp, r0 /* set stack pointer */ +/* Call the clock system initialization function.*/ + bl SystemInit + +/* Copy the data segment initializers from flash to SRAM */ + INIT_DATA _sdata, _edata, _sidata + +/* Zero fill the bss segments. */ + INIT_BSS _sbss, _ebss + INIT_BSS _sMB_MEM2, _eMB_MEM2 + +/* Call static constructors */ + bl __libc_init_array +/* Call the application s entry point.*/ + bl main + +LoopForever: + b LoopForever + +.size Reset_Handler, .-Reset_Handler + +/** + * @brief This is the code that gets called when the processor receives an + * unexpected interrupt. This simply enters an infinite loop, preserving + * the system state for examination by a debugger. + * + * @param None + * @retval None +*/ + .section .text.Default_Handler,"ax",%progbits +Default_Handler: +Infinite_Loop: + b Infinite_Loop + .size Default_Handler, .-Default_Handler +/****************************************************************************** +* +* The minimal vector table for a Cortex-M4. Note that the proper constructs +* must be placed on this to ensure that it ends up at physical address +* 0x0000.0000. +* +******************************************************************************/ + .section .isr_vector,"a",%progbits + .type g_pfnVectors, %object + .size g_pfnVectors, .-g_pfnVectors + + +g_pfnVectors: + .word _estack + .word Reset_Handler + .word NMI_Handler + .word HardFault_Handler + .word MemManage_Handler + .word BusFault_Handler + .word UsageFault_Handler + .word 0 + .word 0 + .word 0 + .word 0 + .word SVC_Handler + .word DebugMon_Handler + .word 0 + .word PendSV_Handler + .word SysTick_Handler + .word WWDG_IRQHandler + .word PVD_PVM_IRQHandler + .word TAMP_STAMP_LSECSS_IRQHandler + .word RTC_WKUP_IRQHandler + .word FLASH_IRQHandler + .word RCC_IRQHandler + .word EXTI0_IRQHandler + .word EXTI1_IRQHandler + .word EXTI2_IRQHandler + .word EXTI3_IRQHandler + .word EXTI4_IRQHandler + .word DMA1_Channel1_IRQHandler + .word DMA1_Channel2_IRQHandler + .word DMA1_Channel3_IRQHandler + .word DMA1_Channel4_IRQHandler + .word DMA1_Channel5_IRQHandler + .word DMA1_Channel6_IRQHandler + .word DMA1_Channel7_IRQHandler + .word ADC1_IRQHandler + .word USB_HP_IRQHandler + .word USB_LP_IRQHandler + .word C2SEV_PWR_C2H_IRQHandler + .word COMP_IRQHandler + .word EXTI9_5_IRQHandler + .word TIM1_BRK_IRQHandler + .word TIM1_UP_TIM16_IRQHandler + .word TIM1_TRG_COM_TIM17_IRQHandler + .word TIM1_CC_IRQHandler + .word TIM2_IRQHandler + .word PKA_IRQHandler + .word I2C1_EV_IRQHandler + .word I2C1_ER_IRQHandler + .word I2C3_EV_IRQHandler + .word I2C3_ER_IRQHandler + .word SPI1_IRQHandler + .word SPI2_IRQHandler + .word USART1_IRQHandler + .word LPUART1_IRQHandler + .word SAI1_IRQHandler + .word TSC_IRQHandler + .word EXTI15_10_IRQHandler + .word RTC_Alarm_IRQHandler + .word CRS_IRQHandler + .word PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler + .word IPCC_C1_RX_IRQHandler + .word IPCC_C1_TX_IRQHandler + .word HSEM_IRQHandler + .word LPTIM1_IRQHandler + .word LPTIM2_IRQHandler + .word LCD_IRQHandler + .word QUADSPI_IRQHandler + .word AES1_IRQHandler + .word AES2_IRQHandler + .word RNG_IRQHandler + .word FPU_IRQHandler + .word DMA2_Channel1_IRQHandler + .word DMA2_Channel2_IRQHandler + .word DMA2_Channel3_IRQHandler + .word DMA2_Channel4_IRQHandler + .word DMA2_Channel5_IRQHandler + .word DMA2_Channel6_IRQHandler + .word DMA2_Channel7_IRQHandler + .word DMAMUX1_OVR_IRQHandler + +/******************************************************************************* +* +* Provide weak aliases for each Exception handler to the Default_Handler. +* As they are weak aliases, any function with the same name will override +* this definition. +* +*******************************************************************************/ + .weak NMI_Handler + .thumb_set NMI_Handler,Default_Handler + + .weak HardFault_Handler + .thumb_set HardFault_Handler,Default_Handler + + .weak MemManage_Handler + .thumb_set MemManage_Handler,Default_Handler + + .weak BusFault_Handler + .thumb_set BusFault_Handler,Default_Handler + + .weak UsageFault_Handler + .thumb_set UsageFault_Handler,Default_Handler + + .weak SVC_Handler + .thumb_set SVC_Handler,Default_Handler + + .weak DebugMon_Handler + .thumb_set DebugMon_Handler,Default_Handler + + .weak PendSV_Handler + .thumb_set PendSV_Handler,Default_Handler + + .weak SysTick_Handler + .thumb_set SysTick_Handler,Default_Handler + + .weak WWDG_IRQHandler + .thumb_set WWDG_IRQHandler,Default_Handler + + .weak PVD_PVM_IRQHandler + .thumb_set PVD_PVM_IRQHandler,Default_Handler + + .weak TAMP_STAMP_LSECSS_IRQHandler + .thumb_set TAMP_STAMP_LSECSS_IRQHandler,Default_Handler + + .weak RTC_WKUP_IRQHandler + .thumb_set RTC_WKUP_IRQHandler,Default_Handler + + .weak FLASH_IRQHandler + .thumb_set FLASH_IRQHandler,Default_Handler + + .weak RCC_IRQHandler + .thumb_set RCC_IRQHandler,Default_Handler + + .weak EXTI0_IRQHandler + .thumb_set EXTI0_IRQHandler,Default_Handler + + .weak EXTI1_IRQHandler + .thumb_set EXTI1_IRQHandler,Default_Handler + + .weak EXTI2_IRQHandler + .thumb_set EXTI2_IRQHandler,Default_Handler + + .weak EXTI3_IRQHandler + .thumb_set EXTI3_IRQHandler,Default_Handler + + .weak EXTI4_IRQHandler + .thumb_set EXTI4_IRQHandler,Default_Handler + + .weak DMA1_Channel1_IRQHandler + .thumb_set DMA1_Channel1_IRQHandler,Default_Handler + + .weak DMA1_Channel2_IRQHandler + .thumb_set DMA1_Channel2_IRQHandler,Default_Handler + + .weak DMA1_Channel3_IRQHandler + .thumb_set DMA1_Channel3_IRQHandler,Default_Handler + + .weak DMA1_Channel4_IRQHandler + .thumb_set DMA1_Channel4_IRQHandler,Default_Handler + + .weak DMA1_Channel5_IRQHandler + .thumb_set DMA1_Channel5_IRQHandler,Default_Handler + + .weak DMA1_Channel6_IRQHandler + .thumb_set DMA1_Channel6_IRQHandler,Default_Handler + + .weak DMA1_Channel7_IRQHandler + .thumb_set DMA1_Channel7_IRQHandler,Default_Handler + + .weak ADC1_IRQHandler + .thumb_set ADC1_IRQHandler,Default_Handler + + .weak USB_HP_IRQHandler + .thumb_set USB_HP_IRQHandler,Default_Handler + + .weak USB_LP_IRQHandler + .thumb_set USB_LP_IRQHandler,Default_Handler + + .weak C2SEV_PWR_C2H_IRQHandler + .thumb_set C2SEV_PWR_C2H_IRQHandler,Default_Handler + + .weak COMP_IRQHandler + .thumb_set COMP_IRQHandler,Default_Handler + + .weak EXTI9_5_IRQHandler + .thumb_set EXTI9_5_IRQHandler,Default_Handler + + .weak TIM1_BRK_IRQHandler + .thumb_set TIM1_BRK_IRQHandler,Default_Handler + + .weak TIM1_UP_TIM16_IRQHandler + .thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler + + .weak TIM1_TRG_COM_TIM17_IRQHandler + .thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler + + .weak TIM1_CC_IRQHandler + .thumb_set TIM1_CC_IRQHandler,Default_Handler + + .weak TIM2_IRQHandler + .thumb_set TIM2_IRQHandler,Default_Handler + + .weak PKA_IRQHandler + .thumb_set PKA_IRQHandler,Default_Handler + + .weak I2C1_EV_IRQHandler + .thumb_set I2C1_EV_IRQHandler,Default_Handler + + .weak I2C1_ER_IRQHandler + .thumb_set I2C1_ER_IRQHandler,Default_Handler + + .weak I2C3_EV_IRQHandler + .thumb_set I2C3_EV_IRQHandler,Default_Handler + + .weak I2C3_ER_IRQHandler + .thumb_set I2C3_ER_IRQHandler,Default_Handler + + .weak SPI1_IRQHandler + .thumb_set SPI1_IRQHandler,Default_Handler + + .weak SPI2_IRQHandler + .thumb_set SPI2_IRQHandler,Default_Handler + + .weak USART1_IRQHandler + .thumb_set USART1_IRQHandler,Default_Handler + + .weak LPUART1_IRQHandler + .thumb_set LPUART1_IRQHandler,Default_Handler + + .weak SAI1_IRQHandler + .thumb_set SAI1_IRQHandler,Default_Handler + + .weak TSC_IRQHandler + .thumb_set TSC_IRQHandler,Default_Handler + + .weak EXTI15_10_IRQHandler + .thumb_set EXTI15_10_IRQHandler,Default_Handler + + .weak RTC_Alarm_IRQHandler + .thumb_set RTC_Alarm_IRQHandler,Default_Handler + + .weak CRS_IRQHandler + .thumb_set CRS_IRQHandler,Default_Handler + + .weak PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler + .thumb_set PWR_SOTF_BLEACT_802ACT_RFPHASE_IRQHandler,Default_Handler + + .weak IPCC_C1_RX_IRQHandler + .thumb_set IPCC_C1_RX_IRQHandler,Default_Handler + + .weak IPCC_C1_TX_IRQHandler + .thumb_set IPCC_C1_TX_IRQHandler,Default_Handler + + .weak HSEM_IRQHandler + .thumb_set HSEM_IRQHandler,Default_Handler + + .weak LPTIM1_IRQHandler + .thumb_set LPTIM1_IRQHandler,Default_Handler + + .weak LPTIM2_IRQHandler + .thumb_set LPTIM2_IRQHandler,Default_Handler + + .weak LCD_IRQHandler + .thumb_set LCD_IRQHandler,Default_Handler + + .weak QUADSPI_IRQHandler + .thumb_set QUADSPI_IRQHandler,Default_Handler + + .weak AES1_IRQHandler + .thumb_set AES1_IRQHandler,Default_Handler + + .weak AES2_IRQHandler + .thumb_set AES2_IRQHandler,Default_Handler + + .weak RNG_IRQHandler + .thumb_set RNG_IRQHandler,Default_Handler + + .weak FPU_IRQHandler + .thumb_set FPU_IRQHandler,Default_Handler + + .weak DMA2_Channel1_IRQHandler + .thumb_set DMA2_Channel1_IRQHandler,Default_Handler + + .weak DMA2_Channel2_IRQHandler + .thumb_set DMA2_Channel2_IRQHandler,Default_Handler + + .weak DMA2_Channel3_IRQHandler + .thumb_set DMA2_Channel3_IRQHandler,Default_Handler + + .weak DMA2_Channel4_IRQHandler + .thumb_set DMA2_Channel4_IRQHandler,Default_Handler + + .weak DMA2_Channel5_IRQHandler + .thumb_set DMA2_Channel5_IRQHandler,Default_Handler + + .weak DMA2_Channel6_IRQHandler + .thumb_set DMA2_Channel6_IRQHandler,Default_Handler + + .weak DMA2_Channel7_IRQHandler + .thumb_set DMA2_Channel7_IRQHandler,Default_Handler + + .weak DMAMUX1_OVR_IRQHandler + .thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler + diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index a87d26cd165cf8..7f8f3812b95e01 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -30,6 +30,7 @@ from builders.nrf import NrfApp, NrfBoard, NrfConnectBuilder from builders.openiotsdk import OpenIotSdkApp, OpenIotSdkBuilder, OpenIotSdkCryptoBackend from builders.qpg import QpgApp, QpgBoard, QpgBuilder +from builders.stm32 import stm32App, stm32Board, stm32Builder from builders.telink import TelinkApp, TelinkBoard, TelinkBuilder from builders.ti import TIApp, TIBoard, TIBuilder from builders.tizen import TizenApp, TizenBoard, TizenBuilder @@ -563,6 +564,22 @@ def BuildQorvoTarget(): return target +def BuildStm32Target(): + target = BuildTarget('stm32', stm32Builder) + + # board + target.AppendFixedTargets([ + TargetPart('STM32WB5MM-DK', board=stm32Board.STM32WB55XX), + ]) + + # apps + target.AppendFixedTargets([ + TargetPart('light', app=stm32App.LIGHT), + ]) + + return target + + def BuildTizenTarget(): target = BuildTarget('tizen', TizenBuilder) @@ -724,6 +741,7 @@ def BuildOpenIotSdkTargets(): BuildNrfTarget(), BuildNrfNativeTarget(), BuildQorvoTarget(), + BuildStm32Target(), BuildTizenTarget(), BuildTelinkTarget(), BuildOpenIotSdkTargets(), diff --git a/scripts/build/builders/stm32.py b/scripts/build/builders/stm32.py new file mode 100644 index 00000000000000..1613ecbbe42f39 --- /dev/null +++ b/scripts/build/builders/stm32.py @@ -0,0 +1,93 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from enum import Enum, auto + +from .gn import GnBuilder + + +class stm32App(Enum): + LIGHT = auto() + + def ExampleName(self): + if self == stm32App.LIGHT: + return 'lighting-app' + else: + raise Exception('Unknown app type: %r' % self) + + def AppNamePrefix(self): + if self == stm32App.LIGHT: + return 'chip-stm32-lighting-example' + else: + raise Exception('Unknown app type: %r' % self) + + def FlashBundleName(self): + if self == stm32App.LIGHT: + return 'lighting_app.out.flashbundle.txt' + else: + raise Exception('Unknown app type: %r' % self) + + def BuildRoot(self, root): + return os.path.join(root, 'examples', self.ExampleName(), 'stm32') + + +class stm32Board(Enum): + STM32WB55XX = auto() + + def GetIC(self): + if self == stm32Board.STM32WB55XX: + return 'STM32WB5MM-DK' + else: + raise Exception('Unknown board #: %r' % self) + + +class stm32Builder(GnBuilder): + + def __init__(self, + root, + runner, + app: stm32App = stm32App.LIGHT, + board: stm32Board = stm32Board.STM32WB55XX): + super(stm32Builder, self).__init__( + root=app.BuildRoot(root), + runner=runner) + + self.board = board + self.app = app + + stm32_chip = self.board.GetIC() + self.extra_gn_options = ['stm32_ic_family="%s"' % stm32_chip] + + self.extra_gn_options.append('chip_config_network_layer_ble=true') + self.extra_gn_options.append('treat_warnings_as_errors=false') + + def GnBuildArgs(self): + + return self.extra_gn_options + + def build_outputs(self): + items = {} + for extension in ["out", "out.map", "out.hex"]: + name = '%s.%s' % (self.app.AppNamePrefix(), extension) + items[name] = os.path.join(self.output_dir, name) + + # Figure out flash bundle files and build accordingly + with open(os.path.join(self.output_dir, self.app.FlashBundleName())) as f: + for line in f.readlines(): + name = line.strip() + items['flashbundle/%s' % + name] = os.path.join(self.output_dir, name) + + return items diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 8311994a7c28b3..44ca9c3fe2480d 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -20,6 +20,7 @@ mw320-all-clusters-app nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc] nrf-native-posix-64-tests qpg-qpg6105-{lock,light,shell,persistent-storage} +stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan] telink-tlsr9518adk80d-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] openiotsdk-{shell,lock}[-mbedtls][-psa] diff --git a/scripts/checkout_submodules.py b/scripts/checkout_submodules.py index 22ac0fa754bbe9..22750fd40a8bff 100755 --- a/scripts/checkout_submodules.py +++ b/scripts/checkout_submodules.py @@ -41,6 +41,7 @@ 'mbed', 'nrfconnect', 'qpg', + 'stm32', 'telink', 'tizen', 'webos', diff --git a/scripts/examples/gn_stm32_example.sh b/scripts/examples/gn_stm32_example.sh new file mode 100755 index 00000000000000..62c19cc3470de6 --- /dev/null +++ b/scripts/examples/gn_stm32_example.sh @@ -0,0 +1,198 @@ +#!/usr/bin/env bash + +# +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Build script for GN STM32 examples GitHub workflow. + +set -e + +echo_green() { + echo -e "\033[0;32m$*\033[0m" +} + +echo_blue() { + echo -e "\033[1;34m$*\033[0m" +} + +if [[ -z "${MATTER_ROOT}" ]]; then + echo "Using default path for Matter root" + CHIP_ROOT="$(dirname "$0")/../.." +else + echo "Using ENV path for Matter root" + CHIP_ROOT="$MATTER_ROOT" +fi + +source "$CHIP_ROOT/scripts/activate.sh" + +set -x +env +USE_WIFI=false + +#ST_THREAD_TARGET=\""../st:ot-stm32-cert"\" +USAGE="./scripts/examples/gn_stm32_example.sh []" + +if [ "$#" == "0" ]; then + echo "Build script for stm32 Matter apps + Format: + $USAGE + + + Root Location of the app e.g: examples/lighting-app/stm32/ + + + Desired location for the output files + + + Identifier of the board for which this app is built + Currently Supported : + STM32WB5MM-DK + + - optional noteworthy build options for stm32 + chip_build_libshell + Enable libshell support. (Default false) + chip_logging + Current value (Default true) + chip_openthread_ftd + Use openthread Full Thread Device, else, use Minimal Thread Device. (Default true) + stm32_sdk_root + Location for an alternate or modified stm32 SDK + enable_heap_monitoring + Monitor & log memory usage at runtime. (Default false) + enable_openthread_cli + Enables openthread cli without matter shell. (Default true) + kvs_max_entries + Set the maxium Kvs entries that can be store in NVM (Default 75) + Thresholds: 30 <= kvs_max_entries <= 255 + show_qr_code + Enables QR code on LCD for devices with an LCD + setupDiscriminator + Discriminatoor value used for BLE connexion. (Default 3840) + setupPinCode + PIN code for PASE session establishment. (Default 20202021) + enable_sleepy_device + Enable Sleepy end device. (Default false) + Must also set chip_openthread_ftd=false + use_mxchip + Build wifi example with MXCHIP extension board. (Default false) + 'import("//with_pw_rpc.gni")' + Use to build the example with pigweed RPC + OTA_periodic_query_timeout + Periodic query timeout variable for OTA in seconds + wifi_wpa3_only + Support for WPA3 only mode + Presets + --sed + enable sleepy end device, set thread mtd + For minimum consumption, disable openthread cli and qr code + --wifi + build wifi example variant for given extension board + --additional_data_advertising + enable Addition data advertissing and rotating device ID + --use_ot_lib + use the STMicroelectronics openthread library + " +elif [ "$#" -lt "2" ]; then + echo "Invalid number of arguments + Format: + $USAGE" +else + ROOT=$1 + OUTDIR=$2 + + if [ "$#" -gt "2" ]; then + STM32_BOARD=$3 + shift + fi + + shift + shift + while [ $# -gt 0 ]; do + case $1 in + --wifi) + if [ -z "$2" ]; then + echo "--wifi requires mxchip" + exit 1 + fi + if [ "$2" = "mxchip" ]; then + optArgs+="use_mxchip=true" + else + echo "Wifi usage: --wifi mxchip" + exit 1 + fi + USE_WIFI=true + shift + shift + ;; + --sed) + optArgs+="enable_sleepy_device=true chip_openthread_ftd=false " + shift + ;; + --chip_enable_wifi_ipv4) + optArgs+="chip_enable_wifi_ipv4=true " + shift + ;; + --additional_data_advertising) + optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " + shift + ;; + --use_ot_lib) + optArgs+="use_st_thread_lib=true chip_openthread_target=$ST_THREAD_TARGET openthread_external_platform=\"""\" " + shift + ;; + --use_ot_coap_lib) + optArgs+="use_st_thread_lib=true chip_openthread_target=$ST_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " + shift + ;; + *) + if [ "$1" =~ *"use_mxchip=true"* ]; then + USE_WIFI=true + fi + + optArgs+=$1" " + shift + ;; + esac + done + + if [ -z "$STM32_BOARD" ]; then + echo "STM32_BOARD not defined" + exit 1 + fi + + BUILD_DIR=$OUTDIR/$STM32_BOARD + echo BUILD_DIR="$BUILD_DIR" + if [ "$USE_WIFI" == true ]; then + gn gen --check --fail-on-unused-args --export-compile-commands --root="$ROOT" --dotfile="$ROOT"/build_for_wifi_gnfile.gn --args="stm32_board=\"$STM32_BOARD\" $optArgs" "$BUILD_DIR" + else + # thread build + # + if [ -z "$optArgs" ]; then + gn gen --check --fail-on-unused-args --export-compile-commands --root="$ROOT" --args="stm32_board=\"$STM32_BOARD\" treat_warnings_as_errors=false" --ide=json "$BUILD_DIR" + else + gn gen --check --fail-on-unused-args --export-compile-commands --root="$ROOT" --args="stm32_board=\"$STM32_BOARD\" $optArgs treat_warnings_as_errors=false" --ide=json "$BUILD_DIR" + fi + fi + ninja -v -C "$BUILD_DIR"/ + + #print stats + arm-none-eabi-size "$BUILD_DIR"/*.elf + + arm-none-eabi-objcopy -O binary "$BUILD_DIR"/*.elf """$BUILD_DIR/*.elf.bin" + + set +x + echo_green "Finished building target: ""$BUILD_DIR/*.elf" +fi diff --git a/scripts/flashing/stm32_firmware_utils.py b/scripts/flashing/stm32_firmware_utils.py new file mode 100644 index 00000000000000..2109f0347d144a --- /dev/null +++ b/scripts/flashing/stm32_firmware_utils.py @@ -0,0 +1,124 @@ +#!/usr/bin/env python3 +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import sys + +import firmware_utils + +STM32_OPTIONS = { + 'configuration': { + 'stm32cubeprogrammer': { + 'help': 'Path to the STM32CubeProgrammer executable', + 'default': 'STM32_Programmer_CLI', + 'argparse': { + 'metavar': 'FILE' + }, + 'verify': ['{stm32cubeprogrammer}', '-v'], + 'error': + """\ + Unable to execute STM32CubeProgrammer. + + Please ensure that this tool is installed and + available. See the STM32 example README for + installation instructions. + + """, + }, + 'device': { + 'help': 'Device family or platform to target', + 'default': 'STM32', + 'alias': ['-d'], + 'argparse': { + 'metavar': 'DEVICE' + }, + }, + 'port': { + 'help': 'Serial port of the device to flash', + 'default': None, + 'alias': ['-p'], + 'argparse': { + 'metavar': 'PORT' + }, + }, + }, +} + + +class Flasher(firmware_utils.Flasher): + """Manage STM32 flashing.""" + + def __init__(self, **options): + super().__init__(platform='STM32', module=__name__, **options) + self.define_options(STM32_OPTIONS) + + def erase(self): + """Erase the device.""" + return self.run_tool( + 'stm32cubeprogrammer', + ['--connect', 'port={port}', '-c', 'port=SWD', '--erase', 'all'], + name='Erase device') + + def verify(self, image): + """Verify image.""" + return self.run_tool( + 'stm32cubeprogrammer', + ['--connect', 'port={port}', '-c', 'port=SWD', '--verify', image], + name='Verify', + pass_message='Verified', + fail_message='Not verified', + fail_level=2) + + def flash(self, image): + """Flash image.""" + return self.run_tool( + 'stm32cubeprogrammer', + ['--connect', 'port={port}', '-c', 'port=SWD', '--write', image, '--format', 'bin', '--start-address', + '0x8000000'], + name='Flash') + + def reset(self): + """Reset the device.""" + return self.run_tool( + 'stm32cubeprogrammer', + ['--connect', 'port={port}', '-c', 'port=SWD', '--rst'], + name='Reset') + + def actions(self): + """Perform actions on the device according to self.option.""" + self.log(3, 'Options:', self.option) + + if self.option.erase: + if self.erase().err: + return self + + if self.option.application: + application = self.option.application + if self.flash(application).err: + return self + if self.option.verify_application: + if self.verify(application).err: + return self + if self.option.reset is None: + self.option.reset = True + + if self.option.reset: + if self.reset().err: + return self + + return self + + +if __name__ == '__main__': + sys.exit(Flasher().flash_command(sys.argv)) diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index d0706b47ec91cd..5c1f079cef3cf9 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -316,6 +316,11 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { "CHIP_DEVICE_LAYER_TARGET_ASR=1", "CHIP_DEVICE_LAYER_TARGET=ASR", ] + } else if (chip_device_platform == "stm32") { + defines += [ + "CHIP_DEVICE_LAYER_TARGET_STM32=1", + "CHIP_DEVICE_LAYER_TARGET=stm32", + ] } if (chip_device_config_device_software_version != "") { @@ -517,6 +522,8 @@ if (chip_device_platform != "none") { _platform_target = "openiotsdk" } else if (chip_device_platform == "asr") { _platform_target = "ASR" + } else if (chip_device_platform == "stm32") { + _platform_target = "stm32" } else { assert(false, "Unknown chip_device_platform: ${chip_device_platform}") } diff --git a/src/platform/device.gni b/src/platform/device.gni index b70b576644318e..bf243f26524839 100644 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -52,7 +52,7 @@ declare_args() { chip_device_platform == "cc13x2_26x2" || chip_device_platform == "cc13x4_26x4" || chip_device_platform == "k32w0" || chip_device_platform == "tizen" || - chip_device_platform == "webos" + chip_device_platform == "webos" || chip_device_platform == "stm32" } declare_args() { @@ -181,6 +181,8 @@ if (chip_device_platform == "cc13x2_26x2") { _chip_device_layer = "openiotsdk" } else if (chip_device_platform == "asr") { _chip_device_layer = "ASR" +} else if (chip_device_platform == "stm32") { + _chip_device_layer = "stm32" } if (chip_device_platform != "external") { @@ -250,5 +252,6 @@ assert( chip_device_platform == "bl602" || chip_device_platform == "bl702" || chip_device_platform == "bl702l" || chip_device_platform == "mt793x" || chip_device_platform == "SiWx917" || - chip_device_platform == "openiotsdk" || chip_device_platform == "asr", + chip_device_platform == "openiotsdk" || chip_device_platform == "asr" || + chip_device_platform == "stm32", "Please select a valid value for chip_device_platform") diff --git a/src/platform/stm32/BLEManagerImpl.cpp b/src/platform/stm32/BLEManagerImpl.cpp new file mode 100644 index 00000000000000..1cffd11b783487 --- /dev/null +++ b/src/platform/stm32/BLEManagerImpl.cpp @@ -0,0 +1,743 @@ +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the BLEManager singleton object + * for the stm32wb55 platforms. + */ + +/* this file behaves like a config.h, comes first */ +#include + +#include +#include +#include + +#include +#include + +/**** STM32 api files for ble and led support ****/ +#include "app_ble.h" +#include "app_matter.h" +#include "ble_gap_aci.h" +#include "cmsis_os.h" + +using namespace ::chip; +using namespace ::chip::Ble; +using namespace ::chip::System; + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +namespace { + +// Advertising data content definitions +#define CHIP_ADV_DATA_TYPE_FLAGS 0x01 +#define CHIP_ADV_DATA_TYPE_UUID 0x03 +#define CHIP_ADV_DATA_FLAGS 0x06 +#define CHIP_ADV_DATA_TYPE_NAME 0x09 +#define CHIP_ADV_DATA_TYPE_SERVICE_DATA 0x16 +#define STM32_MTU 247 +#define CHIP_ADV_SHORT_UUID_LEN 2 +#define CONNECTION_CLOSE 0x13 + +// FreeeRTOS sw timer +TimerHandle_t sbleAdvTimeoutTimer; + +// Full service UUID - CHIP_BLE_SVC_ID - taken from BleUUID.h header +const uint8_t chipUUID_CHIPoBLE_Service[CHIP_ADV_SHORT_UUID_LEN] = { 0xFF, 0xF6 }; + +const ChipBleUUID chipUUID_CHIPoBLEChar_RX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, + 0x9D, 0x11 } }; + +const ChipBleUUID chipUUID_CHIPoBLEChar_TX = { { 0x18, 0xEE, 0x2E, 0xF5, 0x26, 0x3D, 0x45, 0x59, 0x95, 0x9F, 0x4F, 0x9C, 0x42, 0x9F, + 0x9D, 0x12 } }; + +} // unnamed namespace + +BLEManagerImpl BLEManagerImpl::sInstance; +uint16_t gconnid = 0; + +CHIP_ERROR BLEManagerImpl::_Init() +{ + CHIP_ERROR err; + + mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled; + mFlags.ClearAll().Set(Flags::kAdvertisingEnabled, CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART); + mFlags.Set(Flags::kFastAdvertisingEnabled); + mNumGAPCons = 0; + + for (int i = 0; i < kMaxConnections; i++) + { + mSubscribedConIds[i] = BLE_CONNECTION_UNINITIALIZED; + } + + // Initialize the CHIP BleLayer. + err = BleLayer::Init(this, this, &DeviceLayer::SystemLayer()); + SuccessOrExit(err); + + // Create FreeRTOS sw timer for BLE timeouts and interval change. + sbleAdvTimeoutTimer = xTimerCreate("BleAdvTimer", // Just a text name, not used by the RTOS kernel + pdMS_TO_TICKS(1), // == default timer period (mS) + false, // no timer reload (==one-shot) + (void *) this, // init timer id = ble obj context + BleAdvTimeoutHandler // timer callback handler + ); + VerifyOrExit(sbleAdvTimeoutTimer != NULL, err = CHIP_ERROR_INCORRECT_STATE); + + PlatformMgr().ScheduleWork(DriveBLEState, 0); + + APP_MATTER_BLE_Set_Receive_Callback(HandleRXCharWrite); + APP_MATTER_BLE_Set_Connection_Callback(HandleGAPConnect); + APP_MATTER_BLE_Set_Disconnection_Callback(HandleGAPDisconnect); + APP_MATTER_BLE_Set_TXCharCCCDWrite_Callback(HandleTXCharCCCDWrite); + APP_MATTER_BLE_Set_Ack_After_Indicate_Callback(HandleAck); + +exit: + ChipLogProgress(DeviceLayer, "BLEManagerImpl::Init() complete"); + + return err; +} + +CHIP_ERROR BLEManagerImpl::_SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + VerifyOrExit(val != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); + + if (val != mServiceMode) + { + mServiceMode = val; + PlatformMgr().ScheduleWork(DriveBLEState, 0); + } + +exit: + return err; +} + +CHIP_ERROR BLEManagerImpl::_SetAdvertisingEnabled(bool val) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); + ChipLogDetail(DeviceLayer, "CHIPoBLE advertising set to %s", val ? "on" : "off"); + if (mFlags.Has(Flags::kAdvertisingEnabled) != val) + { + mFlags.Set(Flags::kAdvertisingEnabled, val); + PlatformMgr().ScheduleWork(DriveBLEState, 0); + } + +exit: + return err; +} + +CHIP_ERROR BLEManagerImpl::_SetAdvertisingMode(BLEAdvertisingMode mode) +{ + switch (mode) + { + case BLEAdvertisingMode::kFastAdvertising: + mFlags.Set(Flags::kFastAdvertisingEnabled); + break; + case BLEAdvertisingMode::kSlowAdvertising: + mFlags.Clear(Flags::kFastAdvertisingEnabled); + break; + default: + return CHIP_ERROR_INVALID_ARGUMENT; + } + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + PlatformMgr().ScheduleWork(DriveBLEState, 0); + return CHIP_NO_ERROR; +} + +CHIP_ERROR BLEManagerImpl::_GetDeviceName(char * buf, size_t bufSize) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + return err; +} + +CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * devName) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); + + if (devName != nullptr && devName[0] != 0) + { + // TODO set device name + SuccessOrExit(err); + + mFlags.Set(Flags::kDeviceNameSet); + } + +exit: + return err; +} + +void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) +{ + switch (event->Type) + { + // Platform specific events + case DeviceEventType::kCHIPoBLESubscribe: { + ChipDeviceEvent connEstEvent; + HandleSubscribeReceived(event->CHIPoBLESubscribe.ConId, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); + connEstEvent.Type = DeviceEventType::kCHIPoBLEConnectionEstablished; + PlatformMgr().PostEventOrDie(&connEstEvent); + } + break; + + case DeviceEventType::kCHIPoBLEUnsubscribe: { + HandleUnsubscribeReceived(event->CHIPoBLEUnsubscribe.ConId, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); + } + break; + + case DeviceEventType::kCHIPoBLEWriteReceived: { + HandleWriteReceived(event->CHIPoBLEWriteReceived.ConId, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_RX, + PacketBufferHandle::Adopt(event->CHIPoBLEWriteReceived.Data)); + } + break; + + case DeviceEventType::kCHIPoBLEConnectionError: { + HandleConnectionError(event->CHIPoBLEConnectionError.ConId, event->CHIPoBLEConnectionError.Reason); + } + break; + + // Generic CHIP events + case DeviceEventType::kServiceProvisioningChange: + // Force the advertising state to be refreshed to reflect new provisioning state. + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + + PlatformMgr().ScheduleWork(DriveBLEState, 0); + + break; + + case DeviceEventType::kCHIPoBLEIndicateConfirm: { + HandleIndicationConfirmation(event->CHIPoBLEIndicateConfirm.ConId, &CHIP_BLE_SVC_ID, &chipUUID_CHIPoBLEChar_TX); + } + break; + + default: + break; + } +} + +bool BLEManagerImpl::SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::SubscribeCharacteristic() not supported"); + return false; +} + +bool BLEManagerImpl::UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::UnsubscribeCharacteristic() not supported"); + return false; +} + +bool BLEManagerImpl::CloseConnection(BLE_CONNECTION_OBJECT conId) +{ + CHIP_ERROR err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; + + ChipLogProgress(DeviceLayer, "Closing BLE GATT connection con %u", *(uint16_t *) conId); + // aci_gap_terminate(gconnid, CONNECTION_CLOSE); + return (err == CHIP_NO_ERROR); +} + +uint16_t BLEManagerImpl::GetMTU(BLE_CONNECTION_OBJECT conId) const +{ + uint16_t retVal = 0; + // TODO get MTU from stm32 api + retVal = STM32_MTU; + return retVal; +} + +bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle data) +{ + uint16_t dataLen = data->DataLength(); + + ChipLogDetail(DeviceLayer, "Sending notification for CHIPoBLE Client TX (con %u, len %u)", *(uint16_t *) conId, dataLen); + + APP_MATTER_Send_Notification(dataLen, data->Start()); + + return true; +} + +bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendWriteRequest() not supported"); + return false; +} + +bool BLEManagerImpl::SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadRequest() not supported"); + return false; +} + +bool BLEManagerImpl::SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQUEST_CONTEXT requestContext, + const ChipBleUUID * svcId, const ChipBleUUID * charId) +{ + ChipLogProgress(DeviceLayer, "BLEManagerImpl::SendReadResponse() not supported"); + return false; +} + +void BLEManagerImpl::NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT conId) +{ + CloseConnection(conId); +} + +void BLEManagerImpl::DriveBLEState(void) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Perform any initialization actions that must occur after the CHIP task is running. + if (!mFlags.Has(Flags::kAsyncInitCompleted)) + { + mFlags.Set(Flags::kAsyncInitCompleted); + ChipLogProgress(DeviceLayer, "kAsyncInitCompleted done"); + // If CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED is enabled, + // disable CHIPoBLE advertising if the device is fully provisioned. +#if CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED + if (ConfigurationMgr().IsFullyProvisioned()) + { + mFlags.Clear(Flags::kAdvertisingEnabled); + ChipLogProgress(DeviceLayer, "CHIPoBLE advertising disabled because device is fully provisioned"); + } +#endif // CHIP_DEVICE_CONFIG_CHIPOBLE_DISABLE_ADVERTISING_WHEN_PROVISIONED + } + + // If the application has enabled CHIPoBLE and BLE advertising... + if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_Enabled && + mFlags.Has(Flags::kAdvertisingEnabled) +#if CHIP_DEVICE_CONFIG_CHIPOBLE_SINGLE_CONNECTION + // and no connections are active... + && (mNumGAPCons == 0) +#endif + ) + { + // Start/re-start BLE advertising if not already advertising, or if the + // advertising state of the underlying stack needs to be refreshed. + if (!mFlags.Has(Flags::kAdvertising) || mFlags.Has(Flags::kAdvertisingRefreshNeeded)) + { + mFlags.Clear(Flags::kAdvertisingRefreshNeeded); + err = StartAdvertising(); + SuccessOrExit(err); + } + } + + // Otherwise, stop advertising if currently active. + else if (mFlags.Has(Flags::kAdvertising)) + { + err = StopAdvertising(); + SuccessOrExit(err); + } + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Disabling CHIPoBLE service due to error: %s", ErrorStr(err)); + mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Disabled; + } +} + +CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) +{ + ChipBLEDeviceIdentificationInfo mDeviceIdInfo; + CHIP_ERROR err; + uint8_t index = 0; + uint8_t deviceNameLength = 0; + uint8_t deviceIdInfoLength = 0; + int ret = 0; + + char deviceName[kMaxDeviceNameLength + 1]; + uint8_t advDataBuf[kMaxAdvertisementDataSetSize]; + uint8_t scanRespDataBuf[kMaxAdvertisementDataSetSize]; + + memset(advDataBuf, 0, kMaxAdvertisementDataSetSize); + memset(scanRespDataBuf, 0, kMaxAdvertisementDataSetSize); + + err = ConfigurationMgr().GetBLEDeviceIdentificationInfo(mDeviceIdInfo); + SuccessOrExit(err); + + if (!mFlags.Has(Flags::kDeviceNameSet)) + { + snprintf(deviceName, sizeof(deviceName), "%s%04" PRIX32, CHIP_DEVICE_CONFIG_BLE_DEVICE_NAME_PREFIX, (uint32_t) 0); + deviceName[kMaxDeviceNameLength] = 0; + SuccessOrExit(err); + } + + deviceNameLength = static_cast(strlen(deviceName)); + deviceIdInfoLength = sizeof(mDeviceIdInfo); + + // Check sizes + static_assert(sizeof(mDeviceIdInfo) + CHIP_ADV_SHORT_UUID_LEN + 1 <= UINT8_MAX, "Our length won't fit in a uint8_t"); + static_assert(2 + CHIP_ADV_SHORT_UUID_LEN + sizeof(mDeviceIdInfo) + 1 <= kMaxAdvertisementDataSetSize, + "Advertisement data buffer is not big enough"); + + // Fill in advertising data + index = 0; + advDataBuf[index++] = 0x02; // length + advDataBuf[index++] = CHIP_ADV_DATA_TYPE_FLAGS; // AD type : flags + advDataBuf[index++] = CHIP_ADV_DATA_FLAGS; // AD value + + advDataBuf[index++] = static_cast(deviceIdInfoLength + CHIP_ADV_SHORT_UUID_LEN + 1); // AD length + advDataBuf[index++] = CHIP_ADV_DATA_TYPE_SERVICE_DATA; // AD type : Service Data + advDataBuf[index++] = chipUUID_CHIPoBLE_Service[1]; // AD value + advDataBuf[index++] = chipUUID_CHIPoBLE_Service[0]; + memcpy(&advDataBuf[index], (void *) &mDeviceIdInfo, deviceIdInfoLength); // AD value + + index = static_cast(index + deviceIdInfoLength); + + ChipLogError(DeviceLayer, "state return update adv: %d", ret); + // Fill in scan response data + index = 0; + scanRespDataBuf[index++] = CHIP_ADV_SHORT_UUID_LEN + 1; // AD length + scanRespDataBuf[index++] = CHIP_ADV_DATA_TYPE_UUID; // AD type : uuid + scanRespDataBuf[index++] = chipUUID_CHIPoBLE_Service[1]; // AD value + scanRespDataBuf[index++] = chipUUID_CHIPoBLE_Service[0]; + + VerifyOrExit(index + (deviceNameLength + 2) <= kMaxAdvertisementDataSetSize, err = CHIP_ERROR_BUFFER_TOO_SMALL); + + scanRespDataBuf[index++] = static_cast(deviceNameLength + 1); // length + scanRespDataBuf[index++] = CHIP_ADV_DATA_TYPE_NAME; // AD type : name + memcpy(&scanRespDataBuf[index], deviceName, deviceNameLength); // AD value + index = static_cast(index + deviceNameLength); + +exit: + return err; +} + +CHIP_ERROR BLEManagerImpl::StartAdvertising(void) +{ + CHIP_ERROR err; + + // If already advertising, stop it, before changing values + if (mFlags.Has(Flags::kAdvertising)) + { + APP_BLE_Adv_Cancel(); // ST ble api + } + else + { + ChipLogProgress(DeviceLayer, "CHIPoBLE start advertising"); + } + + err = ConfigureAdvertisingData(); + SuccessOrExit(err); + + mFlags.Clear(Flags::kRestartAdvertising); + + APP_BLE_Adv_Request(APP_BLE_FAST_ADV); + // Flag updated asynchronously by BLE host callback + mFlags.Set(Flags::kAdvertising); + + if (mFlags.Has(Flags::kFastAdvertisingEnabled)) + { + StartBleAdvTimeoutTimer(CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME); + } + +exit: + return err; +} + +CHIP_ERROR BLEManagerImpl::StopAdvertising(void) +{ + CHIP_ERROR err; + + APP_BLE_Adv_Cancel(); // ST ble api + CancelBleAdvTimeoutTimer(); + // Transition to the not Advertising state... + if (mFlags.Has(Flags::kAdvertising)) + { + mFlags.Clear(Flags::kAdvertising); + mFlags.Set(Flags::kFastAdvertisingEnabled); + + ChipLogProgress(DeviceLayer, "CHIPoBLE advertising stopped"); + + // Post a CHIPoBLEAdvertisingChange(Stopped) event. + ChipDeviceEvent advChange; + advChange.Type = DeviceEventType::kCHIPoBLEAdvertisingChange; + advChange.CHIPoBLEAdvertisingChange.Result = kActivity_Stopped; + err = PlatformMgr().PostEvent(&advChange); + } + + return err; +} + +uint16_t BLEManagerImpl::_NumConnections(void) +{ + uint16_t numCons = 0; + for (uint16_t i = 0; i < kMaxConnections; i++) + { + if (mSubscribedConIds[i] != BLE_CONNECTION_UNINITIALIZED) + { + numCons++; + } + } + return numCons; +} + +void BLEManagerImpl::DriveBLEState(intptr_t arg) +{ + sInstance.DriveBLEState(); +} + +void BLEManagerImpl::bleConnect(void) +{ + CHIP_ERROR err; + ChipLogProgress(DeviceLayer, "BLE GATT connection established "); + + mNumGAPCons++; + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + ChipDeviceEvent connectEvent; + connectEvent.Type = DeviceEventType::kCHIPoBLEConnectionEstablished; + err = PlatformMgr().PostEvent(&connectEvent); + PlatformMgr().ScheduleWork(DriveBLEState, 0); +} + +void BLEManagerImpl::bleDisconnect(uint16_t connid) +{ + CHIP_ERROR err; + + ChipLogDetail(DeviceLayer, "BLE GATT connection closed (con %u)", connid); + ; + // Force a refresh of the advertising state. + if (mNumGAPCons > 0) + { + mNumGAPCons--; + } + + // If this was a CHIPoBLE connection, release the associated connection state record + // and post an event to deliver a connection error to the CHIPoBLE layer. + if (!BLEMgrImpl().IsSubscribed(connid)) + { + if (UnsetSubscribed(connid)) + { + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEConnectionError; + event.CHIPoBLEConnectionError.ConId = connid; + PlatformMgr().PostEventOrDie(&event); + ChipLogDetail(DeviceLayer, "BLE unuset subscribed (con %u)", connid); + } + } + + mFlags.Set(Flags::kAdvertisingRefreshNeeded); + ChipDeviceEvent disconnectEvent; + disconnectEvent.Type = DeviceEventType::kCHIPoBLEConnectionClosed; + err = PlatformMgr().PostEvent(&disconnectEvent); + PlatformMgr().ScheduleWork(DriveBLEState, 0); +} + +void BLEManagerImpl::HandleGAPConnect(void) +{ + + ChipLogProgress(DeviceLayer, "Gap connect"); + sInstance.bleConnect(); +} +void BLEManagerImpl::HandleGAPDisconnect(uint16_t * connid) +{ + ChipLogProgress(DeviceLayer, "Gap disconnect"); + sInstance.bleDisconnect(gconnid); +} + +void BLEManagerImpl::HandleRXCharWrite(BLE_Matter_RX * aMessage) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + ChipLogProgress(DeviceLayer, "Write request received for CHIPoBLE Client RX characteristic (con %u, len %u)", aMessage->connid, + aMessage->Length); + // update connid + gconnid = aMessage->connid; + + PacketBufferHandle buf = System::PacketBufferHandle::NewWithData(aMessage->Payload, aMessage->Length, 0, 0); + VerifyOrExit(!buf.IsNull(), err = CHIP_ERROR_NO_MEMORY); + // Post an event to the Chip queue to deliver the data into the Chip stack. + { + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEWriteReceived; + event.CHIPoBLEWriteReceived.ConId = aMessage->connid; + event.CHIPoBLEWriteReceived.Data = std::move(buf).UnsafeRelease(); + err = PlatformMgr().PostEvent(&event); + } +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "HandleRXCharWrite() failed: %s", ErrorStr(err)); + // TODO: fail connection??? + } +} + +void BLEManagerImpl::HandleTXCharCCCDWrite(BLE_Matter_TXCharCCCD * aMessage) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + bool notificationsEnabled; + + ChipLogProgress(DeviceLayer, "Write request received for CHIPoBLE TX characteristic CCCD (con %u, len %u)", aMessage->connid, + 0); + + // Determine if the client is enabling or disabling notifications + notificationsEnabled = (aMessage->notif != 0); + // If the client has requested to enable notifications + if (notificationsEnabled) + { + // Set subcription only the first time + if (!BLEMgrImpl().IsSubscribed(aMessage->connid)) // conid + { + // Record that notifications have been enabled for this connection. + err = BLEMgrImpl().SetSubscribed(aMessage->connid); + VerifyOrExit(err != CHIP_ERROR_NO_MEMORY, err = CHIP_NO_ERROR); + SuccessOrExit(err); + } + } + + else + { + // If notifications had previously been enabled for this connection, record that they are no longer enabled + BLEMgrImpl().UnsetSubscribed(aMessage->connid); + } + + // Post an event to the Chip queue to process either a CHIPoBLE Subscribe or Unsubscribe based on + // whether the client is enabling or disabling notifications + { + ChipDeviceEvent event; + event.Type = (notificationsEnabled) ? DeviceEventType::kCHIPoBLESubscribe : DeviceEventType::kCHIPoBLEUnsubscribe; + event.CHIPoBLESubscribe.ConId = aMessage->connid; + err = PlatformMgr().PostEvent(&event); + } + + ChipLogProgress(DeviceLayer, "CHIPoBLE %s received", notificationsEnabled ? "subscribe" : "unsubscribe"); + +exit: + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "HandleTXCharCCCDWrite() failed: %s", ErrorStr(err)); + // TODO: fail connection??? + } +} + +void BLEManagerImpl::HandleAck(uint16_t * connid) +{ + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm; + event.CHIPoBLEIndicateConfirm.ConId = gconnid; + PlatformMgr().PostEventOrDie(&event); +} + +CHIP_ERROR BLEManagerImpl::SetSubscribed(uint16_t conId) +{ + uint16_t freeIndex = kMaxConnections; + + for (uint16_t i = 0; i < kMaxConnections; i++) + { + if (mSubscribedConIds[i] == conId) + { + return CHIP_NO_ERROR; + } + else if (mSubscribedConIds[i] == BLE_CONNECTION_UNINITIALIZED && i < freeIndex) + { + freeIndex = i; + } + } + + if (freeIndex < kMaxConnections) + { + mSubscribedConIds[freeIndex] = conId; + return CHIP_NO_ERROR; + } + else + { + return CHIP_ERROR_NO_MEMORY; + } +} + +bool BLEManagerImpl::UnsetSubscribed(uint16_t conId) +{ + for (uint16_t i = 0; i < kMaxConnections; i++) + { + if (mSubscribedConIds[i] == conId) + { + mSubscribedConIds[i] = BLE_CONNECTION_UNINITIALIZED; + return true; + } + } + return false; +} + +bool BLEManagerImpl::IsSubscribed(uint16_t conId) +{ + if (conId != BLE_CONNECTION_UNINITIALIZED) + { + for (uint16_t i = 0; i < kMaxConnections; i++) + { + if (mSubscribedConIds[i] == conId) + { + return true; + } + } + } + return false; +} + +void BLEManagerImpl::BleAdvTimeoutHandler(TimerHandle_t xTimer) +{ + if (BLEMgrImpl().mFlags.Has(Flags::kFastAdvertisingEnabled)) + { + /* Stop advertising and defer restart for when stop confirmation is received from the stack */ + ChipLogDetail(DeviceLayer, "bleAdv Timeout : Stop advertissement"); + sInstance.StopAdvertising(); + sInstance.mFlags.Set(Flags::kRestartAdvertising); + } + else if (BLEMgrImpl().mFlags.Has(Flags::kAdvertising)) + { + // Advertisement time expired. Stop advertising + ChipLogDetail(DeviceLayer, "bleAdv Timeout : Stop advertissement"); + BLEMgr().SetAdvertisingEnabled(false); + } +} + +void BLEManagerImpl::CancelBleAdvTimeoutTimer(void) +{ + if (xTimerStop(sbleAdvTimeoutTimer, 0) == pdFAIL) + { + ChipLogError(DeviceLayer, "Failed to stop BledAdv timeout timer"); + } +} + +void BLEManagerImpl::StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs) +{ + if (xTimerIsTimerActive(sbleAdvTimeoutTimer)) + { + CancelBleAdvTimeoutTimer(); + } + + // timer is not active, change its period to required value (== restart). + // FreeRTOS- Block for a maximum of 100 ticks if the change period command + // cannot immediately be sent to the timer command queue. + if (xTimerChangePeriod(sbleAdvTimeoutTimer, pdMS_TO_TICKS(aTimeoutInMs), 100) != pdPASS) + { + ChipLogError(DeviceLayer, "Failed to start BledAdv timeout timer"); + } +} + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/BLEManagerImpl.h b/src/platform/stm32/BLEManagerImpl.h new file mode 100644 index 00000000000000..98812500eac0b0 --- /dev/null +++ b/src/platform/stm32/BLEManagerImpl.h @@ -0,0 +1,191 @@ +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the BLEManager singleton object + * for the stm32 platforms. + */ + +#pragma once + +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + +#include +#include + +#include "FreeRTOS.h" +#include "app_ble.h" +#include "app_matter.h" +#include "timers.h" + +namespace chip { +namespace DeviceLayer { +namespace Internal { +using namespace chip::Ble; + +/** + * Concrete implementation of the BLEManager singleton object for the platform. + */ +class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePlatformDelegate, private BleApplicationDelegate +{ + // Allow the BLEManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend BLEManager; + +private: + // ===== Members that implement the BLEManager internal interface. + + CHIP_ERROR _Init(void); + CHIP_ERROR _Shutdown() { return CHIP_NO_ERROR; } + CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); + CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); + bool _IsAdvertisingEnabled(void); + CHIP_ERROR _SetAdvertisingEnabled(bool val); + bool _IsAdvertising(void); + CHIP_ERROR _SetAdvertisingMode(BLEAdvertisingMode mode); + CHIP_ERROR _GetDeviceName(char * buf, size_t bufSize); + CHIP_ERROR _SetDeviceName(const char * deviceName); + uint16_t _NumConnections(void); + void _OnPlatformEvent(const ChipDeviceEvent * event); + BleLayer * _GetBleLayer(void); + + // ===== Members that implement virtual methods on BlePlatformDelegate. + + bool SubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) override; + bool UnsubscribeCharacteristic(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId) override; + bool CloseConnection(BLE_CONNECTION_OBJECT conId) override; + uint16_t GetMTU(BLE_CONNECTION_OBJECT conId) const override; + bool SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) override; + bool SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) override; + bool SendReadRequest(BLE_CONNECTION_OBJECT conId, const ChipBleUUID * svcId, const ChipBleUUID * charId, + PacketBufferHandle pBuf) override; + bool SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQUEST_CONTEXT requestContext, const ChipBleUUID * svcId, + const ChipBleUUID * charId) override; + + // ===== Members that implement virtual methods on BleApplicationDelegate. + + void NotifyChipConnectionClosed(BLE_CONNECTION_OBJECT conId) override; + + // ===== Members for internal use by the following friends. + + friend BLEManager & BLEMgr(void); + friend BLEManagerImpl & BLEMgrImpl(void); + + static BLEManagerImpl sInstance; + + // ===== Private members reserved for use by this class only. + + enum class Flags : uint16_t + { + kAsyncInitCompleted = 0x0001, /**< One-time asynchronous initialization actions have been performed. */ + kAdvertisingEnabled = 0x0002, /**< The application has enabled CHIPoBLE advertising. */ + kFastAdvertisingEnabled = 0x0004, /**< The application has enabled fast advertising. */ + kAdvertising = 0x0008, /**< The system is currently CHIPoBLE advertising. */ + kAdvertisingRefreshNeeded = 0x0010, /**< The advertising state/configuration state in the BLE layer needs to be updated. */ + kDeviceNameSet = 0x0020, /**< The device name has been set. */ + kRestartAdvertising = 0x0040, /**< The advertising will be restarted when stop advertising confirmation is received and this + flag is set*/ + }; + + enum + { + kMaxConnections = BLE_LAYER_NUM_BLE_ENDPOINTS, + kMaxDeviceNameLength = 20, // TODO: right-size this + kMaxAdvertisementDataSetSize = 31 + }; + + CHIPoBLEServiceMode mServiceMode; + BitFlags mFlags; + uint16_t mNumGAPCons; + uint16_t mSubscribedConIds[kMaxConnections]; + + void DriveBLEState(void); + CHIP_ERROR ConfigureAdvertisingData(void); + CHIP_ERROR StartAdvertising(void); + CHIP_ERROR StopAdvertising(void); + CHIP_ERROR SetSubscribed(uint16_t conId); + bool UnsetSubscribed(uint16_t conId); + bool IsSubscribed(uint16_t conId); + void bleConnect(void); + void bleDisconnect(uint16_t connid); + + CHIP_ERROR MapBLEError(int bleErr) const; + /* Callbacks from BLE stack*/ + static void HandleGAPConnect(void); + static void HandleGAPDisconnect(uint16_t * connid); + static void HandleRXCharWrite(BLE_Matter_RX * aMessage); + static void HandleTXCharCCCDWrite(BLE_Matter_TXCharCCCD * aMessage); + static void HandleAck(uint16_t * connid); + + static void DriveBLEState(intptr_t arg); + + /* Handlers for stack events */ + static void BleAdvTimeoutHandler(TimerHandle_t xTimer); + static void CancelBleAdvTimeoutTimer(void); + static void StartBleAdvTimeoutTimer(uint32_t aTimeoutInMs); +}; + +/** + * Returns a reference to the public interface of the BLEManager singleton object. + * + * Internal components should use this to access features of the BLEManager object + * that are common to all platforms. + */ +inline BLEManager & BLEMgr() +{ + return BLEManagerImpl::sInstance; +} + +/** + * Returns a reference to the public interface of the BLEManager singleton object. + * + * Internal components should use this to access features of the BLEManager object + * that are specific to the stm32 platforms. + */ +inline BLEManagerImpl & BLEMgrImpl(void) +{ + return BLEManagerImpl::sInstance; +} + +inline BleLayer * BLEManagerImpl::_GetBleLayer() +{ + return this; +} + +inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) +{ + return mServiceMode; +} + +inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) +{ + return mFlags.Has(Flags::kAdvertisingEnabled); +} + +inline bool BLEManagerImpl::_IsAdvertising(void) +{ + return mFlags.Has(Flags::kAdvertising); +} + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip + +#endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE diff --git a/src/platform/stm32/BUILD.gn b/src/platform/stm32/BUILD.gn new file mode 100644 index 00000000000000..38290a49e2301d --- /dev/null +++ b/src/platform/stm32/BUILD.gn @@ -0,0 +1,112 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/pigweed.gni") + +import("${chip_root}/src/platform/device.gni") + +import("${chip_root}/build/chip/buildconfig_header.gni") +import("${chip_root}/src/crypto/crypto.gni") + +import("${chip_root}/third_party/st/stm32_board.gni") + +assert(chip_device_platform == "stm32") + +if (chip_crypto == "platform") { + import("//build_overrides/mbedtls.gni") +} +if (chip_enable_openthread) { + import("//build_overrides/openthread.gni") +} + +static_library("stm32") { + if (stm32_board == "STM32WB5MM-DK") { + sources = [ + "../FreeRTOS/SystemTimeSupport.cpp", + "../SingletonConfigurationManager.cpp", + "../logging/impl/stdio/Logging.cpp", + "BLEManagerImpl.cpp", + "BLEManagerImpl.h", + "BlePlatformConfig.h", + "CHIPDevicePlatformConfig.h", + "CHIPDevicePlatformEvent.h", + "CHIPMem-Platform.cpp", + "CHIPPlatformConfig.h", + "ConfigurationManagerImpl.cpp", + "ConfigurationManagerImpl.h", + "DiagnosticDataProviderImpl.cpp", + "DiagnosticDataProviderImpl.h", + "FactoryDataProvider.cpp", + "FactoryDataProvider.h", + "InetPlatformConfig.h", + "KeyValueStoreManagerImpl.cpp", + "KeyValueStoreManagerImpl.h", + "PlatformManagerImpl.cpp", + "PlatformManagerImpl.h", + "STM32Config.cpp", + "STM32Config.h", + "STM32FreeRtosHooks.cpp", + "STM32FreeRtosHooks.h", + "SystemPlatformConfig.h", + ] + } + + deps = [ "${chip_root}/src/setup_payload" ] + public = [ "${chip_root}/src/credentials/DeviceAttestationCredsProvider.h" ] + public_deps = [ + "${chip_root}/src/crypto", + "${chip_root}/src/platform:platform_base", + ] + + if (chip_enable_openthread) { + sources += [ + "../OpenThread/DnssdImpl.cpp", + "../OpenThread/OpenThreadDnssdImpl.cpp", + "../OpenThread/OpenThreadUtils.cpp", + "ConnectivityManagerImpl.cpp", + "ConnectivityManagerImpl.h", + "ThreadStackManagerImpl.cpp", + "ThreadStackManagerImpl.h", + ] + + import("//build_overrides/stm32_sdk.gni") + import("${stm32_sdk_build_root}/stm32_sdk.gni") + public_deps += [ "${stm32_sdk_build_root}:stm32_sdk" ] + + deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] + + public_configs = [ + "${chip_root}/src/lib/address_resolve:default_address_resolve_config", + ] + } + + # Set the compiler flags + cflags = [ + "-Wno-error=unused-parameter", + "-Wno-error=unused-variable", + "-Wno-error=format=", + "-Wno-error=return-type", + ] + + # Add platform crypto implementation + if (chip_crypto == "platform") { + sources += [] + + public_deps += [ + "${chip_root}/src/crypto", + "${mbedtls_root}:mbedtls", + ] + } +} diff --git a/src/platform/stm32/BlePlatformConfig.h b/src/platform/stm32/BlePlatformConfig.h new file mode 100644 index 00000000000000..f75b55d4f85ed8 --- /dev/null +++ b/src/platform/stm32/BlePlatformConfig.h @@ -0,0 +1,38 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Platform-specific configuration overrides for the CHIP BLE + * Layer on stm32wb platforms. + * + */ + +#pragma once + +// ==================== Platform Adaptations ==================== + +#define BLE_CONNECTION_OBJECT uint16_t +#define BLE_CONNECTION_UNINITIALIZED (0xFFFF) +#define BLE_MAX_RECEIVE_WINDOW_SIZE 5 + +#define BLE_CONFIG_ERROR_MIN 6000000 +#define BLE_CONFIG_ERROR_MAX 6000999 + +// ========== Platform-specific Configuration Overrides ========= + +/* none so far */ diff --git a/src/platform/stm32/CHIPDevicePlatformConfig.h b/src/platform/stm32/CHIPDevicePlatformConfig.h new file mode 100644 index 00000000000000..6685bd8464f37b --- /dev/null +++ b/src/platform/stm32/CHIPDevicePlatformConfig.h @@ -0,0 +1,149 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2018 Nest Labs, Inc. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Platform-specific configuration overrides for CHIP on + * the STM32 platform. + */ + +#pragma once + +// ==================== General Platform Adaptations ==================== + +#define CHIP_CONFIG_ABORT() abort() + +#define CHIP_CONFIG_ENABLE_TUNNELING 0 +#define CHIP_CONFIG_MAX_TUNNELS 0 +#define CHIP_CONFIG_ENABLE_SERVICE_DIRECTORY 0 + +#define CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE uint16_t +#define CHIP_CONFIG_PERSISTED_STORAGE_ENC_MSG_CNTR_ID 1 +#define CHIP_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH 2 + +#define CHIP_CONFIG_LIFETIIME_PERSISTED_COUNTER_KEY 0x01 +#define CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER + +#if CHIP_ENABLE_OPENTHREAD +#define CHIP_DEVICE_CONFIG_THREAD_FTD 0 // 0 = MTD +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD 1 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT 1 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_DNS_CLIENT 1 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_COMMISSIONABLE_DISCOVERY 1 +#endif + +// ========== Platform-specific Configuration ========= + +// These are configuration options that are unique to the platform. +// These can be overridden by the application as needed. + +// ... + +// ========== Platform-specific Configuration Overrides ========= + +#define CHIP_DEVICE_CONFIG_CHIP_TASK_NAME "STM32WB TASK" +#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (8 * 1024) + +/** + * CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY + * + * The priority of the chip task. + */ +#define CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY 24 +#define CHIP_DEVICE_CONFIG_THREAD_TASK_STACK_SIZE (4 * 1024) + +/** + * CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY + * + * The priority of the OpenThread task. + */ +#define CHIP_DEVICE_CONFIG_THREAD_TASK_PRIORITY 24 + +#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 25 + +/** + * CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE + * + * Reduce packet buffer pool size to 8 (default 15) to reduce ram consumption + */ +#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8 + +#define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY 0 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY 0 +#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL 0 + +// Per 5.2.5.2. Commencement Section of CHIP spec, BLE advertisement is +// disabled for Locks and Barrier Access Devices. +#define CHIP_DEVICE_CONFIG_CHIPOBLE_ENABLE_ADVERTISING_AUTOSTART 0 +#define CHIP_DEVICE_CONFIG_ENABLE_PAIRING_AUTOSTART 0 + +/** + * CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME + * + * The amount of time in miliseconds after which BLE advertisement should be switched from the fast + * advertising to the slow advertising, counting from the moment of advertisement commencement. + * + * Defaults to 30000 (30 seconds). + */ +#ifndef CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME +#define CHIP_DEVICE_CONFIG_BLE_ADVERTISING_INTERVAL_CHANGE_TIME 30000 +#endif +// ========== Platform-specific Cluster Overrides ========= +#define CHIP_CLUSTER_NETWORK_COMMISSIONING_MAX_NETWORKS 1 + +// EMBER_AF_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT is only defined if the +// cluster is actually enabled in the ZAP config. To allow operation in setups +#define EMBER_AF_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC + * + * Enables synchronizing the device's real time clock with a remote Chip Time service + * using the Chip Time Sync protocol. + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC 0 + +#define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 + +/** + * @def CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL + * + * @brief + * Active retransmit interval, or time to wait before retransmission after + * subsequent failures in milliseconds. + * + * This is the default value, that might be adjusted by end device depending on its + * needs (e.g. sleeping period) using Service Discovery TXT record CRA key. + * + */ +#define CHIP_CONFIG_MRP_LOCAL_ACTIVE_RETRY_INTERVAL (2000_ms32) + +#define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 + +/** + * CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + * + * Enable support for Chip-over-BLE (CHIPoBLE). + */ +#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1 + +#define CHIP_CONFIG_ENABLE_SESSION_RESUMPTION 1 + +#define CHIP_CONFIG_MEMORY_MGMT_PLATFORM 1 +#define CHIP_CONFIG_MEMORY_MGMT_MALLOC 0 diff --git a/src/platform/stm32/CHIPDevicePlatformEvent.h b/src/platform/stm32/CHIPDevicePlatformEvent.h new file mode 100644 index 00000000000000..b77798f92a7d6c --- /dev/null +++ b/src/platform/stm32/CHIPDevicePlatformEvent.h @@ -0,0 +1,76 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace DeviceEventType { +/** + * Enumerates platform-specific event types that are visible to the application. + */ +enum PublicPlatformSpecificEventTypes +{ + /* None currently defined */ +}; + +/** + * Enumerates platform-specific event types that are internal to the chip Device Layer. + */ +enum InternalPlatformSpecificEventTypes +{ + kSTMBLEConnected = kRange_InternalPlatformSpecific, + kSTMBLEDisconnected, + kCHIPoBLECCCWriteEvent, + kCHIPoBLERXCharWriteEvent, + kCHIPoBLETXCharWriteEvent, +}; + +} // namespace DeviceEventType + +/** + * Represents platform-specific event information. + */ +struct ChipDevicePlatformEvent final +{ + // TODO - add platform specific definition extension + union + { + struct + { + uint8_t dummy; + } STMBLEConnected; + struct + { + uint8_t dummy; + } CHIPoBLECCCWriteEvent; + struct + { + uint8_t dummy; + } CHIPoBLERXCharWriteEvent; + struct + { + uint8_t dummy; + } CHIPoBLETXCharWriteEvent; + }; +}; + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/CHIPMem-Platform.cpp b/src/platform/stm32/CHIPMem-Platform.cpp new file mode 100644 index 00000000000000..2e37bafe7cf1b8 --- /dev/null +++ b/src/platform/stm32/CHIPMem-Platform.cpp @@ -0,0 +1,239 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2019 Nest Labs, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements heap memory allocation APIs for CHIP. These functions are platform + * specific and might be C Standard Library heap functions re-direction in most of cases. + * + */ + +#include +#include + +#include "cmsis_os.h" +#include "mbedtls/platform.h" +#include "task.h" + +#include +#include +#include +#include + +#if CHIP_CONFIG_MEMORY_MGMT_PLATFORM + +extern "C" void memMonitoringTrackAlloc(void * ptr, size_t size); +extern "C" void memMonitoringTrackFree(void * ptr, size_t size); + +#ifndef trackAlloc +#define trackAlloc(pvAddress, uiSize) memMonitoringTrackAlloc(pvAddress, uiSize) +#endif +#ifndef trackFree +#define trackFree(pvAddress, uiSize) memMonitoringTrackFree(pvAddress, uiSize) +#endif + +#define USE_FREERTOS + +using namespace std; + +// Define the new operator for C++ to use the freeRTOS memory management +// functions. +// +void * operator new(size_t size) +{ + void * p; +#ifdef USE_FREERTOS + if (uxTaskGetNumberOfTasks()) + p = pvPortMalloc(size); + else + p = malloc(size); + +#else + p = malloc(size); + +#endif +#ifdef __EXCEPTIONS + if (p == 0) // did pvPortMalloc succeed? + throw std::bad_alloc(); // ANSI/ISO compliant behavior +#endif + return p; +} + +// +// Define the delete operator for C++ to use the freeRTOS memory +// functions. +// +void operator delete(void * p) +{ +#ifdef USE_FREERTOS + if (uxTaskGetNumberOfTasks()) + vPortFree(p); + else + free(p); +#else + free(p); +#endif + p = NULL; +} + +void * operator new[](size_t size) +{ + void * p; +#ifdef USE_FREERTOS + if (uxTaskGetNumberOfTasks()) + p = pvPortMalloc(size); + else + p = malloc(size); + +#else + p = malloc(size); + +#endif +#ifdef __EXCEPTIONS + if (p == 0) // did pvPortMalloc succeed? + throw std::bad_alloc(); // ANSI/ISO compliant behavior +#endif + return p; +} + +// +// Define the delete operator for C++ to use the freeRTOS memory +// functions. THIS IS NOT OPTIONAL! +// +void operator delete[](void * p) +{ +#ifdef USE_FREERTOS + if (uxTaskGetNumberOfTasks()) + vPortFree(p); + else + free(p); +#else + free(p); +#endif + p = NULL; +} + +namespace chip { +namespace Platform { + +#define VERIFY_INITIALIZED() VerifyInitialized(__func__) + +static std::atomic_int memoryInitialized{ 0 }; + +static void VerifyInitialized(const char * func) +{ + if (!memoryInitialized) + { + ChipLogError(DeviceLayer, "ABORT: chip::Platform::%s() called before chip::Platform::MemoryInit()\n", func); + abort(); + } +} + +CHIP_ERROR MemoryAllocatorInit(void * buf, size_t bufSize) +{ + if (memoryInitialized++ > 0) + { + ChipLogError(DeviceLayer, "ABORT: chip::Platform::MemoryInit() called twice.\n"); + abort(); + } + + return CHIP_NO_ERROR; +} + +void MemoryAllocatorShutdown() +{ + if (--memoryInitialized < 0) + { + ChipLogError(DeviceLayer, "ABORT: chip::Platform::MemoryShutdown() called twice.\n"); + abort(); + } +} + +void * MemoryAlloc(size_t size) +{ + void * ptr; + VERIFY_INITIALIZED(); + ptr = mbedtls_calloc(1, size); + trackAlloc(ptr, size); + return ptr; +} + +void * MemoryAlloc(size_t size, bool isLongTermAlloc) +{ + void * ptr; + VERIFY_INITIALIZED(); + ptr = mbedtls_calloc(1, size); + trackAlloc(ptr, size); + return ptr; +} + +void * MemoryCalloc(size_t num, size_t size) +{ + VERIFY_INITIALIZED(); + + void * ptr = mbedtls_calloc(1, size); + trackAlloc(ptr, size * num); + return ptr; +} + +void * MemoryRealloc(void * p, size_t size) +{ + VERIFY_INITIALIZED(); + + p = realloc(p, size); + return p; +} + +void MemoryFree(void * p) +{ + VERIFY_INITIALIZED(); + mbedtls_free(p); + trackFree(p, 0); +} + +bool MemoryInternalCheckPointer(const void * p, size_t min_size) +{ + return (p != nullptr); +} + +} // namespace Platform +} // namespace chip + +extern "C" void memMonitoringTrackAlloc(void * ptr, size_t size) {} + +extern "C" void memMonitoringTrackFree(void * ptr, size_t size) {} + +#endif // CHIP_CONFIG_MEMORY_MGMT_PLATFORM diff --git a/src/platform/stm32/CHIPPlatformConfig.h b/src/platform/stm32/CHIPPlatformConfig.h new file mode 100644 index 00000000000000..4db0ba07aa7d9b --- /dev/null +++ b/src/platform/stm32/CHIPPlatformConfig.h @@ -0,0 +1,81 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2018 Nest Labs, Inc. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Platform-specific configuration overrides for CHIP on + * the STM32 platform. + */ + +#pragma once +#include "CHIPDevicePlatformConfig.h" +// ==================== General Configuration Overrides ==================== + +#ifndef CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS +#define CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS 8 +#endif // CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS + +#ifndef CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS +#define CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS 8 +#endif // CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS + +#ifndef CHIP_CONFIG_WRMP_TIMER_DEFAULT_PERIOD +#define CHIP_CONFIG_WRMP_TIMER_DEFAULT_PERIOD 50 +#endif // CHIP_CONFIG_WRMP_TIMER_DEFAULT_PERIOD + +#ifndef CHIP_LOG_FILTERING +#define CHIP_LOG_FILTERING 0 +#endif // CHIP_LOG_FILTERING + +#ifndef CHIP_CONFIG_MAX_PEER_NODES +#define CHIP_CONFIG_MAX_PEER_NODES 16 +#endif // CHIP_CONFIG_MAX_PEER_NODES + +#ifndef CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS +#define CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS 1 +#endif // CHIP_CONFIG_BDX_MAX_NUM_TRANSFERS + +#ifndef CHIP_CONFIG_MAX_FABRICS +#define CHIP_CONFIG_MAX_FABRICS 5 +#endif // CHIP_CONFIG_MAX_FABRICS + +#ifndef CHIP_CONFIG_MAX_ACTIVE_CHANNELS +#define CHIP_CONFIG_MAX_ACTIVE_CHANNELS 8 +#endif // CHIP_CONFIG_MAX_ACTIVE_CHANNELS + +#ifndef CHIP_CONFIG_MAX_CHANNEL_HANDLES +#define CHIP_CONFIG_MAX_CHANNEL_HANDLES 16 +#endif // CHIP_CONFIG_MAX_CHANNEL_HANDLES + +#ifndef CHIP_CONFIG_RMP_TIMER_DEFAULT_PERIOD_SHIFT +#define CHIP_CONFIG_RMP_TIMER_DEFAULT_PERIOD_SHIFT 6 +#endif // CHIP_CONFIG_RMP_TIMER_DEFAULT_PERIOD_SHIFT +// ==================== Security Configuration Overrides ==================== + +#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE +#define CHIP_CONFIG_FREERTOS_USE_STATIC_QUEUE 1 +#endif + +#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_TASK +#define CHIP_CONFIG_FREERTOS_USE_STATIC_TASK 1 +#endif + +#ifndef CHIP_CONFIG_FREERTOS_USE_STATIC_SEMAPHORE +#define CHIP_CONFIG_FREERTOS_USE_STATIC_SEMAPHORE 1 +#endif diff --git a/src/platform/stm32/ConfigurationManagerImpl.cpp b/src/platform/stm32/ConfigurationManagerImpl.cpp new file mode 100644 index 00000000000000..da8638460a78f3 --- /dev/null +++ b/src/platform/stm32/ConfigurationManagerImpl.cpp @@ -0,0 +1,168 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides the implementation of the Device Layer ConfigurationManager object + * for stm32wb platforms. + */ +/* this file behaves like a config.h, comes first */ +#include + +#include +#include +#include + +#include +#include + +#if CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_FACTORY_PROVISIONING + +#include +#include + +namespace chip { +namespace DeviceLayer { + +using namespace ::chip::DeviceLayer::Internal; + +ConfigurationManagerImpl & ConfigurationManagerImpl::GetDefaultInstance() +{ + static ConfigurationManagerImpl sInstance; + return sInstance; +} + +CHIP_ERROR ConfigurationManagerImpl::Init() +{ + CHIP_ERROR err; + + // Initialize the generic implementation base class. + err = Internal::GenericConfigurationManagerImpl::Init(); + + return err; +} + +bool ConfigurationManagerImpl::CanFactoryReset() +{ + // TODO: query the application to determine if factory reset is allowed. + return true; +} + +void ConfigurationManagerImpl::InitiateFactoryReset() +{ + PlatformMgr().ScheduleWork(DoFactoryReset); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key persistedStorageKey, + uint32_t & value) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ChipLogDetail(DataManagement, "ST => ReadPersistedStorageValue"); + + err = ReadConfigValue(persistedStorageKey, value); + if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) + { + err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; + } + SuccessOrExit(err); + +exit: + return err; +} + +CHIP_ERROR ConfigurationManagerImpl::WritePersistedStorageValue(::chip::Platform::PersistedStorage::Key persistedStorageKey, + uint32_t value) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + ChipLogDetail(DataManagement, "ST => WritePersistedStorageValue"); + err = WriteConfigValue(persistedStorageKey, value); + SuccessOrExit(err); +exit: + return err; +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, bool & val) +{ + return STM32Config::ReadConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, uint32_t & val) +{ + return STM32Config::ReadConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValue(Key key, uint64_t & val) +{ + return STM32Config::ReadConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) +{ + return STM32Config::ReadConfigValueStr(key, buf, bufSize, outLen); +} + +CHIP_ERROR ConfigurationManagerImpl::ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) +{ + return STM32Config::ReadConfigValueBin(key, buf, bufSize, outLen); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, bool val) +{ + return STM32Config::WriteConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, uint32_t val) +{ + return STM32Config::WriteConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValue(Key key, uint64_t val) +{ + return STM32Config::WriteConfigValue(key, val); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueStr(Key key, const char * str) +{ + return STM32Config::WriteConfigValueStr(key, str); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueStr(Key key, const char * str, size_t strLen) +{ + return STM32Config::WriteConfigValueStr(key, str, strLen); +} + +CHIP_ERROR ConfigurationManagerImpl::WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen) +{ + return STM32Config::WriteConfigValueBin(key, data, dataLen); +} + +void ConfigurationManagerImpl::RunConfigUnitTest(void) +{ + STM32Config::RunConfigUnitTest(); +} + +void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) {} + +ConfigurationManager & ConfigurationMgrImpl() +{ + return ConfigurationManagerImpl::GetDefaultInstance(); +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/ConfigurationManagerImpl.h b/src/platform/stm32/ConfigurationManagerImpl.h new file mode 100644 index 00000000000000..78b885581ce151 --- /dev/null +++ b/src/platform/stm32/ConfigurationManagerImpl.h @@ -0,0 +1,89 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the ConfigurationManager object + * for stm32wb platforms. + */ + +#pragma once +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +/** + * Concrete implementation of the ConfigurationManager singleton object for the platform. + */ + +// class ConfigurationManagerImpl final : public Internal::GenericConfigurationManagerImpl, +// public Internal::STM32Config +class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImpl +{ +public: + // This returns an instance of this class. + static ConfigurationManagerImpl & GetDefaultInstance(); + +private: + // ===== Members that implement the ConfigurationManager public interface. + + CHIP_ERROR Init(void) override; + CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) override; + bool CanFactoryReset(void) override; + void InitiateFactoryReset(void) override; + CHIP_ERROR ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t & value) override; + CHIP_ERROR WritePersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t value) override; + + // NOTE: Other public interface methods are implemented by GenericConfigurationManagerImpl<>. + + // ===== Members that implement the GenericConfigurationManagerImpl protected interface. + CHIP_ERROR ReadConfigValue(Key key, bool & val) override; + CHIP_ERROR ReadConfigValue(Key key, uint32_t & val) override; + CHIP_ERROR ReadConfigValue(Key key, uint64_t & val) override; + CHIP_ERROR ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) override; + CHIP_ERROR ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) override; + CHIP_ERROR WriteConfigValue(Key key, bool val) override; + CHIP_ERROR WriteConfigValue(Key key, uint32_t val) override; + CHIP_ERROR WriteConfigValue(Key key, uint64_t val) override; + CHIP_ERROR WriteConfigValueStr(Key key, const char * str) override; + CHIP_ERROR WriteConfigValueStr(Key key, const char * str, size_t strLen) override; + CHIP_ERROR WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen) override; + void RunConfigUnitTest(void) override; + + // ===== Private members reserved for use by this class only. + + static void DoFactoryReset(intptr_t arg); +}; + +inline CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +/** + * Returns the platform-specific implementation of the ConfigurationManager object. + * + * Applications can use this to gain access to features of the ConfigurationManager + * that are specific to the selected platform. + */ +ConfigurationManager & ConfigurationMgrImpl(); + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/ConnectivityManagerImpl.cpp b/src/platform/stm32/ConnectivityManagerImpl.cpp new file mode 100644 index 00000000000000..0a3f507a999532 --- /dev/null +++ b/src/platform/stm32/ConnectivityManagerImpl.cpp @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/* this file behaves like a config.h, comes first */ +#include + +#include + +#if INET_CONFIG_ENABLE_TCP_ENDPOINT +#include +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +#include +#endif + +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::TLV; +using namespace ::chip::DeviceLayer::Internal; + +namespace chip { +namespace DeviceLayer { + +ConnectivityManagerImpl ConnectivityManagerImpl::sInstance; + +CHIP_ERROR ConnectivityManagerImpl::_Init() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Initialize the generic base classes that require it. +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + GenericConnectivityManagerImpl_Thread::_Init(); +#endif + + SuccessOrExit(err); + +exit: + return err; +} + +void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) +{ + // Forward the event to the generic base classes as needed. +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + GenericConnectivityManagerImpl_Thread::_OnPlatformEvent(event); +#endif +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/ConnectivityManagerImpl.h b/src/platform/stm32/ConnectivityManagerImpl.h new file mode 100644 index 00000000000000..f95110bb9c6af6 --- /dev/null +++ b/src/platform/stm32/ConnectivityManagerImpl.h @@ -0,0 +1,109 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#if INET_CONFIG_ENABLE_TCP_ENDPOINT +#include +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include +#else +#include +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +#include +#else +#include +#endif +#include + +namespace chip { +namespace Inet { +class IPAddress; +} // namespace Inet +} // namespace chip + +namespace chip { +namespace DeviceLayer { + +/** + * Concrete implementation of the ConnectivityManager singleton object for stm32 platforms. + */ +class ConnectivityManagerImpl final : public ConnectivityManager, + public Internal::GenericConnectivityManagerImpl, + public Internal::GenericConnectivityManagerImpl_UDP, +#if INET_CONFIG_ENABLE_TCP_ENDPOINT + public Internal::GenericConnectivityManagerImpl_TCP, +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE + public Internal::GenericConnectivityManagerImpl_BLE, +#else + public Internal::GenericConnectivityManagerImpl_NoBLE, +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + public Internal::GenericConnectivityManagerImpl_Thread, +#else + public Internal::GenericConnectivityManagerImpl_NoThread, +#endif + public Internal::GenericConnectivityManagerImpl_NoWiFi +{ + // Allow the ConnectivityManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend class ConnectivityManager; + +private: + // ===== Members that implement the ConnectivityManager abstract interface. + + CHIP_ERROR _Init(void); + void _OnPlatformEvent(const ChipDeviceEvent * event); + + // ===== Members for internal use by the following friends. + + friend ConnectivityManager & ConnectivityMgr(void); + friend ConnectivityManagerImpl & ConnectivityMgrImpl(void); + + static ConnectivityManagerImpl sInstance; +}; + +/** + * Returns the public interface of the ConnectivityManager singleton object. + * + * Chip applications should use this to access features of the ConnectivityManager object + * that are common to all platforms. + */ +inline ConnectivityManager & ConnectivityMgr(void) +{ + return ConnectivityManagerImpl::sInstance; +} + +/** + * Returns the platform-specific implementation of the ConnectivityManager singleton object. + * + * Chip applications can use this to gain access to features of the ConnectivityManager + * that are specific to the stm32 platform. + */ +inline ConnectivityManagerImpl & ConnectivityMgrImpl(void) +{ + return ConnectivityManagerImpl::sInstance; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/DiagnosticDataProviderImpl.cpp b/src/platform/stm32/DiagnosticDataProviderImpl.cpp new file mode 100644 index 00000000000000..0c4a78efbc98d4 --- /dev/null +++ b/src/platform/stm32/DiagnosticDataProviderImpl.cpp @@ -0,0 +1,63 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the DiagnosticDataProvider object + * for stm32 platforms. + */ + +#include + +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +DiagnosticDataProviderImpl & DiagnosticDataProviderImpl::GetDefaultInstance() +{ + static DiagnosticDataProviderImpl sInstance; + return sInstance; +} + +CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapFree(uint64_t & currentHeapFree) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeapUsed) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +DiagnosticDataProvider & GetDiagnosticDataProviderImpl() +{ + return DiagnosticDataProviderImpl::GetDefaultInstance(); +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/DiagnosticDataProviderImpl.h b/src/platform/stm32/DiagnosticDataProviderImpl.h new file mode 100644 index 00000000000000..85ac3fc206f8ae --- /dev/null +++ b/src/platform/stm32/DiagnosticDataProviderImpl.h @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the DiagnosticDataProvider object. + */ + +#pragma once + +#include + +#include + +namespace chip { +namespace DeviceLayer { + +/** + * Concrete implementation of the PlatformManager singleton object for stm32 platforms. + */ + +class DiagnosticDataProviderImpl : public DiagnosticDataProvider +{ +public: + static DiagnosticDataProviderImpl & GetDefaultInstance(); + + // ===== Methods that implement the PlatformManager abstract interface. + + CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override; + CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override; + CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override; +}; +/** + * Returns the platform-specific implementation of the DiagnosticDataProvider singleton object. + * + * Applications can use this to gain access to features of the DiagnosticDataProvider + * that are specific to the selected platform. + */ +DiagnosticDataProvider & GetDiagnosticDataProviderImpl(); +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/FactoryDataProvider.cpp b/src/platform/stm32/FactoryDataProvider.cpp new file mode 100644 index 00000000000000..06801c32f4076a --- /dev/null +++ b/src/platform/stm32/FactoryDataProvider.cpp @@ -0,0 +1,394 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FactoryDataProvider.h" + +#include +#include +#include +#include +#include + +namespace chip { +namespace { + +} // namespace + +namespace DeviceLayer { + +CHIP_ERROR FactoryDataProvider::Init() +{ + return CHIP_NO_ERROR; +} + +FactoryDataProvider & FactoryDataProvider::GetDefaultInstance() +{ + static FactoryDataProvider sInstance; + return sInstance; +} + +CHIP_ERROR FactoryDataProvider::SetSetupPasscode(uint32_t setupPasscode) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::SetSetupDiscriminator(uint16_t setupDiscriminator) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +// TODO: This should be moved to a method of P256Keypair +CHIP_ERROR LoadKeypairFromRaw(ByteSpan private_key, ByteSpan public_key, Crypto::P256Keypair & keypair) +{ + Crypto::P256SerializedKeypair serialized_keypair; + ReturnErrorOnFailure(serialized_keypair.SetLength(private_key.size() + public_key.size())); + memcpy(serialized_keypair.Bytes(), public_key.data(), public_key.size()); + memcpy(serialized_keypair.Bytes() + public_key.size(), private_key.data(), private_key.size()); + return keypair.Deserialize(serialized_keypair); +} + +CHIP_ERROR FactoryDataProvider::SignWithDeviceAttestationKey(const ByteSpan & messageToSign, MutableByteSpan & outSignBuffer) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + Crypto::P256ECDSASignature signature; + Crypto::P256Keypair keypair; + + const uint8_t kDevelopmentDAC_PublicKey_FFF1_8004[65] = { + 0x04, 0x50, 0x41, 0x38, 0xef, 0x31, 0xc9, 0xdd, 0x16, 0x0e, 0xb4, 0x6c, 0x6c, 0x17, 0x11, 0x4f, 0x9d, + 0x72, 0x88, 0x40, 0x80, 0x1f, 0x73, 0xbb, 0x9b, 0x5a, 0x2c, 0x51, 0x91, 0xc9, 0xb2, 0x06, 0x63, 0x01, + 0x9d, 0x94, 0x76, 0xd1, 0x93, 0x1b, 0x93, 0xff, 0x47, 0xf4, 0x32, 0x56, 0x37, 0x90, 0x35, 0xd2, 0x29, + 0x62, 0x0b, 0x7e, 0x21, 0x0e, 0x59, 0x2f, 0x26, 0x43, 0x7d, 0x2d, 0x57, 0x62, 0x05, + }; + const uint8_t kDevelopmentDAC_PrivateKey_FFF1_8004[32] = { + 0x82, 0x0a, 0x24, 0x2a, 0x03, 0x0e, 0xbc, 0xe1, 0x1f, 0x38, 0x73, 0x5a, 0xcf, 0x1a, 0x6f, 0x37, + 0xc3, 0xad, 0xa6, 0xe4, 0x32, 0xd2, 0x47, 0x0a, 0x8a, 0x41, 0x37, 0x43, 0xf8, 0x95, 0x63, 0xf3, + }; + ByteSpan kDacPrivateKey = ByteSpan(kDevelopmentDAC_PrivateKey_FFF1_8004); + ByteSpan kDacPublicKey = ByteSpan(kDevelopmentDAC_PublicKey_FFF1_8004); + + VerifyOrReturnError(IsSpanUsable(outSignBuffer), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(IsSpanUsable(messageToSign), CHIP_ERROR_INVALID_ARGUMENT); + VerifyOrReturnError(outSignBuffer.size() >= signature.Capacity(), CHIP_ERROR_BUFFER_TOO_SMALL); + + // In a non-exemplary implementation, the public key is not needed here. It is used here merely because + // Crypto::P256Keypair is only (currently) constructable from raw keys if both private/public keys are present. + ReturnErrorOnFailure(LoadKeypairFromRaw(kDacPrivateKey, kDacPublicKey, keypair)); + ReturnErrorOnFailure(keypair.ECDSA_sign_msg(messageToSign.data(), messageToSign.size(), signature)); + + return CopySpanToMutableSpan(ByteSpan{ signature.ConstBytes(), signature.Length() }, outSignBuffer); +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetSetupDiscriminator(uint16_t & setupDiscriminator) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + setupDiscriminator = CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetSpake2pIterationCount(uint32_t & iterationCount) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + constexpr uint32_t kDefaultTestVerifierIterationCount = 1000; + iterationCount = kDefaultTestVerifierIterationCount; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetSetupPasscode(uint32_t & setupPasscode) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + setupPasscode = CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetVendorId(uint16_t & vendorId) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + vendorId = CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetProductId(uint16_t & productId) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + productId = CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetHardwareVersion(uint16_t & hardwareVersion) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + hardwareVersion = CHIP_DEVICE_CONFIG_DEVICE_HARDWARE_VERSION; + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & day) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetPartNumber(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetProductURL(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetProductLabel(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetVendorName(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetProductName(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetSerialNumber(char * buf, size_t bufSize) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + memcpy(buf, CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER, bufSize); + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetHardwareVersionString(char * buf, size_t bufSize) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetSpake2pVerifier(MutableByteSpan & verifierSpan, size_t & verifierLen) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + static const uint8_t kDefaultTestVerifier[97] = { + 0xb9, 0x61, 0x70, 0xaa, 0xe8, 0x03, 0x34, 0x68, 0x84, 0x72, 0x4f, 0xe9, 0xa3, 0xb2, 0x87, 0xc3, 0x03, 0x30, 0xc2, 0xa6, + 0x60, 0x37, 0x5d, 0x17, 0xbb, 0x20, 0x5a, 0x8c, 0xf1, 0xae, 0xcb, 0x35, 0x04, 0x57, 0xf8, 0xab, 0x79, 0xee, 0x25, 0x3a, + 0xb6, 0xa8, 0xe4, 0x6b, 0xb0, 0x9e, 0x54, 0x3a, 0xe4, 0x22, 0x73, 0x6d, 0xe5, 0x01, 0xe3, 0xdb, 0x37, 0xd4, 0x41, 0xfe, + 0x34, 0x49, 0x20, 0xd0, 0x95, 0x48, 0xe4, 0xc1, 0x82, 0x40, 0x63, 0x0c, 0x4f, 0xf4, 0x91, 0x3c, 0x53, 0x51, 0x38, 0x39, + 0xb7, 0xc0, 0x7f, 0xcc, 0x06, 0x27, 0xa1, 0xb8, 0x57, 0x3a, 0x14, 0x9f, 0xcd, 0x1f, 0xa4, 0x66, 0xcf, + }; + + verifierLen = sizeof(kDefaultTestVerifier); + if (verifierSpan.size() < verifierLen) + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + memcpy(verifierSpan.data(), &kDefaultTestVerifier[0], verifierLen); + verifierSpan.reduce_size(verifierLen); + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetCertificationDeclaration(MutableByteSpan & outBufferSpan) +{ + +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + //-> format_version = 1 + //-> vendor_id = 0xFFF1 + //-> product_id_array = [ 0x8000, 0x8001, 0x8002, 0x8003, 0x8004, 0x8005, 0x8006, 0x8007, 0x8008, 0x8009, 0x800A, 0x800B, + // 0x800C, 0x800D, 0x800E, 0x800F, 0x8010, 0x8011, 0x8012, 0x8013, 0x8014, 0x8015, 0x8016, 0x8017, 0x8018, 0x8019, 0x801A, + // 0x801B, 0x801C, 0x801D, 0x801E, 0x801F, 0x8020, 0x8021, 0x8022, 0x8023, 0x8024, 0x8025, 0x8026, 0x8027, 0x8028, 0x8029, + // 0x802A, 0x802B, 0x802C, 0x802D, 0x802E, 0x802F, 0x8030, 0x8031, 0x8032, 0x8033, 0x8034, 0x8035, 0x8036, 0x8037, 0x8038, + // 0x8039, 0x803A, 0x803B, 0x803C, 0x803D, 0x803E, 0x803F, 0x8040, 0x8041, 0x8042, 0x8043, 0x8044, 0x8045, 0x8046, 0x8047, + // 0x8048, 0x8049, 0x804A, 0x804B, 0x804C, 0x804D, 0x804E, 0x804F, 0x8050, 0x8051, 0x8052, 0x8053, 0x8054, 0x8055, 0x8056, + // 0x8057, 0x8058, 0x8059, 0x805A, 0x805B, 0x805C, 0x805D, 0x805E, 0x805F, 0x8060, 0x8061, 0x8062, 0x8063 ] + //-> device_type_id = 0x0016 + //-> certificate_id = "CSA00000SWC00000-00" + //-> security_level = 0 + //-> security_information = 0 + //-> version_number = 1 + //-> certification_type = 0 + //-> dac_origin_vendor_id is not present + //-> dac_origin_product_id is not present + static const uint8_t kCdForAllExamples[539] = { + 0x30, 0x82, 0x02, 0x17, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x02, 0x08, 0x30, + 0x82, 0x02, 0x04, 0x02, 0x01, 0x03, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, + 0x01, 0x30, 0x82, 0x01, 0x70, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, 0xa0, 0x82, 0x01, 0x61, + 0x04, 0x82, 0x01, 0x5d, 0x15, 0x24, 0x00, 0x01, 0x25, 0x01, 0xf1, 0xff, 0x36, 0x02, 0x05, 0x00, 0x80, 0x05, 0x01, 0x80, + 0x05, 0x02, 0x80, 0x05, 0x03, 0x80, 0x05, 0x04, 0x80, 0x05, 0x05, 0x80, 0x05, 0x06, 0x80, 0x05, 0x07, 0x80, 0x05, 0x08, + 0x80, 0x05, 0x09, 0x80, 0x05, 0x0a, 0x80, 0x05, 0x0b, 0x80, 0x05, 0x0c, 0x80, 0x05, 0x0d, 0x80, 0x05, 0x0e, 0x80, 0x05, + 0x0f, 0x80, 0x05, 0x10, 0x80, 0x05, 0x11, 0x80, 0x05, 0x12, 0x80, 0x05, 0x13, 0x80, 0x05, 0x14, 0x80, 0x05, 0x15, 0x80, + 0x05, 0x16, 0x80, 0x05, 0x17, 0x80, 0x05, 0x18, 0x80, 0x05, 0x19, 0x80, 0x05, 0x1a, 0x80, 0x05, 0x1b, 0x80, 0x05, 0x1c, + 0x80, 0x05, 0x1d, 0x80, 0x05, 0x1e, 0x80, 0x05, 0x1f, 0x80, 0x05, 0x20, 0x80, 0x05, 0x21, 0x80, 0x05, 0x22, 0x80, 0x05, + 0x23, 0x80, 0x05, 0x24, 0x80, 0x05, 0x25, 0x80, 0x05, 0x26, 0x80, 0x05, 0x27, 0x80, 0x05, 0x28, 0x80, 0x05, 0x29, 0x80, + 0x05, 0x2a, 0x80, 0x05, 0x2b, 0x80, 0x05, 0x2c, 0x80, 0x05, 0x2d, 0x80, 0x05, 0x2e, 0x80, 0x05, 0x2f, 0x80, 0x05, 0x30, + 0x80, 0x05, 0x31, 0x80, 0x05, 0x32, 0x80, 0x05, 0x33, 0x80, 0x05, 0x34, 0x80, 0x05, 0x35, 0x80, 0x05, 0x36, 0x80, 0x05, + 0x37, 0x80, 0x05, 0x38, 0x80, 0x05, 0x39, 0x80, 0x05, 0x3a, 0x80, 0x05, 0x3b, 0x80, 0x05, 0x3c, 0x80, 0x05, 0x3d, 0x80, + 0x05, 0x3e, 0x80, 0x05, 0x3f, 0x80, 0x05, 0x40, 0x80, 0x05, 0x41, 0x80, 0x05, 0x42, 0x80, 0x05, 0x43, 0x80, 0x05, 0x44, + 0x80, 0x05, 0x45, 0x80, 0x05, 0x46, 0x80, 0x05, 0x47, 0x80, 0x05, 0x48, 0x80, 0x05, 0x49, 0x80, 0x05, 0x4a, 0x80, 0x05, + 0x4b, 0x80, 0x05, 0x4c, 0x80, 0x05, 0x4d, 0x80, 0x05, 0x4e, 0x80, 0x05, 0x4f, 0x80, 0x05, 0x50, 0x80, 0x05, 0x51, 0x80, + 0x05, 0x52, 0x80, 0x05, 0x53, 0x80, 0x05, 0x54, 0x80, 0x05, 0x55, 0x80, 0x05, 0x56, 0x80, 0x05, 0x57, 0x80, 0x05, 0x58, + 0x80, 0x05, 0x59, 0x80, 0x05, 0x5a, 0x80, 0x05, 0x5b, 0x80, 0x05, 0x5c, 0x80, 0x05, 0x5d, 0x80, 0x05, 0x5e, 0x80, 0x05, + 0x5f, 0x80, 0x05, 0x60, 0x80, 0x05, 0x61, 0x80, 0x05, 0x62, 0x80, 0x05, 0x63, 0x80, 0x18, 0x24, 0x03, 0x16, 0x2c, 0x04, + 0x13, 0x43, 0x53, 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x53, 0x57, 0x43, 0x30, 0x30, 0x30, 0x30, 0x30, 0x2d, 0x30, 0x30, + 0x24, 0x05, 0x00, 0x24, 0x06, 0x00, 0x24, 0x07, 0x01, 0x24, 0x08, 0x00, 0x18, 0x31, 0x7c, 0x30, 0x7a, 0x02, 0x01, 0x03, + 0x80, 0x14, 0xfe, 0x34, 0x3f, 0x95, 0x99, 0x47, 0x76, 0x3b, 0x61, 0xee, 0x45, 0x39, 0x13, 0x13, 0x38, 0x49, 0x4f, 0xe6, + 0x7d, 0x8e, 0x30, 0x0b, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x30, 0x0a, 0x06, 0x08, 0x2a, + 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x04, 0x46, 0x30, 0x44, 0x02, 0x20, 0x4a, 0x12, 0xf8, 0xd4, 0x2f, 0x90, 0x23, + 0x5c, 0x05, 0xa7, 0x71, 0x21, 0xcb, 0xeb, 0xae, 0x15, 0xd5, 0x90, 0x14, 0x65, 0x58, 0xe9, 0xc9, 0xb4, 0x7a, 0x1a, 0x38, + 0xf7, 0xa3, 0x6a, 0x7d, 0xc5, 0x02, 0x20, 0x20, 0xa4, 0x74, 0x28, 0x97, 0xc3, 0x0a, 0xed, 0xa0, 0xa5, 0x6b, 0x36, 0xe1, + 0x4e, 0xbb, 0xc8, 0x5b, 0xbd, 0xb7, 0x44, 0x93, 0xf9, 0x93, 0x58, 0x1e, 0xb0, 0x44, 0x4e, 0xd6, 0xca, 0x94, 0x0b + }; + + return CopySpanToMutableSpan(ByteSpan{ kCdForAllExamples }, outBufferSpan); +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetFirmwareInformation(MutableByteSpan & firmwareInformationSpan) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetDeviceAttestationCert(MutableByteSpan & attestationCertSpan) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + static const uint8_t kDevelopmentDAC_Cert_FFF1_8004[493] = { + 0x30, 0x82, 0x01, 0xe9, 0x30, 0x82, 0x01, 0x8e, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x1e, 0x06, 0x7f, 0x3b, 0xfe, + 0xcd, 0xd8, 0x13, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x3d, 0x31, 0x25, 0x30, + 0x23, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, 0x65, 0x76, 0x20, 0x50, + 0x41, 0x49, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x31, 0x20, 0x6e, 0x6f, 0x20, 0x50, 0x49, 0x44, 0x31, 0x14, 0x30, 0x12, + 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, 0x31, 0x30, 0x20, + 0x17, 0x0d, 0x32, 0x32, 0x30, 0x32, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, + 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, 0x53, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, + 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, 0x65, 0x76, 0x20, 0x44, 0x41, 0x43, 0x20, + 0x30, 0x78, 0x46, 0x46, 0x46, 0x31, 0x2f, 0x30, 0x78, 0x38, 0x30, 0x30, 0x34, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, + 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, 0x46, 0x31, 0x31, 0x14, 0x30, 0x12, 0x06, + 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x02, 0x0c, 0x04, 0x38, 0x30, 0x30, 0x34, 0x30, 0x59, 0x30, + 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, + 0x03, 0x42, 0x00, 0x04, 0x50, 0x41, 0x38, 0xef, 0x31, 0xc9, 0xdd, 0x16, 0x0e, 0xb4, 0x6c, 0x6c, 0x17, 0x11, 0x4f, 0x9d, + 0x72, 0x88, 0x40, 0x80, 0x1f, 0x73, 0xbb, 0x9b, 0x5a, 0x2c, 0x51, 0x91, 0xc9, 0xb2, 0x06, 0x63, 0x01, 0x9d, 0x94, 0x76, + 0xd1, 0x93, 0x1b, 0x93, 0xff, 0x47, 0xf4, 0x32, 0x56, 0x37, 0x90, 0x35, 0xd2, 0x29, 0x62, 0x0b, 0x7e, 0x21, 0x0e, 0x59, + 0x2f, 0x26, 0x43, 0x7d, 0x2d, 0x57, 0x62, 0x05, 0xa3, 0x60, 0x30, 0x5e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, + 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, + 0x07, 0x80, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa0, 0xa7, 0x1c, 0x2a, 0x5f, 0x74, 0x45, + 0x20, 0x5b, 0x12, 0xa6, 0x28, 0xca, 0xb7, 0x16, 0x45, 0xba, 0x2d, 0x5e, 0x72, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, + 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x63, 0x54, 0x0e, 0x47, 0xf6, 0x4b, 0x1c, 0x38, 0xd1, 0x38, 0x84, 0xa4, 0x62, 0xd1, + 0x6c, 0x19, 0x5d, 0x8f, 0xfb, 0x3c, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x49, + 0x00, 0x30, 0x46, 0x02, 0x21, 0x00, 0xe7, 0x79, 0xeb, 0x8b, 0xbb, 0xd8, 0xba, 0x28, 0x68, 0xd3, 0x7b, 0xfc, 0x3a, 0x0e, + 0x33, 0x87, 0x03, 0xdb, 0xe4, 0x5c, 0x54, 0x09, 0x8c, 0x8a, 0xe4, 0xa3, 0x84, 0x4e, 0xf5, 0xc8, 0x2b, 0x5b, 0x02, 0x21, + 0x00, 0x90, 0xe7, 0x6b, 0x2b, 0x83, 0x73, 0x92, 0xab, 0x29, 0x40, 0x39, 0x10, 0x40, 0xf6, 0x4d, 0xc7, 0x8c, 0x53, 0x01, + 0xac, 0x9d, 0x08, 0x66, 0x4f, 0xf6, 0xd0, 0x10, 0x4a, 0xfe, 0x98, 0xfc, 0x80, + }; + + return CopySpanToMutableSpan(ByteSpan(kDevelopmentDAC_Cert_FFF1_8004), attestationCertSpan); +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetProductAttestationIntermediateCert(MutableByteSpan & intermediateCertSpan) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + static const uint8_t kDevelopmentPAI_Cert_FFF1[463] = { + 0x30, 0x82, 0x01, 0xcb, 0x30, 0x82, 0x01, 0x71, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x56, 0xad, 0x82, 0x22, 0xad, + 0x94, 0x5b, 0x64, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x30, 0x31, 0x18, 0x30, + 0x16, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x0f, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x54, 0x65, 0x73, 0x74, 0x20, + 0x50, 0x41, 0x41, 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, + 0x04, 0x46, 0x46, 0x46, 0x31, 0x30, 0x20, 0x17, 0x0d, 0x32, 0x32, 0x30, 0x32, 0x30, 0x35, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x5a, 0x18, 0x0f, 0x39, 0x39, 0x39, 0x39, 0x31, 0x32, 0x33, 0x31, 0x32, 0x33, 0x35, 0x39, 0x35, 0x39, 0x5a, 0x30, + 0x3d, 0x31, 0x25, 0x30, 0x23, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1c, 0x4d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x44, + 0x65, 0x76, 0x20, 0x50, 0x41, 0x49, 0x20, 0x30, 0x78, 0x46, 0x46, 0x46, 0x31, 0x20, 0x6e, 0x6f, 0x20, 0x50, 0x49, 0x44, + 0x31, 0x14, 0x30, 0x12, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x02, 0x01, 0x0c, 0x04, 0x46, 0x46, + 0x46, 0x31, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, + 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x41, 0x9a, 0x93, 0x15, 0xc2, 0x17, 0x3e, 0x0c, 0x8c, 0x87, 0x6d, + 0x03, 0xcc, 0xfc, 0x94, 0x48, 0x52, 0x64, 0x7f, 0x7f, 0xec, 0x5e, 0x50, 0x82, 0xf4, 0x05, 0x99, 0x28, 0xec, 0xa8, 0x94, + 0xc5, 0x94, 0x15, 0x13, 0x09, 0xac, 0x63, 0x1e, 0x4c, 0xb0, 0x33, 0x92, 0xaf, 0x68, 0x4b, 0x0b, 0xaf, 0xb7, 0xe6, 0x5b, + 0x3b, 0x81, 0x62, 0xc2, 0xf5, 0x2b, 0xf9, 0x31, 0xb8, 0xe7, 0x7a, 0xaa, 0x82, 0xa3, 0x66, 0x30, 0x64, 0x30, 0x12, 0x06, + 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x00, 0x30, 0x0e, 0x06, + 0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, + 0x04, 0x16, 0x04, 0x14, 0x63, 0x54, 0x0e, 0x47, 0xf6, 0x4b, 0x1c, 0x38, 0xd1, 0x38, 0x84, 0xa4, 0x62, 0xd1, 0x6c, 0x19, + 0x5d, 0x8f, 0xfb, 0x3c, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x6a, 0xfd, 0x22, + 0x77, 0x1f, 0x51, 0x1f, 0xec, 0xbf, 0x16, 0x41, 0x97, 0x67, 0x10, 0xdc, 0xdc, 0x31, 0xa1, 0x71, 0x7e, 0x30, 0x0a, 0x06, + 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0xb2, 0xef, 0x27, + 0xf4, 0x9a, 0xe9, 0xb5, 0x0f, 0xb9, 0x1e, 0xea, 0xc9, 0x4c, 0x4d, 0x0b, 0xdb, 0xb8, 0xd7, 0x92, 0x9c, 0x6c, 0xb8, 0x8f, + 0xac, 0xe5, 0x29, 0x36, 0x8d, 0x12, 0x05, 0x4c, 0x0c, 0x02, 0x20, 0x65, 0x5d, 0xc9, 0x2b, 0x86, 0xbd, 0x90, 0x98, 0x82, + 0xa6, 0xc6, 0x21, 0x77, 0xb8, 0x25, 0xd7, 0xd0, 0x5e, 0xdb, 0xe7, 0xc2, 0x2f, 0x9f, 0xea, 0x71, 0x22, 0x0e, 0x7e, 0xa7, + 0x03, 0xf8, 0x91, + }; + + return CopySpanToMutableSpan(ByteSpan(kDevelopmentPAI_Cert_FFF1), intermediateCertSpan); +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetSpake2pSalt(MutableByteSpan & saltSpan) +{ +#if !CONFIG_STM32_FACTORY_DATA_ENABLE + static const uint8_t kDefaultTestVerifierSalt[16] = { + 0x53, 0x50, 0x41, 0x4b, 0x45, 0x32, 0x50, 0x20, 0x4b, 0x65, 0x79, 0x20, 0x53, 0x61, 0x6c, 0x74, + }; + + size_t saltLen = sizeof(kDefaultTestVerifierSalt); + if (saltSpan.size() < saltLen) + { + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + memcpy(saltSpan.data(), &kDefaultTestVerifierSalt[0], saltLen); + saltSpan.reduce_size(saltLen); + return CHIP_NO_ERROR; +#else + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +#endif +} + +CHIP_ERROR FactoryDataProvider::GetRotatingDeviceIdUniqueId(MutableByteSpan & uniqueIdSpan) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR FactoryDataProvider::GetEnableKey(MutableByteSpan & enableKeySpan) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/FactoryDataProvider.h b/src/platform/stm32/FactoryDataProvider.h new file mode 100644 index 00000000000000..2882b989e8902d --- /dev/null +++ b/src/platform/stm32/FactoryDataProvider.h @@ -0,0 +1,69 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +class FactoryDataProvider : public chip::Credentials::DeviceAttestationCredentialsProvider, + public CommissionableDataProvider, + public DeviceInstanceInfoProvider +{ +public: + CHIP_ERROR Init(); + static FactoryDataProvider & GetDefaultInstance(); + // ===== Members functions that implement the DeviceAttestationCredentialsProvider + CHIP_ERROR GetCertificationDeclaration(MutableByteSpan & outBuffer) override; + CHIP_ERROR GetFirmwareInformation(MutableByteSpan & out_firmware_info_buffer) override; + CHIP_ERROR GetDeviceAttestationCert(MutableByteSpan & outBuffer) override; + CHIP_ERROR GetProductAttestationIntermediateCert(MutableByteSpan & outBuffer) override; + CHIP_ERROR SignWithDeviceAttestationKey(const ByteSpan & messageToSign, MutableByteSpan & outSignBuffer) override; + + // ===== Members functions that implement the CommissionableDataProvider + CHIP_ERROR GetSetupDiscriminator(uint16_t & setupDiscriminator) override; + CHIP_ERROR SetSetupDiscriminator(uint16_t setupDiscriminator) override; + CHIP_ERROR GetSpake2pIterationCount(uint32_t & iterationCount) override; + CHIP_ERROR GetSpake2pSalt(MutableByteSpan & saltBuf) override; + CHIP_ERROR GetSpake2pVerifier(MutableByteSpan & verifierBuf, size_t & verifierLen) override; + CHIP_ERROR GetSetupPasscode(uint32_t & setupPasscode) override; + CHIP_ERROR SetSetupPasscode(uint32_t setupPasscode) override; + + // ===== Members functions that implement the DeviceInstanceInfoProvider + CHIP_ERROR GetVendorName(char * buf, size_t bufSize) override; + CHIP_ERROR GetVendorId(uint16_t & vendorId) override; + CHIP_ERROR GetProductName(char * buf, size_t bufSize) override; + CHIP_ERROR GetProductId(uint16_t & productId) override; + CHIP_ERROR GetPartNumber(char * buf, size_t bufSize) override; + CHIP_ERROR GetProductURL(char * buf, size_t bufSize) override; + CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) override; + CHIP_ERROR GetSerialNumber(char * buf, size_t bufSize) override; + CHIP_ERROR GetManufacturingDate(uint16_t & year, uint8_t & month, uint8_t & day) override; + CHIP_ERROR GetHardwareVersion(uint16_t & hardwareVersion) override; + CHIP_ERROR GetHardwareVersionString(char * buf, size_t bufSize) override; + CHIP_ERROR GetRotatingDeviceIdUniqueId(MutableByteSpan & uniqueIdSpan) override; + + // ===== Members functions that are platform-specific + CHIP_ERROR GetEnableKey(MutableByteSpan & enableKey); +}; + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/InetPlatformConfig.h b/src/platform/stm32/InetPlatformConfig.h new file mode 100644 index 00000000000000..44e4719c99ed95 --- /dev/null +++ b/src/platform/stm32/InetPlatformConfig.h @@ -0,0 +1,41 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Platform-specific configuration overrides for the Inet + * Layer on stm32 platforms. + * + */ + +#pragma once + +// ==================== Platform Adaptations ==================== + +#ifndef INET_CONFIG_ENABLE_IPV4 +#error Inet IPv4 configuration should be configured at build generation time +#endif + +// ========== Platform-specific Configuration Overrides ========= + +#ifndef INET_CONFIG_NUM_TCP_ENDPOINTS +#define INET_CONFIG_NUM_TCP_ENDPOINTS 4 +#endif // INET_CONFIG_NUM_TCP_ENDPOINTS + +#ifndef INET_CONFIG_NUM_UDP_ENDPOINTS +#define INET_CONFIG_NUM_UDP_ENDPOINTS 4 +#endif // INET_CONFIG_NUM_UDP_ENDPOINTS diff --git a/src/platform/stm32/KeyValueStoreManagerImpl.cpp b/src/platform/stm32/KeyValueStoreManagerImpl.cpp new file mode 100644 index 00000000000000..b68ea2c1c9adc9 --- /dev/null +++ b/src/platform/stm32/KeyValueStoreManagerImpl.cpp @@ -0,0 +1,121 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "flash_wb.h" +#include +#include +#include +#include +#include + +#define MATTER_KEY_NAME_MAX_LENGTH (15 * 2) // ADD Max key name string size is 30 "keyType...;KeyName..." +namespace chip { +namespace DeviceLayer { +namespace PersistedStorage { +/** Singleton instance of the KeyValueStoreManager implementation object. + */ +KeyValueStoreManagerImpl KeyValueStoreManagerImpl::sInstance; + +CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size, + size_t offset) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + if ((key != NULL) && (value != NULL) && (read_bytes_size != NULL)) + { + return this->_PrintError(NM_GetKeyValue(value, key, (uint32_t) value_size, read_bytes_size, SECTOR_SECURE)); + } + else + { + err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; + } + return err; +} + +CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) +{ + + ChipLogDetail(DataManagement, "DELETE=> %s", key); + if (key != NULL) + { + return this->_PrintError(NM_DeleteKey(key, SECTOR_SECURE)); + } + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; +} + +CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, size_t value_size) +{ + + if ((value_size != 0) && (key != NULL) && (value != NULL)) + { + + return this->_PrintError(NM_SetKeyValue((char *) value, (char *) key, (uint32_t) value_size, SECTOR_SECURE)); + } + + return CHIP_NO_ERROR; +} + +CHIP_ERROR KeyValueStoreManagerImpl::_PrintError(NVM_StatusTypeDef err) +{ + switch (err) + { + case NVM_OK: + ChipLogDetail(DataManagement, "NVM_OK"); + return CHIP_NO_ERROR; + + case NVM_KEY_NOT_FOUND: + ChipLogDetail(DataManagement, "CHIP_ERROR_PERSISTED_STORAGE_NOT_FOUND"); + return CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; + + case NVM_WRITE_FAILED: + ChipLogDetail(DataManagement, "NVM_WRITE_FAILED"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_READ_FAILED: + ChipLogDetail(DataManagement, "NVM_READ_FAILED"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_DELETE_FAILED: + ChipLogDetail(DataManagement, "NVM_DELETE_FAILED"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_SIZE_FULL: + ChipLogDetail(DataManagement, "NVM_SIZE_FULL"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_BLOCK_SIZE_OVERFLOW: + ChipLogDetail(DataManagement, "NVM_BLOCK_SIZE_OVERFLOW"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_ERROR_BLOCK_ALIGN: + ChipLogDetail(DataManagement, "NVM_ERROR_BLOCK_ALIGN"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + case NVM_BUFFER_TOO_SMALL: + ChipLogDetail(DataManagement, "NVM_BUFFER_TOO_SMALL"); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + + default: + ChipLogDetail(DataManagement, "NVM_UNKNOWN_ERROR "); + return CHIP_ERROR_PERSISTED_STORAGE_FAILED; + } +} + +} // namespace PersistedStorage +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/KeyValueStoreManagerImpl.h b/src/platform/stm32/KeyValueStoreManagerImpl.h new file mode 100644 index 00000000000000..335ffb2b907df9 --- /dev/null +++ b/src/platform/stm32/KeyValueStoreManagerImpl.h @@ -0,0 +1,82 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MIDDLEWARES_MATTER_PLATFORM_STM32WB_KEYVALUESTOREMANAGERIMPL_H_ +#define MIDDLEWARES_MATTER_PLATFORM_STM32WB_KEYVALUESTOREMANAGERIMPL_H_ + +#pragma once + +#include + +#include "flash_wb.h" +#include "stm_logging.h" + +namespace chip { +namespace DeviceLayer { +namespace PersistedStorage { + +class KeyValueStoreManagerImpl : public KeyValueStoreManager +{ + // Allow the KeyValueStoreManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend class KeyValueStoreManager; + +public: + CHIP_ERROR _Get(const char * key, void * value, size_t value_size, size_t * read_bytes_size, size_t offset); + + CHIP_ERROR _Delete(const char * key); + + CHIP_ERROR _Put(const char * key, const void * value, size_t value_size); + + CHIP_ERROR _PrintError(NVM_StatusTypeDef err); + +private: + // ===== Members for internal use by the following friends. + friend KeyValueStoreManager & KeyValueStoreMgr(); + friend KeyValueStoreManagerImpl & KeyValueStoreMgrImpl(); + + static KeyValueStoreManagerImpl sInstance; +}; + +/** + * Returns the public interface of the KeyValueStoreManager singleton object. + * + * Chip applications should use this to access features of the KeyValueStoreManager object + * that are common to all platforms. + */ +inline KeyValueStoreManager & KeyValueStoreMgr(void) +{ + return KeyValueStoreManagerImpl::sInstance; +} + +/** + * Returns the platform-specific implementation of the KeyValueStoreManager singleton object. + * + * Chip applications can use this to gain access to features of the KeyValueStoreManager + * that are specific to the STM32 platform. + */ +inline KeyValueStoreManagerImpl & KeyValueStoreMgrImpl(void) +{ + return KeyValueStoreManagerImpl::sInstance; +} + +} // namespace PersistedStorage +} // namespace DeviceLayer +} // namespace chip + +#endif /* MIDDLEWARES_MATTER_PLATFORM_STM32WB_KEYVALUESTOREMANAGERIMPL_H_ */ diff --git a/src/platform/stm32/PlatformManagerImpl.cpp b/src/platform/stm32/PlatformManagerImpl.cpp new file mode 100644 index 00000000000000..60148b07f6e4ca --- /dev/null +++ b/src/platform/stm32/PlatformManagerImpl.cpp @@ -0,0 +1,116 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the PlatformManager object + * for the stm32 platform. + */ + +#include +#include +#include +#include +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +PlatformManagerImpl PlatformManagerImpl::sInstance; +extern "C" int mbedtls_hardware_poll(void * data, unsigned char * output, size_t len, size_t * olen); + +CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) +{ + System::Clock::InitClock_RealTime(); + chip::Crypto::add_entropy_source(mbedtls_hardware_poll, NULL, 16); + ReturnErrorOnFailure(Internal::GenericPlatformManagerImpl_FreeRTOS::_InitChipStack()); + return CHIP_NO_ERROR; +} + +void PlatformManagerImpl::_RunEventLoop(void) +{ + Internal::GenericPlatformManagerImpl_FreeRTOS::_RunEventLoop(); +} + +void PlatformManagerImpl::_Shutdown() +{ + uint64_t upTime = 0; + + if (GetDiagnosticDataProvider().GetUpTime(upTime) == CHIP_NO_ERROR) + { + uint32_t totalOperationalHours = 0; + + if (ConfigurationMgr().GetTotalOperationalHours(totalOperationalHours) == CHIP_NO_ERROR) + { + ConfigurationMgr().StoreTotalOperationalHours(totalOperationalHours + static_cast(upTime / 3600)); + } + else + { + ChipLogError(DeviceLayer, "Failed to get total operational hours of the Node"); + } + } + else + { + ChipLogError(DeviceLayer, "Failed to get current uptime since the Node’s last reboot"); + } + + Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); +} + +CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapFree(uint64_t & currentHeapFree) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapUsed(uint64_t & currentHeapUsed) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetTotalOperationalHours(uint32_t & totalOperationalHours) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetRebootCount(uint16_t & rebootCount) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetUpTime(uint64_t & upTime) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +CHIP_ERROR PlatformManagerImpl::_GetBootReasons(uint8_t & bootReasons) +{ + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/PlatformManagerImpl.h b/src/platform/stm32/PlatformManagerImpl.h new file mode 100644 index 00000000000000..8de9bfa4a24f48 --- /dev/null +++ b/src/platform/stm32/PlatformManagerImpl.h @@ -0,0 +1,101 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * Copyright (c) 2018 Nest Labs, Inc. + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the PlatformManager object + * for the stm32 platforms. + */ + +#pragma once + +#include + +namespace chip { +namespace DeviceLayer { + +/** + * Concrete implementation of the PlatformManager singleton object for the stm32 platform. + */ +class PlatformManagerImpl final : public PlatformManager, public Internal::GenericPlatformManagerImpl_FreeRTOS +{ + // Allow the PlatformManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend PlatformManager; + + // Allow the generic implementation base class to call helper methods on + // this class. +#ifndef DOXYGEN_SHOULD_SKIP_THIS + friend Internal::GenericPlatformManagerImpl_FreeRTOS; +#endif + +public: + // ===== Platform-specific members that may be accessed directly by the application. + + CHIP_ERROR InitLwIPCoreLock(void); + // static void HandleESPSystemEvent(void * arg, esp_event_base_t eventBase, int32_t eventId, void * eventData); + +private: + // ===== Methods that implement the PlatformManager abstract interface. + + CHIP_ERROR _InitChipStack(void); + void _RunEventLoop(void); + void _Shutdown(); + CHIP_ERROR _GetCurrentHeapFree(uint64_t & currentHeapFree); + CHIP_ERROR _GetCurrentHeapUsed(uint64_t & currentHeapUsed); + CHIP_ERROR _GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark); + + CHIP_ERROR _GetRebootCount(uint16_t & rebootCount); + CHIP_ERROR _GetUpTime(uint64_t & upTime); + CHIP_ERROR _GetTotalOperationalHours(uint32_t & totalOperationalHours); + CHIP_ERROR _GetBootReasons(uint8_t & bootReasons); + // ===== Members for internal use by the following friends. + + friend PlatformManager & PlatformMgr(void); + friend PlatformManagerImpl & PlatformMgrImpl(void); + + uint64_t mStartTimeMilliseconds = 0; + + static PlatformManagerImpl sInstance; +}; + +/** + * Returns the public interface of the PlatformManager singleton object. + * + * Chip applications should use this to access features of the PlatformManager object + * that are common to all platforms. + */ +inline PlatformManager & PlatformMgr(void) +{ + return PlatformManagerImpl::sInstance; +} + +/** + * Returns the platform-specific implementation of the PlatformManager singleton object. + * + * Chip applications can use this to gain access to features of the PlatformManager + * that are specific to the stm32 platform. + */ +inline PlatformManagerImpl & PlatformMgrImpl(void) +{ + return PlatformManagerImpl::sInstance; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/STM32Config.cpp b/src/platform/stm32/STM32Config.cpp new file mode 100644 index 00000000000000..cf1a6bdc652e19 --- /dev/null +++ b/src/platform/stm32/STM32Config.cpp @@ -0,0 +1,105 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "flash_wb.h" +#include +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +CHIP_ERROR STM32Config::Init() +{ + return CHIP_NO_ERROR; +} + +template +CHIP_ERROR STM32Config::ReadConfigValue(Key key, T & val) +{ + uint8_t * buffer_key[35] = { 0 }; + size_t * read_by_size = NULL; + + sprintf((char *) buffer_key, "Config%i", key); + NM_GetKeyValue((void *) &val, (char *) buffer_key, sizeof(val), read_by_size, SECTOR_NO_SECURE); + + return CHIP_NO_ERROR; +} + +CHIP_ERROR STM32Config::ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) +{ + + return ReadConfigValueBin(key, reinterpret_cast(buf), bufSize, outLen); +} + +CHIP_ERROR STM32Config::ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +template CHIP_ERROR STM32Config::ReadConfigValue(Key key, bool & val); +template CHIP_ERROR STM32Config::ReadConfigValue(Key key, uint32_t & val); +template CHIP_ERROR STM32Config::ReadConfigValue(Key key, uint64_t & val); + +CHIP_ERROR STM32Config::WriteConfigValue(Key key, uint32_t val) +{ + uint8_t * buffer_key[35] = { 0 }; + size_t * read_by_size = NULL; + + sprintf((char *) buffer_key, "Config%i", key); + NM_SetKeyValue((char *) &val, (char *) buffer_key, sizeof(val), SECTOR_NO_SECURE); + return CHIP_NO_ERROR; +} + +CHIP_ERROR STM32Config::WriteConfigValueStr(Key key, const char * str) +{ + return WriteConfigValueStr(key, str, (str != NULL) ? strlen(str) : 0); +} + +CHIP_ERROR STM32Config::WriteConfigValueStr(Key key, const char * str, size_t strLen) +{ + return WriteConfigValueBin(key, reinterpret_cast(str), strLen); +} + +CHIP_ERROR STM32Config::WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen) +{ + uint8_t * buffer_key[35] = { 0 }; + size_t * read_by_size = NULL; + + sprintf((char *) buffer_key, "Config%i", key); + NM_SetKeyValue((char *) data, (char *) buffer_key, dataLen, SECTOR_NO_SECURE); + return CHIP_NO_ERROR; +} + +bool STM32Config::ConfigValueExists(Key key) +{ + return false; +} + +CHIP_ERROR STM32Config::FactoryResetConfig(void) +{ + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; +} + +void STM32Config::RunConfigUnitTest(void) {} + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/STM32Config.h b/src/platform/stm32/STM32Config.h new file mode 100644 index 00000000000000..98ddb844616342 --- /dev/null +++ b/src/platform/stm32/STM32Config.h @@ -0,0 +1,93 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Utilities for accessing persisted device configuration on + * on STM32 platforms. + */ + +#pragma once + +#include + +namespace chip { +namespace DeviceLayer { +namespace Internal { + +/* Base for the category calculation when determining the key IDs */ + +class STM32Config +{ +public: + using Key = uint32_t; + + // Key definitions for well-known keys. + // Factory config keys + static constexpr Key kConfigKey_SerialNum = 0; + static constexpr Key kConfigKey_MfrDeviceId = 1; + static constexpr Key kConfigKey_MfrDeviceCert = 2; + static constexpr Key kConfigKey_MfrDevicePrivateKey = 3; + static constexpr Key kConfigKey_ManufacturingDate = 4; + static constexpr Key kConfigKey_SetupPinCode = 5; + static constexpr Key kConfigKey_MfrDeviceICACerts = 6; + static constexpr Key kConfigKey_SetupDiscriminator = 7; + static constexpr Key kConfigKey_Spake2pIterationCount = 8; + static constexpr Key kConfigKey_Spake2pSalt = 9; + static constexpr Key kConfigKey_Spake2pVerifier = 10; + // CHIP Config Keys + static constexpr Key kConfigKey_FabricId = 8; + static constexpr Key kConfigKey_ServiceConfig = 9; + static constexpr Key kConfigKey_PairedAccountId = 10; + static constexpr Key kConfigKey_ServiceId = 11; + static constexpr Key kConfigKey_FabricSecret = 12; + static constexpr Key kConfigKey_LastUsedEpochKeyId = 13; + static constexpr Key kConfigKey_FailSafeArmed = 14; + static constexpr Key kConfigKey_GroupKey = 15; + static constexpr Key kConfigKey_HardwareVersion = 16; + static constexpr Key kConfigKey_RegulatoryLocation = 17; + static constexpr Key kConfigKey_CountryCode = 18; + static constexpr Key kConfigKey_HourFormat = 20; + static constexpr Key kConfigKey_CalendarType = 21; + static constexpr Key kConfigKey_Breadcrumb = 22; + static constexpr Key kConfigKey_UniqueId = 23; + static constexpr Key kConfigKey_ProductRevision = 24; + // Set key id limits for each group. + static constexpr Key kConfigKey_Base = kConfigKey_SerialNum; + static constexpr Key kConfigKey_Max = kConfigKey_UniqueId; + + static CHIP_ERROR Init(); + // Config value accessors. + template + // Config value accessors. + static CHIP_ERROR ReadConfigValue(Key key, T & val); + // Configuration methods used by the GenericConfigurationManagerImpl<> template. + static CHIP_ERROR ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen); + static CHIP_ERROR ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen); + static CHIP_ERROR WriteConfigValue(Key key, uint32_t val); + static CHIP_ERROR WriteConfigValueStr(Key key, const char * str); + static CHIP_ERROR WriteConfigValueStr(Key key, const char * str, size_t strLen); + static CHIP_ERROR WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen); + static CHIP_ERROR ClearConfigValue(Key key); + static bool ConfigValueExists(Key key); + static CHIP_ERROR FactoryResetConfig(void); + static void RunConfigUnitTest(void); +}; + +} // namespace Internal +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/STM32FreeRtosHooks.cpp b/src/platform/stm32/STM32FreeRtosHooks.cpp new file mode 100644 index 00000000000000..cdf1909e8c4393 --- /dev/null +++ b/src/platform/stm32/STM32FreeRtosHooks.cpp @@ -0,0 +1,120 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "STM32FreeRtosHooks.h" +#include "FreeRTOS.h" +#include "mbedtls/memory_buffer_alloc.h" + +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + +#define MBEDTLS_HEAP_SIZE 15000 +#include "mbedtls/pk.h" +#include "mbedtls/platform.h" +#include "mbedtls/sha1.h" +#include "mbedtls/sha256.h" +#include "mbedtls/x509_crt.h" + +#include "mbedtls/threading.h" +#include "threading_alt.h" + +#include + +static uint8_t mdedtls_heap[MBEDTLS_HEAP_SIZE]; + +static void freertos_mbedtls_heap_init(void); + +static inline void mutex_init(mbedtls_threading_mutex_t * mutex) +{ + mutex->mutex = xSemaphoreCreateMutex(); + + if (mutex->mutex != NULL) + { + mutex->is_valid = 1; + } + else + { + mutex->is_valid = 0; + } +} + +static inline void mutex_free(mbedtls_threading_mutex_t * mutex) +{ + if (mutex->is_valid == 1) + { + vSemaphoreDelete(mutex->mutex); + mutex->is_valid = 0; + } +} + +static inline int mutex_lock(mbedtls_threading_mutex_t * mutex) +{ + int ret = MBEDTLS_ERR_THREADING_BAD_INPUT_DATA; + + if (mutex->is_valid == 1) + { + if (xSemaphoreTake(mutex->mutex, portMAX_DELAY)) + { + ret = 0; + } + else + { + ret = MBEDTLS_ERR_THREADING_MUTEX_ERROR; + } + } + + return ret; +} + +static inline int mutex_unlock(mbedtls_threading_mutex_t * mutex) +{ + int ret = MBEDTLS_ERR_THREADING_BAD_INPUT_DATA; + + if (mutex->is_valid == 1) + { + if (xSemaphoreGive(mutex->mutex)) + { + ret = 0; + } + else + { + ret = MBEDTLS_ERR_THREADING_MUTEX_ERROR; + } + } + + return ret; +} + +void freertos_mbedtls_mutex_init(void) +{ + // Configure mbedtls to use mutexes from FreeRTOS + mbedtls_threading_set_alt(mutex_init, mutex_free, mutex_lock, mutex_unlock); +} + +static void freertos_mbedtls_heap_init(void) +{ + mbedtls_memory_buffer_alloc_init(mdedtls_heap, sizeof(mdedtls_heap)); +} + +void freertos_mbedtls_init(void) +{ + freertos_mbedtls_mutex_init(); + freertos_mbedtls_heap_init(); +} diff --git a/src/platform/stm32/STM32FreeRtosHooks.h b/src/platform/stm32/STM32FreeRtosHooks.h new file mode 100644 index 00000000000000..d49d7ab05a4994 --- /dev/null +++ b/src/platform/stm32/STM32FreeRtosHooks.h @@ -0,0 +1,27 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "FreeRTOS.h" +#include "semphr.h" +#ifdef __cplusplus +extern "C" { +#endif +void freertos_mbedtls_init(void); +#ifdef __cplusplus +} +#endif diff --git a/src/platform/stm32/SystemPlatformConfig.h b/src/platform/stm32/SystemPlatformConfig.h new file mode 100644 index 00000000000000..f2ed9d41b35d77 --- /dev/null +++ b/src/platform/stm32/SystemPlatformConfig.h @@ -0,0 +1,43 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Platform-specific configuration overrides for the CHIP System + * Layer on stm32 platforms. + * + */ + +#pragma once + +#include + +namespace chip { +namespace DeviceLayer { +struct ChipDeviceEvent; +} // namespace DeviceLayer +} // namespace chip + +// ==================== Platform Adaptations ==================== +#define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 +#define CHIP_SYSTEM_CONFIG_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent * + +// ========== Platform-specific Configuration Overrides ========= + +#ifndef CHIP_SYSTEM_CONFIG_NUM_TIMERS +#define CHIP_SYSTEM_CONFIG_NUM_TIMERS 16 +#endif // CHIP_SYSTEM_CONFIG_NUM_TIMERS diff --git a/src/platform/stm32/ThreadStackManagerImpl.cpp b/src/platform/stm32/ThreadStackManagerImpl.cpp new file mode 100644 index 00000000000000..ee97ff2ad0927b --- /dev/null +++ b/src/platform/stm32/ThreadStackManagerImpl.cpp @@ -0,0 +1,144 @@ +/* + * + * Copyright (c) 2020-2021 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the ThreadStackManager object for the + * STM32 platform using the OpenThread + * stack. + * + */ +/* this file behaves like a config.h, comes first */ +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "dbg_trace.h" +#include +#include + +//#include + +#include +#include +#include +#include +#include + +namespace chip { +namespace DeviceLayer { + +using namespace ::chip::DeviceLayer::Internal; + +ThreadStackManagerImpl ThreadStackManagerImpl::sInstance; + +CHIP_ERROR ThreadStackManagerImpl::_InitThreadStack(void) +{ + return InitThreadStack(NULL); +} + +CHIP_ERROR ThreadStackManagerImpl::InitThreadStack(otInstance * otInst) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Initialize the generic implementation base classes. + err = GenericThreadStackManagerImpl_FreeRTOS::DoInit(); + SuccessOrExit(err); + err = GenericThreadStackManagerImpl_OpenThread::DoInit(otInst); + SuccessOrExit(err); + +exit: + return err; +} + +CHIP_ERROR ThreadStackManagerImpl::_StartThreadTask() +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // Initialize the generic implementation base classes. + err = GenericThreadStackManagerImpl_FreeRTOS::_StartThreadTask(); + SuccessOrExit(err); + +exit: + return err; +} +CHIP_ERROR ThreadStackManagerImpl::SetThreadEnabled(bool val) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + err = GenericThreadStackManagerImpl_OpenThread::_SetThreadEnabled(val); + + return err; +} + +bool ThreadStackManagerImpl::IsInitialized() +{ + return sInstance.mThreadStackLock != NULL; +} + +} // namespace DeviceLayer +} // namespace chip + +using namespace ::chip::DeviceLayer; + +void ThreadStackManagerImpl::_ProcessThreadActivity() +{ + GenericThreadStackManagerImpl_OpenThread::_ProcessThreadActivity(); +} + +/** + * Glue function called directly by the OpenThread stack when tasklet processing work + * is pending. +// */ +extern "C" void otTaskletsSignalPending(otInstance * p_instance) +{ + ThreadStackMgrImpl().SignalThreadActivityPending(); +} + +/** + * Glue function called directly by the OpenThread stack when system event processing work + * is pending. + */ +extern "C" { +void otSysEventSignalPending(void) +{ + ChipLogProgress(DeviceLayer, "otSysEventSignalPending DEBUG THIS "); + // BaseType_t yieldRequired = ThreadStackMgrImpl().SignalThreadActivityPendingFromISR(); + // portYIELD_FROM_ISR(yieldRequired); +} +} +extern "C" { +void * otPlatCAlloc(size_t aNum, size_t aSize) +{ + return CHIPPlatformMemoryCalloc(aNum, aSize); +} +} + +extern "C" { +void otPlatFree(void * aPtr) +{ + CHIPPlatformMemoryFree(aPtr); +} +} diff --git a/src/platform/stm32/ThreadStackManagerImpl.h b/src/platform/stm32/ThreadStackManagerImpl.h new file mode 100644 index 00000000000000..d721c7f32c9ce8 --- /dev/null +++ b/src/platform/stm32/ThreadStackManagerImpl.h @@ -0,0 +1,128 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Provides an implementation of the ThreadStackManager object + * for stm32 platforms and the OpenThread + * stack. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include + +extern "C" void otSysEventSignalPending(void); + +namespace chip { +namespace DeviceLayer { + +class ThreadStackManager; +class ThreadStackManagerImpl; +namespace Internal { +extern int GetEntropy(uint8_t * buf, size_t bufSize); +} + +/** + * Concrete implementation of the ThreadStackManager singleton object for stm32 platforms + * using the OpenThread stack. + */ +class ThreadStackManagerImpl final : public ThreadStackManager, + public Internal::GenericThreadStackManagerImpl_OpenThread, + public Internal::GenericThreadStackManagerImpl_FreeRTOS +{ + // Allow the ThreadStackManager interface class to delegate method calls to + // the implementation methods provided by this class. + friend class ThreadStackManager; + + // Allow the generic implementation base classes to call helper methods on + // this class. +#ifndef DOXYGEN_SHOULD_SKIP_THIS + friend Internal::GenericThreadStackManagerImpl_OpenThread; + friend Internal::GenericThreadStackManagerImpl_OpenThread; + friend Internal::GenericThreadStackManagerImpl_FreeRTOS; +#endif + + // Allow glue functions called by OpenThread to call helper methods on this + // class. + friend void ::otTaskletsSignalPending(otInstance * otInst); + friend void ::otSysEventSignalPending(void); + +public: + // ===== Platform-specific members that may be accessed directly by the application. + + using ThreadStackManager::InitThreadStack; + CHIP_ERROR InitThreadStack(otInstance * otInst); + void SendThreadmsg(); + + CHIP_ERROR SetThreadEnabled(bool val); + +protected: + CHIP_ERROR _StartThreadTask(); + + void _ProcessThreadActivity(); + +private: + // ===== Methods that implement the ThreadStackManager abstract interface. + + CHIP_ERROR _InitThreadStack(void); + + // ===== Members for internal use by the following friends. + + friend ThreadStackManager & ::chip::DeviceLayer::ThreadStackMgr(void); + friend ThreadStackManagerImpl & ::chip::DeviceLayer::ThreadStackMgrImpl(void); + friend int Internal::GetEntropy(uint8_t * buf, size_t bufSize); + + static ThreadStackManagerImpl sInstance; + + static bool IsInitialized(); + + // ===== Private members for use by this class only. + + ThreadStackManagerImpl() = default; +}; + +/** + * Returns the public interface of the ThreadStackManager singleton object. + * + * chip applications should use this to access features of the ThreadStackManager object + * that are common to all platforms. + */ +inline ThreadStackManager & ThreadStackMgr(void) +{ + return ThreadStackManagerImpl::sInstance; +} + +/** + * Returns the platform-specific implementation of the ThreadStackManager singleton object. + * + * chip applications can use this to gain access to features of the ThreadStackManager + * that are specific to the platform. + */ +inline ThreadStackManagerImpl & ThreadStackMgrImpl(void) +{ + return ThreadStackManagerImpl::sInstance; +} + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/stm32/args.gni b/src/platform/stm32/args.gni new file mode 100644 index 00000000000000..38080e25dd39ad --- /dev/null +++ b/src/platform/stm32/args.gni @@ -0,0 +1,53 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/stm32_sdk.gni") + +import("${chip_root}/examples/platform/stm32/args.gni") + +# ARM architecture flags will be set based on stm32_family. +arm_platform_config = "${stm32_sdk_build_root}/stm32_arm.gni" +chip_device_platform = "stm32" + +# add board protector for stm32wb +chip_with_lwip = false +mbedtls_target = "${stm32_sdk_build_root}:mbedtls" + +# GLOBAL CONFIG +chip_monolithic_tests = false +chip_system_config_provide_statistics = false +chip_config_memory_management = "platform" + +# FREERTOS CONFIG +chip_stack_lock_tracking = "fatal" + +# SHELL CONFIG +chip_build_libshell = false + +# OPENTHREAD CONFIG +chip_enable_openthread = true + +# NFC CONFIG +chip_enable_nfc = false + +# INET CONFIG for thread +chip_inet_config_enable_ipv4 = false +chip_inet_config_enable_dns_resolver = false +chip_inet_config_enable_tcp_endpoint = false +chip_system_config_use_open_thread_inet_endpoints = true +chip_mdns = "platform" + +# OTA CONFIG +chip_enable_ota_requestor = false diff --git a/src/system/BUILD.gn b/src/system/BUILD.gn index 7ce311d6499f19..2eae6348e0b12d 100644 --- a/src/system/BUILD.gn +++ b/src/system/BUILD.gn @@ -62,6 +62,8 @@ if (chip_device_platform == "cc13x2_26x2") { import("//build_overrides/cyw30739_sdk.gni") } else if (chip_device_platform == "mt793x") { import("//build_overrides/mt793x_sdk.gni") +} else if (chip_device_platform == "stm32") { + import("//build_overrides/stm32_sdk.gni") } buildconfig_header("system_buildconfig") { @@ -177,6 +179,9 @@ source_set("system_config_header") { if (chip_device_platform == "cyw30739") { public_deps += [ "${cyw30739_sdk_build_root}:cyw30739_sdk" ] } + if (chip_device_platform == "stm32") { + public_deps += [ "${stm32_sdk_build_root}:stm32_sdk" ] + } # Add platform here as needed. } diff --git a/third_party/st/BUILD.gn b/third_party/st/BUILD.gn new file mode 100644 index 00000000000000..2868aa880a6b45 --- /dev/null +++ b/third_party/st/BUILD.gn @@ -0,0 +1,45 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("//build_overrides/stm32_sdk.gni") + +import("${chip_root}/src/platform/device.gni") +import("${stm32_sdk_build_root}/stm32_sdk.gni") + +declare_args() { + # Build target to use for STM32 SDK. Use this to set global SDK defines. + stm32_sdk_target = "" +} + +assert(stm32_sdk_target != "", "stm32_sdk_target must be specified") + +group("stm32_sdk") { + public_deps = [ stm32_sdk_target ] +} + +config("stm32_mbedtls_config") { + if (stm32_family == "stm32wb5") { + defines = [ "MBEDTLS_USER_CONFIG_FILE=" ] + + include_dirs = [ + chip_root, + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/", + ] + } +} +mbedtls_target("mbedtls") { + public_configs = [ ":stm32_mbedtls_config" ] + public_deps = [ "${stm32_sdk_build_root}:stm32_sdk" ] +} diff --git a/third_party/st/FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper b/third_party/st/FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper new file mode 100644 index 00000000000000..0c79564e0d8c0a --- /dev/null +++ b/third_party/st/FAMILY/BOARD/STM32WB5MM-DK_sdk.gn_helper @@ -0,0 +1,77 @@ +# STM32WB5MM-DK_sdk.gn_helper + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +declare_args() { + ## PATHS FOR STM32WB BOARD ## + stm32_board_src = "${chip_root}/examples/platform/stm32/common/STM32WB5MM-DK" + bsp_stm32wb5mm_dk = "${chip_root}/third_party/st/STM32CubeWB/Drivers/BSP/STM32WB5MM-DK" + components_common = "${chip_root}/third_party/st/STM32CubeWB/Drivers/BSP/Components/Common" + components_ssd1315 = "${chip_root}/third_party/st/STM32CubeWB/Drivers/BSP/Components/ssd1315" + components_s25fl128s = "${chip_root}/third_party/st/STM32CubeWB/Drivers/BSP/Components/s25fl128s" + + ## PATHS FOR ST UTILITIES ## + stm32_fonts_util = "${chip_root}/third_party/st/STM32CubeWB/Utilities/Fonts" + stm32_lcd_util = "${chip_root}/third_party/st/STM32CubeWB/Utilities/LCD" + stm32_lpm_util = "${chip_root}/third_party/st/STM32CubeWB/Utilities/lpm/tiny_lpm" +} + +SOURCES = [ + # BOARD APPLICATION SRC(in examples/platform/stm32/common/STM32WB5MM-DK/) + "${stm32_board_src}/Src/entropy_hardware_poll.c", + "${stm32_board_src}/Src/flash_driver.c", + "${stm32_board_src}/Src/flash_wb.c", + "${stm32_board_src}/Src/freertos_port.c", + "${stm32_board_src}/Src/hw_timerserver.c", + "${stm32_board_src}/Src/hw_uart.c", + "${stm32_board_src}/Src/stm32_lpm_if.c", + "${stm32_board_src}/Src/stm32wbxx_hal_msp.c", + "${stm32_board_src}/Src/stm32wbxx_hal_timebase_tim.c", + "${stm32_board_src}/Src/stm32wbxx_it.c", + "${stm32_board_src}/Src/stm_logging.c", + "${stm32_board_src}/Src/syscalls.c", + "${stm32_board_src}/Src/system_stm32wbxx.c", + "${stm32_board_src}/Src/otp.c", + "${stm32_board_src}/STM32_WPAN/Target/hw_ipcc.c", + + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/matter_config.h", + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h", + + #BSP DRIVERS + "${bsp_stm32wb5mm_dk}/stm32wb5mm_dk_bus.c", + "${bsp_stm32wb5mm_dk}/stm32wb5mm_dk_lcd.c", + "${bsp_stm32wb5mm_dk}/stm32wb5mm_dk.c", + + #BSP COMPONENTS + "${components_ssd1315}/ssd1315_reg.c", + "${components_ssd1315}/ssd1315.c", + + # BOARD UTILITIES + "${stm32_lpm_util}/stm32_lpm.c", + "${stm32_lcd_util}/stm32_lcd.c", + ] + +INCLUDE_DIRS = [ + "${components_common}", + "${components_s25fl128s}", + "${components_ssd1315}", + + "${bsp_stm32wb5mm_dk}", + + "${stm32_lpm_util}", + "${stm32_fonts_util}", + "${stm32_lcd_util}", + + "${stm32_board_src}/Inc", + "${stm32_board_src}/STM32_WPAN/App", + ] + +DEFINES = [ + ] + +LIBS = [ + ] + +FLAGS = [ + ] diff --git a/third_party/st/FAMILY/stm32wb5_sdk.gn_helper b/third_party/st/FAMILY/stm32wb5_sdk.gn_helper new file mode 100644 index 00000000000000..eb660301f13344 --- /dev/null +++ b/third_party/st/FAMILY/stm32wb5_sdk.gn_helper @@ -0,0 +1,173 @@ +# stm32wb5_sdk.gn_helper + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +import("//build_overrides/freertos.gni") +import("//build_overrides/mbedtls.gni") +import("//build_overrides/lwip.gni") + +declare_args() { + + # CSMSIS PATHS # + cmsis = "${chip_root}/third_party/st/STM32CubeWB/Drivers/CMSIS" + + ## PATHS FOR STM32WB FAMILY ## + stm32_wb_sdk = "${chip_root}/third_party/st/STM32CubeWB/Drivers" + stm32_wb_hal = "${chip_root}/third_party/st/STM32CubeWB/Drivers/STM32WBxx_HAL_Driver" + cmsis_device_wb = "${chip_root}/third_party/st/STM32CubeWB/Drivers/CMSIS/Device/ST/STM32WBxx" + stm32_wpan_sdk = "${chip_root}/third_party/st/STM32CubeWB/Middlewares/ST/STM32_WPAN" + stm32_config_files = "${chip_root}/examples/platform/stm32/config_files/STM32WB5" + + ## PATHS FOR FREERTOS ## + freertos_st = "${chip_root}/third_party/st/STM32CubeWB/Middlewares/Third_Party/FreeRTOS/Source" + +} + +SOURCES = [ + #HAL DRIVERS + "${stm32_wb_hal}/Src/stm32wbxx_hal_cortex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_dma.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_exti.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_flash_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_flash.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_gpio.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_ipcc.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_pwr_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_pwr.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_qspi.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rcc_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rcc.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rng.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rtc_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_rtc.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_spi_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_spi.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_tim_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_tim.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_uart_ex.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal_uart.c", + "${stm32_wb_hal}/Src/stm32wbxx_hal.c", + + #WPAN + "${stm32_wpan_sdk}/ble/core/auto/ble_events.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_gap_aci.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_gatt_aci.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_hal_aci.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_hci_le.c", + "${stm32_wpan_sdk}/ble/core/auto/ble_l2cap_aci.c", + "${stm32_wpan_sdk}/ble/core/template/osal.c", + "${stm32_wpan_sdk}/ble/svc/Src/svc_ctl.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/shci/shci.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/hci_tl_if.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/hci_tl.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/shci_tl_if.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/shci_tl.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/tl_mbox.c", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/tl_thread_hci.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/channel_manager.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/channel_monitor.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/child_supervision.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/coap.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/commissioner.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/crypto.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/dataset_ftd.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/dataset.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/diag.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/dns.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/dns_server.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/errors.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/icmp6.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/instance.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/ip6.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/jam_detection.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/joiner.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/link_raw.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/link.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/message.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/netdata.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/network_time.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/openthread_api_config_ftd.h", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/openthread_api_wb.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/openthread.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/radio.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/server.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/srp_client.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/tasklet.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/thread_ftd.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/thread.c", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/udp.c", + "${stm32_wpan_sdk}/utilities/dbg_trace.c", + "${stm32_wpan_sdk}/utilities/stm_list.c", + "${stm32_wpan_sdk}/utilities/stm_queue.c", + + #FREERTOS + "${stm32_config_files}/FreeRTOSConfig.h", + "${freertos_st}/CMSIS_RTOS_V2/cmsis_os2.c", + "${freertos_st}/croutine.c", + "${freertos_st}/event_groups.c", + "${freertos_st}/list.c", + "${freertos_st}/portable/GCC/ARM_CM4F/port.c", + "${freertos_st}/portable/MemMang/heap_4.c", + "${freertos_st}/queue.c", + "${freertos_st}/stream_buffer.c", + "${freertos_st}/tasks.c", + "${freertos_st}/timers.c", +] + +INCLUDE_DIRS = [ + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/", + "${chip_root}/src/include/", + "${cmsis}/Include", + "${cmsis_device_wb}/Include", + "${stm32_wb_hal}/Inc", + "${stm32_wb_hal}/Inc/Legacy", + "${chip_root}/src/platform/stm32", + "${chip_root}/src/include/", + + #WPAN + "${stm32_wpan_sdk}/", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/tl/", + "${stm32_wpan_sdk}/interface/patterns/ble_thread/shci/", + "${stm32_wpan_sdk}/ble/core/", + "${stm32_wpan_sdk}/ble/core/auto/", + "${stm32_wpan_sdk}/ble/core/template/", + "${stm32_wpan_sdk}/ble/svc/Inc/", + "${stm32_wpan_sdk}/ble/svc/Src/", + "${stm32_wpan_sdk}/ble/", + "${stm32_wpan_sdk}/thread/openthread/stack/include/openthread/", + "${stm32_wpan_sdk}/thread/openthread/stack/src/core/", + "${stm32_wpan_sdk}/thread/openthread/stack/src/core/config/", + "${stm32_wpan_sdk}/thread/openthread/stack/include/", + "${stm32_wpan_sdk}/thread/openthread/core/openthread_api/", + "${stm32_wpan_sdk}/thread/openthread/", + "${stm32_wpan_sdk}/interface/patterns/ble-thread/tl/", + "${stm32_wpan_sdk}/utilities/", + + #FREERTOS INCLUDES + "${freertos_st}/include", + "${stm32_config_files}/", + "${freertos_st}/portable/GCC/ARM_CM4F", + "${freertos_st}/portable", + "${freertos_st}/CMSIS_RTOS_V2", + +] + +DEFINES = [ + "CHIP_PROJECT_CONFIG_INCLUDE=", + "CHIP_HAVE_CONFIG_H", + "OPENTHREAD_CONFIG_FILE=", + "MBEDTLS_CONFIG_FILE=", + "CORE_CM4", + "THREAD_WB", + "STM32WB55xx", + "USE_STM32WB5M_DK", +] + +LIBS = [ + # add any .o/.a library here +] + +FLAGS = [ +] diff --git a/third_party/st/STM32CubeWB b/third_party/st/STM32CubeWB new file mode 160000 index 00000000000000..d23878380596ba --- /dev/null +++ b/third_party/st/STM32CubeWB @@ -0,0 +1 @@ +Subproject commit d23878380596ba031e33fcfa4841ff91aa1ab024 diff --git a/third_party/st/stm32_arm.gni b/third_party/st/stm32_arm.gni new file mode 100644 index 00000000000000..580506c483b5ca --- /dev/null +++ b/third_party/st/stm32_arm.gni @@ -0,0 +1,23 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("stm32_board.gni") + +if (stm32_family == "stm32wb55" || stm32_family == "stm32wb5") { + arm_arch = "armv7e-m" + arm_abi = "aapcs" + arm_cpu = "cortex-m4" + arm_float_abi = "hard" + arm_fpu = "fpv4-sp-d16" +} diff --git a/third_party/st/stm32_board.gni b/third_party/st/stm32_board.gni new file mode 100644 index 00000000000000..3d95d3576fb174 --- /dev/null +++ b/third_party/st/stm32_board.gni @@ -0,0 +1,36 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +declare_args() { + # STM32 board used + stm32_board = "" +} + +if (stm32_board == "") { + stm32_board = "STM32WB5MM-DK" +} + +assert(stm32_board != "", "stm32_board must be specified") + +# Differentiate between boards +# - STM32WB5MMG-DK / STM32WB55... / ZigBee-Thread 2.4GHz + +board_defines = [] + +if (stm32_board == "STM32WB5MM-DK") { + stm32_family = "stm32wb5" + stm32_mcu = "STM32WB5MMGHX" +} else { + assert(false, "The board ${stm32_board} not currently supported") +} diff --git a/third_party/st/stm32_executable.gni b/third_party/st/stm32_executable.gni new file mode 100644 index 00000000000000..fa2c8d14e28ee9 --- /dev/null +++ b/third_party/st/stm32_executable.gni @@ -0,0 +1,75 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +import("${build_root}/toolchain/flashable_executable.gni") + +template("stm32_executable") { + # -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- + # (Add .bin + .hex to .elf + flashing scripts in output dir/) + # -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- + + output_base_name = get_path_info(invoker.output_name, "name") + + objcopy_image_name = output_base_name + ".hex" + objcopy_image_format = "ihex" + objcopy = "arm-none-eabi-objcopy" + + # Copy flashing dependencies to the output directory so that the output + # is collectively self-contained; this allows flashing to work reliably + # even if the build and flashing steps take place on different machines + # or in different containers. + + flashing_runtime_target = target_name + ".flashing_runtime" + flashing_script_inputs = [ + "${chip_root}/scripts/flashing/stm32_firmware_utils.py", + "${chip_root}/scripts/flashing/firmware_utils.py", + ] + copy(flashing_runtime_target) { + sources = flashing_script_inputs + outputs = [ "${root_out_dir}/{{source_file_part}}" ] + } + + flashing_script_generator = + "${chip_root}/scripts/flashing/gen_flashing_script.py" + flashing_script_name = output_base_name + ".flash.py" + flashing_options = [ "stm32" ] + + flash_target_name = target_name + ".flash_executable" + flashbundle_name = "${target_name}.flashbundle.txt" + flashable_executable(flash_target_name) { + forward_variables_from(invoker, "*") + data_deps = [ ":${flashing_runtime_target}" ] + } + + # Add a target which generates the .bin file in addition to .hex. + executable_target = "$flash_target_name.executable" + bin_image_name = output_base_name + ".bin" + bin_target_name = target_name + ".bin" + objcopy_convert(bin_target_name) { + conversion_input = "${root_out_dir}/${invoker.output_name}" + conversion_output = "${root_out_dir}/${bin_image_name}" + conversion_target_format = "binary" + deps = [ ":$executable_target" ] + } + + group(target_name) { + deps = [ + ":$bin_target_name", + ":$flash_target_name", + ] + } +} diff --git a/third_party/st/stm32_sdk.gni b/third_party/st/stm32_sdk.gni new file mode 100644 index 00000000000000..eaa7775761ccbe --- /dev/null +++ b/third_party/st/stm32_sdk.gni @@ -0,0 +1,182 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") +import("//build_overrides/freertos.gni") +import("//build_overrides/mbedtls.gni") +import("//build_overrides/stm32_sdk.gni") + +import("${freertos_root}/freertos.gni") +import("${mbedtls_root}/mbedtls.gni") +import("stm32_board.gni") + +#import("${lwip_root}/lwip.gni") + +declare_args() { + kvs_max_entries = 75 + + use_external_flash = false + + stm32_sdk_root = "${chip_root}/third_party/st" + + stm32_ic_family = "STM32WB5MM-DK" +} + +if (stm32_family == "stm32wb5") { + use_stm32_wpan = true +} + +assert(stm32_sdk_root != "", "ST SDK root must be specified") + +# +# Defines an stm32 SDK build target. +# +# Parameters: +# stm32_sdk_root - The location of the stm32 SDK. +# sources - The sources files to build. +# +template("stm32_sdk") { + if (defined(invoker.stm32_sdk_root)) { + stm32_sdk_root = invoker.stm32_sdk_root + } + + assert(stm32_sdk_root != "", "stm32_sdk_root must be specified") + + use_stm32_wpan = false + if (defined(invoker.use_stm32_wpan)) { + if (invoker.use_stm32_wpan) { + use_stm32_wpan = true + } + } + + if (defined(invoker.stm32_target_ic)) { + stm_target_ic = invoker.stm32_target_ic + } + + sdk_target_name = target_name + + slist_stm32_board = + read_file("${stm32_sdk_root}/FAMILY/BOARD/${stm32_board}_sdk.gn_helper", + "scope") + slist_stm32_family = + read_file("${stm32_sdk_root}/FAMILY/${stm32_family}_sdk.gn_helper", + "scope") + + config("${sdk_target_name}_config") { + include_dirs = [] + + if (defined(invoker.include_dirs)) { + include_dirs += invoker.include_dirs + } + + libs = [ + # add any common .o/.a library here + ] + + # Treat these includes as system includes, so warnings in them are not fatal. + _include_dirs = [ + # common .h used by STM32 + ] + + defines = [ + # common defines + "DEBUG", + "USE_HAL_DRIVER", + ] + + # Note that we're setting the mbedTLS and PSA configuration files through a + # define. This means the build system by default does not pick up changes in + # the content of these, only when changing the filename itself. + # To fix this, these files are also manually depended upon in the source set + # declared in stm32_mbedtls_config further down this file. + if (stm32_family == "stm32wb5") { + defines += [ "MBEDTLS_USER_CONFIG_FILE=" ] + } + + if (defined(invoker.enable_sleepy_device)) { + if (invoker.enable_sleepy_device) { + defines += [ + "CHIP_DEVICE_CONFIG_ENABLE_SED=1", + "STM32_SLEEP_DEVICE", + ] + } + } + + _include_dirs += slist_stm32_board.INCLUDE_DIRS + _include_dirs += slist_stm32_family.INCLUDE_DIRS + + defines += slist_stm32_board.DEFINES + defines += slist_stm32_family.DEFINES + + libs += slist_stm32_board.LIBS + libs += slist_stm32_family.LIBS + + cflags = [] + foreach(include_dir, _include_dirs) { + cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] + } + + cflags += [ + "-Wno-maybe-uninitialized", + "-Wno-shadow", + ] + + cflags += slist_stm32_board.FLAGS + cflags += slist_stm32_family.FLAGS + + if (defined(invoker.defines)) { + defines += invoker.defines + } + } + + source_set("stm32_mbedtls_config") { + # We're setting the mbedTLS config flags here as the stm32_sdk target + # acts as the mbedTLS target for stm32 builds. We need this for the build + # system to recompile mbedTLS (= the SDK) when the mbedTLS config gets + # edited. + if (stm32_family == "stm32wb5") { + sources = [ + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/FreeRTOSConfig.h", + "${chip_root}/examples/platform/stm32/config_files/STM32WB5/matter_config.h", + ] + } + + public_deps = [ "${chip_root}/src/crypto:crypto_buildconfig" ] + } + + source_set(sdk_target_name) { + if (defined(invoker.enable_sleepy_device)) { + } + + sources = slist_stm32_family.SOURCES + sources += slist_stm32_board.SOURCES + + if ((defined(invoker.show_qr_code) && invoker.show_qr_code) || + (defined(invoker.disable_lcd) && !invoker.disable_lcd)) { + sources += [ + # + # + ] + } + + public_deps = [ ":stm32_mbedtls_config" ] + + if (defined(invoker.sources)) { + sources += invoker.sources + } + + public_configs = [ ":${sdk_target_name}_config" ] + } +} From ce417bac5e7f345810644e2c08378c2d4f3b87b7 Mon Sep 17 00:00:00 2001 From: weicheng Date: Thu, 7 Sep 2023 04:11:10 +0800 Subject: [PATCH 028/134] enable asr lwip lock assert; add more ASR CI (#29041) Co-authored-by: weicheng --- .github/workflows/examples-asr.yaml | 2 ++ src/inet/UDPEndPointImplLwIP.cpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 .github/workflows/examples-asr.yaml mode change 100644 => 100755 src/inet/UDPEndPointImplLwIP.cpp diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml old mode 100644 new mode 100755 index cc9a6ccdbab73b..f34af7876eecc0 --- a/.github/workflows/examples-asr.yaml +++ b/.github/workflows/examples-asr.yaml @@ -57,5 +57,7 @@ jobs: --target asr-asr582x-bridge-factory \ --target asr-asr582x-temperature-measurement-rotating_id \ --target asr-asr582x-thermostat-rio \ + --target asr-asr582x-dishwasher \ + --target asr-asr582x-refrigerator \ build \ " \ No newline at end of file diff --git a/src/inet/UDPEndPointImplLwIP.cpp b/src/inet/UDPEndPointImplLwIP.cpp old mode 100644 new mode 100755 index 8690fb3839377c..8db3d7e593e2b0 --- a/src/inet/UDPEndPointImplLwIP.cpp +++ b/src/inet/UDPEndPointImplLwIP.cpp @@ -41,8 +41,7 @@ static_assert(LWIP_VERSION_MAJOR > 1, "CHIP requires LwIP 2.0 or later"); -#if !(CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L || \ - CHIP_DEVICE_LAYER_TARGET_ASR) +#if !(CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L) static_assert(LWIP_TCPIP_CORE_LOCKING, "CHIP requires config LWIP_TCPIP_CORE_LOCKING enabled"); #endif From 0e7d3b718e89e4602cafb4a34de14085cf8b8676 Mon Sep 17 00:00:00 2001 From: Matt Hazley Date: Thu, 7 Sep 2023 08:48:50 +0100 Subject: [PATCH 029/134] Added Feature Map to read handler (#29098) --- .../concentration-measurement-server.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h index 391674bb844d95..c2799fd822cdf9 100644 --- a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h +++ b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h @@ -112,7 +112,7 @@ class Instance MeasurementMediumEnum mMeasurementMedium; - uint32_t mFeature = 0; + uint32_t mFeatureMap = 0; // AttributeAccessInterface CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override @@ -192,6 +192,10 @@ class Instance case Attributes::MeasurementMedium::Id: ReturnErrorOnFailure(aEncoder.Encode(mMeasurementMedium)); break; + + case Attributes::FeatureMap::Id: + ReturnErrorOnFailure(aEncoder.Encode(mFeatureMap)); + break; } return CHIP_NO_ERROR; @@ -351,7 +355,7 @@ class Instance // Register the object as attribute provider VerifyOrReturnError(registerAttributeAccessOverride(this), CHIP_ERROR_INCORRECT_STATE); - mFeature = GenerateFeatureMap(); + mFeatureMap = GenerateFeatureMap(); return CHIP_NO_ERROR; }; From 9a751256a122a78728f845b2d37b37edb7fb510c Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 7 Sep 2023 16:12:19 +0300 Subject: [PATCH 030/134] [Telink] Add B92 (tlsr9528a) SoC support & Update Telink image to 10 (#28841) * [Telink] Add tlsr9528a (B92) to CI * [Telink] Remove set board by default (Readme files needs to be updated) * [Telink] use B9X instead of B91 * [Telink] Add tlsr9528a (B92) DTS overlay * [Telink] temporarry disable BLE for Jenkins * [Telink] Use Zephyr sys_reboot instead of HAL version * Revert "[Telink] temporarry disable BLE for Jenkins" This reverts commit 066b0a26f3eb58e21a4e87118a42ada6b2a76355. * [Telink] use B9X instead of B91 * [Telink] Set correct BOOT_MAX_IMG_SECTORS for B92 * [Telink] Adopt to latest master chnages * [Telink] Add info how to build B9X * [Telink] Update partitions * [Telink] Reset default CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT * [Telink] Support USB dongle * [Telink] Update Telink image to 10 * Restyled * [Telink] Change bootloader log level * [Telink] Add Chef example to CI * [Telink] Use B9X * [Telink] Add chef bundle function * Restyled by autopep8 * [Telink] Divide CI apps between two SoCs --------- Co-authored-by: Andrii Bilynskyi Co-authored-by: Restyled.io --- .github/workflows/chef.yaml | 21 ++++ .github/workflows/examples-telink.yaml | 117 +++++++----------- config/telink/app/bootloader.conf | 20 ++- config/telink/app/zephyr.conf | 12 +- config/telink/chip-module/CMakeLists.txt | 17 ++- .../all-clusters-app/telink/CMakeLists.txt | 2 - examples/all-clusters-app/telink/Readme.md | 15 +-- .../telink/CMakeLists.txt | 2 - .../all-clusters-minimal-app/telink/Readme.md | 15 +-- examples/bridge-app/telink/CMakeLists.txt | 2 - examples/bridge-app/telink/README.md | 15 +-- examples/bridge-app/telink/prj.conf | 2 +- examples/chef/chef.py | 19 +++ examples/chef/telink/prj.conf | 2 +- .../contact-sensor-app/telink/CMakeLists.txt | 2 - examples/contact-sensor-app/telink/README.md | 15 +-- .../light-switch-app/telink/CMakeLists.txt | 2 - examples/light-switch-app/telink/README.md | 15 +-- examples/lighting-app/telink/CMakeLists.txt | 25 +++- examples/lighting-app/telink/README.md | 15 +-- examples/lighting-app/telink/prj.conf | 2 +- examples/lock-app/telink/CMakeLists.txt | 2 - examples/lock-app/telink/README.md | 15 +-- .../ota-requestor-app/telink/CMakeLists.txt | 2 - examples/ota-requestor-app/telink/Readme.md | 15 +-- .../telink/common/src/AppTaskCommon.cpp | 4 +- .../platform/telink/common/src/mainCommon.cpp | 27 ++++ .../telink/pw_sys_io/sys_io_telink.cc | 23 +++- examples/pump-app/telink/CMakeLists.txt | 2 - examples/pump-app/telink/README.md | 15 +-- .../pump-controller-app/telink/CMakeLists.txt | 2 - examples/pump-controller-app/telink/README.md | 15 +-- examples/shell/telink/CMakeLists.txt | 2 - examples/shell/telink/README.md | 15 +-- examples/shell/telink/prj.conf | 2 +- .../smoke-co-alarm-app/telink/CMakeLists.txt | 2 - examples/smoke-co-alarm-app/telink/README.md | 15 +-- examples/smoke-co-alarm-app/telink/prj.conf | 2 +- .../telink/CMakeLists.txt | 2 - .../telink/README.md | 15 +-- .../telink/prj.conf | 2 +- examples/thermostat/telink/CMakeLists.txt | 2 - examples/thermostat/telink/Readme.md | 15 +-- examples/window-app/telink/CMakeLists.txt | 2 - examples/window-app/telink/README.md | 15 +-- examples/window-app/telink/prj.conf | 2 +- integrations/cloudbuild/build-all.yaml | 1 + scripts/build/build/targets.py | 7 +- scripts/build/builders/telink.py | 5 +- .../build/testdata/all_targets_linux_x64.txt | 2 +- scripts/tools/telink/mfg_tool.py | 2 +- scripts/tools/telink/readme.md | 2 +- src/platform/Zephyr/ThreadStackManagerImpl.h | 4 +- src/platform/telink/ThreadStackManagerImpl.h | 4 +- src/platform/telink/tlsr9518adk80d.overlay | 32 ++--- src/platform/telink/tlsr9518adk80d_usb.conf | 4 + .../telink/tlsr9518adk80d_usb.overlay | 99 +++++++++++++++ .../telink/tlsr9518adk80d_usb_boot.overlay | 23 ++++ src/platform/telink/tlsr9528a.overlay | 112 +++++++++++++++++ 59 files changed, 590 insertions(+), 259 deletions(-) create mode 100644 src/platform/telink/tlsr9518adk80d_usb.conf create mode 100644 src/platform/telink/tlsr9518adk80d_usb.overlay create mode 100644 src/platform/telink/tlsr9518adk80d_usb_boot.overlay create mode 100644 src/platform/telink/tlsr9528a.overlay diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 76bbb9cf6da05c..c7268985a200fd 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -89,3 +89,24 @@ jobs: shell: bash run: | ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t nrfconnect" + + chef_telink: + name: Chef - Telink CI Examples + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' + + container: + image: ghcr.io/project-chip/chip-build-telink:10 + options: --user root + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: telink + - name: CI Examples Telink + shell: bash + run: | + ./scripts/run_in_build_env.sh "./examples/chef/chef.py --ci -t telink" diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 07b5ddc9a10f08..f7ddf8dc340e1d 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -1,4 +1,4 @@ -# Copyright (c) 2022 Project CHIP Authors +# Copyright (c) 2022-2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:1 + image: ghcr.io/project-chip/chip-build-telink:10 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -54,7 +54,7 @@ jobs: with: gh-context: ${{ toJson(github) }} - - name: Build example Telink All Clusters App + - name: Build example Telink (B91) All Clusters App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters' build" @@ -66,19 +66,19 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink All Clusters Minimal App + - name: Build example Telink (B92) All Clusters Minimal App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-all-clusters-minimal' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-all-clusters-minimal' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d all-clusters-minimal-app \ - out/telink-tlsr9518adk80d-all-clusters-minimal/zephyr/zephyr.elf \ + telink tlsr9528a all-clusters-minimal-app \ + out/telink-tlsr9528a-all-clusters-minimal/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Bridge App + - name: Build example Telink (B91) Bridge App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-bridge' build" @@ -90,70 +90,43 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Contact Sensor App + - name: Build example Telink (B92) Contact Sensor App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-contact-sensor' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-contact-sensor' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d contact-sensor-app \ - out/telink-tlsr9518adk80d-contact-sensor/zephyr/zephyr.elf \ + telink tlsr9528a contact-sensor-app \ + out/telink-tlsr9528a-contact-sensor/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Lighting App - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app \ - out/telink-tlsr9518adk80d-light/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink Lighting App with RPC - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc' build" - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-rpc \ - out/telink-tlsr9518adk80d-light-rpc/zephyr/zephyr.elf \ - /tmp/bloat_reports/ - - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink Lighting App with Shell + - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data run: | + ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux + ./scripts/build/gn_gen.sh + ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-shell' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-shell \ - out/telink-tlsr9518adk80d-light-shell/zephyr/zephyr.elf \ + telink tlsr9518adk80d lighting-app-rpc-shell-factory-data \ + out/telink-tlsr9518adk80d-light-rpc-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ - - name: clean out build output - run: rm -rf ./out - - - name: Build example Telink Lighting App with Factory Data + - name: Build example Telink (B92) Lighting App with RPC, Shell and Factory Data run: | - ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux - ./scripts/build/gn_gen.sh - ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-factory-data' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-light-rpc-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lighting-app-factory-data \ - out/telink-tlsr9518adk80d-light-factory-data/zephyr/zephyr.elf \ + telink tlsr9528a lighting-app-rpc-shell-factory-data \ + out/telink-tlsr9528a-light-rpc-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Light Switch App + - name: Build example Telink (B91) Light Switch App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-switch' build" @@ -165,19 +138,19 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Lock App + - name: Build example Telink (B92) Lock App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-lock' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-lock' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d lock-app \ - out/telink-tlsr9518adk80d-lock/zephyr/zephyr.elf \ + telink tlsr9528a lock-app \ + out/telink-tlsr9528a-lock/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink OTA Requestor App + - name: Build example Telink (B91) OTA Requestor App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-ota-requestor' build" @@ -189,19 +162,19 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Pump App + - name: Build example Telink (B92) Pump App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-pump' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d pump-app \ - out/telink-tlsr9518adk80d-pump/zephyr/zephyr.elf \ + telink tlsr9528a pump-app \ + out/telink-tlsr9528a-pump/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Pump Controller App + - name: Build example Telink (B91) Pump Controller App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-pump-controller' build" @@ -213,7 +186,7 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Shell App + - name: Build example Telink (B91) Shell App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-shell' build" @@ -225,31 +198,31 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Smoke CO Alarm App + - name: Build example Telink (B92) Smoke CO Alarm App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-smoke-co-alarm' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-smoke-co-alarm' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d smoke_co_alarm-app \ - out/telink-tlsr9518adk80d-smoke-co-alarm/zephyr/zephyr.elf \ + telink tlsr9528a smoke_co_alarm-app \ + out/telink-tlsr9528a-smoke-co-alarm/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Temperature Measurement App + - name: Build example Telink (B92) Temperature Measurement App run: | ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-temperature-measurement' build" + "./scripts/build/build_examples.py --target 'telink-tlsr9528a-temperature-measurement' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - telink tlsr9518adk80d temperature-measurement-app \ - out/telink-tlsr9518adk80d-temperature-measurement/zephyr/zephyr.elf \ + telink tlsr9528a temperature-measurement-app \ + out/telink-tlsr9528a-temperature-measurement/zephyr/zephyr.elf \ /tmp/bloat_reports/ - name: clean out build output run: rm -rf ./out - - name: Build example Telink Thermostat App + - name: Build example Telink (B91) Thermostat App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-thermostat' build" @@ -261,7 +234,7 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink Window Covering App + - name: Build example Telink (B91) Window Covering App run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-window-covering' build" diff --git a/config/telink/app/bootloader.conf b/config/telink/app/bootloader.conf index 5fb0182690cdaa..2098bc7072cb3d 100644 --- a/config/telink/app/bootloader.conf +++ b/config/telink/app/bootloader.conf @@ -16,7 +16,7 @@ # Enable this option in case if restoring the slot0 partition is expected from slot1 # partition in case if slot0 is not bootable or damaged -CONFIG_BOOT_BOOTSTRAP=n +CONFIG_BOOT_BOOTSTRAP=y # Enable this option in case if SWAP_MOVE logic need to be used CONFIG_BOOT_SWAP_USING_MOVE=y @@ -28,3 +28,21 @@ CONFIG_BOOT_SWAP_USING_SCRATCH=n # Enable this option in case if the whole slot0 image need to be validated # With disabled option the only image magic is validated CONFIG_BOOT_VALIDATE_SLOT0=y + +# Maximum number of image sectors supported by the bootloader. +CONFIG_BOOT_MAX_IMG_SECTORS=4096 + +# Sets log level for modules which don't specify it explicitly. +# When set to 0 it means log will not be activated for those modules. +# Levels are: +# - 0 OFF, do not write by default +# - 1 ERROR, default to only write LOG_LEVEL_ERR +# - 2 WARNING, default to write LOG_LEVEL_WRN +# - 3 INFO, default to write LOG_LEVEL_INFO +# - 4 DEBUG, default to write LOG_LEVEL_DBG +CONFIG_LOG_DEFAULT_LEVEL=1 + +# USB DFU configuration +CONFIG_USB_DFU_WILL_DETACH=n +CONFIG_BOOT_USB_DFU_GPIO=y +CONFIG_MCUBOOT_INDICATION_LED=y diff --git a/config/telink/app/zephyr.conf b/config/telink/app/zephyr.conf index 6948ce36b083d3..47c2b88f91aa3a 100644 --- a/config/telink/app/zephyr.conf +++ b/config/telink/app/zephyr.conf @@ -1,5 +1,5 @@ # -# Copyright (c) 2021 Project CHIP Authors +# Copyright (c) 2021-2023 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -111,22 +111,22 @@ CONFIG_OPENTHREAD_EXTERNAL_HEAP=y # Config dynamic interrupts to have posibility to switch between BLE/Thread radio drivers CONFIG_DYNAMIC_INTERRUPTS=y -# Set multiplicator of Name Value Storage (NVS) as 16 to reach NVS sector size 4096 -# nvs_sector_size = flash_page_size * mult = 256 * 16 = 4096 -CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=16 +# Set multiplicator of Name Value Storage (NVS) as 1 to reach NVS sector size 4KB +# nvs_sector_size = flash_page_size * mult = 4KB * 1 = 4KB +CONFIG_SETTINGS_NVS_SECTOR_SIZE_MULT=1 # Enable NVS lookup cache CONFIG_NVS_LOOKUP_CACHE=y CONFIG_NVS_LOOKUP_CACHE_SIZE=2048 # Reboot system when fault happened -CONFIG_TELINK_B91_REBOOT_ON_FAULT=y +CONFIG_TELINK_B9X_REBOOT_ON_FAULT=y # Shell settings CONFIG_SHELL=n # BLE MAC address -CONFIG_B91_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000 +CONFIG_B9X_BLE_CTRL_MAC_FLASH_ADDR=0x1FE000 # getopt version CONFIG_GETOPT_LONG=y diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index 26f0d58612abe8..bfb38cb5172c69 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -137,6 +137,17 @@ set_property(GLOBAL APPEND PROPERTY ZEPHYR_INTERFACE_LIBS chip) # Define 'chip-ota-image' target for building CHIP OTA image # ============================================================================== + +if(${TLNK_USB_DONGLE} MATCHES y) + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb_boot.overlay") + set(USB_BOOT_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb_boot.overlay") + else() + unset(USB_BOOT_DTC_OVERLAY_FILE) + endif() +else() + unset(USB_BOOT_DTC_OVERLAY_FILE) +endif() + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay") set(GLOBAL_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay") else() @@ -153,14 +164,14 @@ if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_custom_target(build_mcuboot ALL COMMAND west build -b ${BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr - -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE=${GLOBAL_DTC_OVERLAY_FILE} + -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DDTC_OVERLAY_FILE="${GLOBAL_DTC_OVERLAY_FILE};${USB_BOOT_DTC_OVERLAY_FILE}" ) add_custom_target(merge_mcuboot ALL COMMAND dd if=${PROJECT_BINARY_DIR}/../modules/chip-module/build_mcuboot/zephyr/zephyr.bin of=${PROJECT_BINARY_DIR}/zephyr.bin COMMAND - dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=76 + dd if=${PROJECT_BINARY_DIR}/zephyr.signed.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=100 ) chip_ota_image(chip-ota-image @@ -175,7 +186,7 @@ endif() if (CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE) add_custom_target(merge_factory_data ALL COMMAND - dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1040 + dd if=${PROJECT_BINARY_DIR}/factory/factory_data.bin of=${PROJECT_BINARY_DIR}/zephyr.bin bs=1024 seek=1052 ) if (CONFIG_CHIP_OTA_IMAGE_BUILD) add_dependencies(merge_factory_data merge_mcuboot) diff --git a/examples/all-clusters-app/telink/CMakeLists.txt b/examples/all-clusters-app/telink/CMakeLists.txt index aacc82ddc06b25..7ca03211176776 100644 --- a/examples/all-clusters-app/telink/CMakeLists.txt +++ b/examples/all-clusters-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/all-clusters-app/telink/Readme.md b/examples/all-clusters-app/telink/Readme.md index e05afa4e3a1e30..3684a8cf432eb2 100644 --- a/examples/all-clusters-app/telink/Readme.md +++ b/examples/all-clusters-app/telink/Readme.md @@ -11,31 +11,32 @@ creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/all-clusters-minimal-app/telink/CMakeLists.txt b/examples/all-clusters-minimal-app/telink/CMakeLists.txt index 410f305c3b317a..d852f1534d0d73 100644 --- a/examples/all-clusters-minimal-app/telink/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/all-clusters-minimal-app/telink/Readme.md b/examples/all-clusters-minimal-app/telink/Readme.md index 66eda43b732c9b..96d8dfc751ccf1 100644 --- a/examples/all-clusters-minimal-app/telink/Readme.md +++ b/examples/all-clusters-minimal-app/telink/Readme.md @@ -11,31 +11,32 @@ for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/bridge-app/telink/CMakeLists.txt b/examples/bridge-app/telink/CMakeLists.txt index 46953af249d8b7..58ed38fd93ba89 100644 --- a/examples/bridge-app/telink/CMakeLists.txt +++ b/examples/bridge-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/bridge-app/telink/README.md b/examples/bridge-app/telink/README.md index 7fe72ca3e5fa26..159516fcf9e476 100644 --- a/examples/bridge-app/telink/README.md +++ b/examples/bridge-app/telink/README.md @@ -88,31 +88,32 @@ defined: 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/bridge-app/telink/prj.conf b/examples/bridge-app/telink/prj.conf index 72b6dce7e2866c..ec4db478cf33b4 100644 --- a/examples/bridge-app/telink/prj.conf +++ b/examples/bridge-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/chef/chef.py b/examples/chef/chef.py index 7e1b6238c69484..841eed2001cf6b 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -248,6 +248,25 @@ def bundle_esp32(device_name: str) -> None: shutil.copy(src_item, dest_item) +def bundle_telink(device_name: str) -> None: + zephyr_exts = ["elf", "map", "bin"] + telink_root = os.path.join(_CHEF_SCRIPT_PATH, + "telink", + "build", + "zephyr") + sub_dir = os.path.join(_CD_STAGING_DIR, device_name) + os.mkdir(sub_dir) + for zephyr_ext in zephyr_exts: + input_base = f"zephyr.{zephyr_ext}" + output_base = f"{device_name}.{zephyr_ext}" + src_item = os.path.join(telink_root, input_base) + if zephyr_ext == "bin": + dest_item = os.path.join(sub_dir, output_base) + else: + dest_item = os.path.join(_CD_STAGING_DIR, output_base) + shutil.copy(src_item, dest_item) + + def main() -> int: check_python_version() diff --git a/examples/chef/telink/prj.conf b/examples/chef/telink/prj.conf index d83c730a8f61e2..2aa9402f0f1881 100755 --- a/examples/chef/telink/prj.conf +++ b/examples/chef/telink/prj.conf @@ -68,5 +68,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/contact-sensor-app/telink/CMakeLists.txt b/examples/contact-sensor-app/telink/CMakeLists.txt index 3f6a32566a3bba..2a6e63cbc284da 100755 --- a/examples/contact-sensor-app/telink/CMakeLists.txt +++ b/examples/contact-sensor-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/contact-sensor-app/telink/README.md b/examples/contact-sensor-app/telink/README.md index ec755135003da3..21c3c045f23f2d 100755 --- a/examples/contact-sensor-app/telink/README.md +++ b/examples/contact-sensor-app/telink/README.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/light-switch-app/telink/CMakeLists.txt b/examples/light-switch-app/telink/CMakeLists.txt index 18a5f83ac1ebbf..d05508812f04e9 100755 --- a/examples/light-switch-app/telink/CMakeLists.txt +++ b/examples/light-switch-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/light-switch-app/telink/README.md b/examples/light-switch-app/telink/README.md index 6b44caa1e0ba50..6e0cda2bcbf644 100755 --- a/examples/light-switch-app/telink/README.md +++ b/examples/light-switch-app/telink/README.md @@ -14,31 +14,32 @@ creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 16f6dfb4244663..986338c723651b 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -15,12 +15,27 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) +set(ignoreMe "${TLNK_USB_DONGLE}") + +if(${TLNK_USB_DONGLE} MATCHES y) + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.overlay") + set(USB_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.overlay") + else() + unset(USB_DTC_OVERLAY_FILE) + endif() + if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.conf") + set(USB_CONF_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}_usb.conf") + else() + unset(USB_CONF_OVERLAY_FILE) + endif() +else() + unset(USB_CONF_OVERLAY_FILE) +endif() + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") set(LOCAL_DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") else() @@ -35,14 +50,14 @@ endif() if(DTC_OVERLAY_FILE) set(DTC_OVERLAY_FILE - "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" CACHE STRING "" FORCE ) else() - set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${USB_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) endif() -set(CONF_FILE ${CHIP_ROOT}/config/telink/app/zephyr.conf prj.conf) +set(CONF_FILE ${CHIP_ROOT}/config/telink/app/zephyr.conf ${USB_CONF_OVERLAY_FILE} prj.conf) # Load NCS/Zephyr build system list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/telink/chip-module) diff --git a/examples/lighting-app/telink/README.md b/examples/lighting-app/telink/README.md index 286f289303500f..e774a8b1ecf87a 100644 --- a/examples/lighting-app/telink/README.md +++ b/examples/lighting-app/telink/README.md @@ -12,31 +12,32 @@ a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/lighting-app/telink/prj.conf b/examples/lighting-app/telink/prj.conf index 71a134523d33c8..141f820ae003dc 100644 --- a/examples/lighting-app/telink/prj.conf +++ b/examples/lighting-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 \ No newline at end of file diff --git a/examples/lock-app/telink/CMakeLists.txt b/examples/lock-app/telink/CMakeLists.txt index 98b3e5de27e567..66f5e432f96d92 100755 --- a/examples/lock-app/telink/CMakeLists.txt +++ b/examples/lock-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/lock-app/telink/README.md b/examples/lock-app/telink/README.md index 466e053b2a9944..b215fa543839dc 100755 --- a/examples/lock-app/telink/README.md +++ b/examples/lock-app/telink/README.md @@ -12,31 +12,32 @@ a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/ota-requestor-app/telink/CMakeLists.txt b/examples/ota-requestor-app/telink/CMakeLists.txt index f9dcafa515b74a..5d88c0c504121f 100644 --- a/examples/ota-requestor-app/telink/CMakeLists.txt +++ b/examples/ota-requestor-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/ota-requestor-app/telink/Readme.md b/examples/ota-requestor-app/telink/Readme.md index b072547d9e5a27..c04bbfcb463550 100755 --- a/examples/ota-requestor-app/telink/Readme.md +++ b/examples/ota-requestor-app/telink/Readme.md @@ -5,31 +5,32 @@ 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index 3a831ea0ef8fce..969f3c14638ae3 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -202,8 +202,8 @@ class PlatformMgrDelegate : public DeviceLayer::PlatformManagerDelegate }; #if CONFIG_CHIP_LIB_SHELL -#include #include +#include static int cmd_telink_reboot(const struct shell * shell, size_t argc, char ** argv) { @@ -211,7 +211,7 @@ static int cmd_telink_reboot(const struct shell * shell, size_t argc, char ** ar ARG_UNUSED(argv); shell_print(shell, "Performing board reboot..."); - sys_reboot(); + sys_reboot(0); return 0; } diff --git a/examples/platform/telink/common/src/mainCommon.cpp b/examples/platform/telink/common/src/mainCommon.cpp index 63c41b3a211982..d88a6a981dd985 100644 --- a/examples/platform/telink/common/src/mainCommon.cpp +++ b/examples/platform/telink/common/src/mainCommon.cpp @@ -23,10 +23,18 @@ #include +#ifdef CONFIG_USB_DEVICE_STACK +#include +#endif /* CONFIG_USB_DEVICE_STACK */ + #ifdef CONFIG_CHIP_PW_RPC #include "Rpc.h" #endif +#ifdef CONFIG_BOOTLOADER_MCUBOOT +#include +#endif /* CONFIG_BOOTLOADER_MCUBOOT */ + LOG_MODULE_REGISTER(app, CONFIG_CHIP_APP_LOG_LEVEL); using namespace ::chip; @@ -94,6 +102,10 @@ static void FactoryResetOnBoot(void) int main(void) { +#if defined(CONFIG_USB_DEVICE_STACK) && !defined(CONFIG_CHIP_PW_RPC) + usb_enable(NULL); +#endif /* CONFIG_USB_DEVICE_STACK */ + CHIP_ERROR err = CHIP_NO_ERROR; #ifdef CONFIG_CHIP_PW_RPC @@ -143,6 +155,21 @@ int main(void) goto exit; } +#ifdef CONFIG_BOOTLOADER_MCUBOOT + if (mcuboot_swap_type() == BOOT_SWAP_TYPE_REVERT) + { + int img_confirmation = boot_write_img_confirmed(); + if (img_confirmation) + { + LOG_ERR("Image not confirmed %d. Will be reverted!", img_confirmation); + } + else + { + LOG_INF("Image confirmed"); + } + } +#endif /* CONFIG_BOOTLOADER_MCUBOOT */ + err = GetAppTask().StartApp(); exit: diff --git a/examples/platform/telink/pw_sys_io/sys_io_telink.cc b/examples/platform/telink/pw_sys_io/sys_io_telink.cc index ff40aeadd6e583..4241e191110cea 100644 --- a/examples/platform/telink/pw_sys_io/sys_io_telink.cc +++ b/examples/platform/telink/pw_sys_io/sys_io_telink.cc @@ -22,17 +22,28 @@ #include #include -#ifdef CONFIG_USB +#ifdef CONFIG_USB_DEVICE_STACK #include + +static bool output_enable = false; + +static void usb_dc_status_change(enum usb_dc_status_code cb_status, const uint8_t * param) +{ + (void) param; + if (cb_status == USB_DC_CONFIGURED) + { + output_enable = true; + } +} #endif extern "C" void pw_sys_io_Init() { int err; -#ifdef CONFIG_USB - err = usb_enable(nullptr); - assert(err == 0); +#ifdef CONFIG_USB_DEVICE_STACK + output_enable = false; + (void) usb_enable(usb_dc_status_change); #endif err = console_init(); @@ -54,6 +65,10 @@ Status ReadByte(std::byte * dest) Status WriteByte(std::byte b) { +#ifdef CONFIG_USB_DEVICE_STACK + if (!output_enable) + return Status::FailedPrecondition(); +#endif return console_putchar(static_cast(b)) < 0 ? Status::FailedPrecondition() : OkStatus(); } diff --git a/examples/pump-app/telink/CMakeLists.txt b/examples/pump-app/telink/CMakeLists.txt index 03f3012008517b..70886f44fa82b4 100755 --- a/examples/pump-app/telink/CMakeLists.txt +++ b/examples/pump-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/pump-app/telink/README.md b/examples/pump-app/telink/README.md index 8b0dbda6b2add5..3500672a41720f 100755 --- a/examples/pump-app/telink/README.md +++ b/examples/pump-app/telink/README.md @@ -13,31 +13,32 @@ reference for creating your own pump application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/pump-controller-app/telink/CMakeLists.txt b/examples/pump-controller-app/telink/CMakeLists.txt index d5eeb88ee6d202..d45b4c8018bb77 100755 --- a/examples/pump-controller-app/telink/CMakeLists.txt +++ b/examples/pump-controller-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/pump-controller-app/telink/README.md b/examples/pump-controller-app/telink/README.md index 1e17a923ff896f..ab73fabc6346af 100755 --- a/examples/pump-controller-app/telink/README.md +++ b/examples/pump-controller-app/telink/README.md @@ -14,31 +14,32 @@ your own pump application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/shell/telink/CMakeLists.txt b/examples/shell/telink/CMakeLists.txt index debe82e67ee2cd..0c95e739097f63 100755 --- a/examples/shell/telink/CMakeLists.txt +++ b/examples/shell/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) get_filename_component(APP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/.. REALPATH) diff --git a/examples/shell/telink/README.md b/examples/shell/telink/README.md index ffbfce8a1867d3..d4a3c43e875180 100755 --- a/examples/shell/telink/README.md +++ b/examples/shell/telink/README.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/shell/telink/prj.conf b/examples/shell/telink/prj.conf index 3abb915e850fcd..7814bceb6be45c 100755 --- a/examples/shell/telink/prj.conf +++ b/examples/shell/telink/prj.conf @@ -69,5 +69,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=n # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/smoke-co-alarm-app/telink/CMakeLists.txt b/examples/smoke-co-alarm-app/telink/CMakeLists.txt index d6fa3994a89962..6df4292b041645 100755 --- a/examples/smoke-co-alarm-app/telink/CMakeLists.txt +++ b/examples/smoke-co-alarm-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/smoke-co-alarm-app/telink/README.md b/examples/smoke-co-alarm-app/telink/README.md index 02f78a25560065..20d4672b5688df 100755 --- a/examples/smoke-co-alarm-app/telink/README.md +++ b/examples/smoke-co-alarm-app/telink/README.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/smoke-co-alarm-app/telink/prj.conf b/examples/smoke-co-alarm-app/telink/prj.conf index 637c9bf1d752e1..819051b9b1cf05 100755 --- a/examples/smoke-co-alarm-app/telink/prj.conf +++ b/examples/smoke-co-alarm-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=y # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/temperature-measurement-app/telink/CMakeLists.txt b/examples/temperature-measurement-app/telink/CMakeLists.txt index 022eef1d319bce..35e0815a19f083 100644 --- a/examples/temperature-measurement-app/telink/CMakeLists.txt +++ b/examples/temperature-measurement-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/temperature-measurement-app/telink/README.md b/examples/temperature-measurement-app/telink/README.md index 964c0f27d39b2f..ac6fec9325e39c 100644 --- a/examples/temperature-measurement-app/telink/README.md +++ b/examples/temperature-measurement-app/telink/README.md @@ -13,31 +13,32 @@ creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/temperature-measurement-app/telink/prj.conf b/examples/temperature-measurement-app/telink/prj.conf index 63deb05cbddfcb..fe19cab9f70ad2 100644 --- a/examples/temperature-measurement-app/telink/prj.conf +++ b/examples/temperature-measurement-app/telink/prj.conf @@ -66,5 +66,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n CONFIG_PM=y # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/examples/thermostat/telink/CMakeLists.txt b/examples/thermostat/telink/CMakeLists.txt index 63744747849bfe..58b4c58485a57f 100755 --- a/examples/thermostat/telink/CMakeLists.txt +++ b/examples/thermostat/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/thermostat/telink/Readme.md b/examples/thermostat/telink/Readme.md index fdd4730c6f831a..905217a94a1ab8 100755 --- a/examples/thermostat/telink/Readme.md +++ b/examples/thermostat/telink/Readme.md @@ -9,31 +9,32 @@ You can use this example as a reference for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/window-app/telink/CMakeLists.txt b/examples/window-app/telink/CMakeLists.txt index ef7801e3728e6c..d4ca74d955d2db 100644 --- a/examples/window-app/telink/CMakeLists.txt +++ b/examples/window-app/telink/CMakeLists.txt @@ -15,8 +15,6 @@ # cmake_minimum_required(VERSION 3.13.1) -set(BOARD tlsr9518adk80d) - get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) diff --git a/examples/window-app/telink/README.md b/examples/window-app/telink/README.md index 9fef8eaa8972b1..7445e330a496d2 100644 --- a/examples/window-app/telink/README.md +++ b/examples/window-app/telink/README.md @@ -12,31 +12,32 @@ for creating your own application. 1. Pull docker image from repository: ```bash - $ docker pull ghcr.io/project-chip/chip-build-telink:1 + $ docker pull ghcr.io/project-chip/chip-build-telink:10 ``` -1. Run docker container: +2. Run docker container: ```bash - $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:1 + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 ``` here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** -1. Activate the build environment: +3. Activate the build environment: ```bash $ source ./scripts/activate.sh ``` -1. In the example dir run: +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): ```bash - $ west build + $ west build -b ``` -1. Flash binary: +5. Flash binary: ``` $ west flash --erase diff --git a/examples/window-app/telink/prj.conf b/examples/window-app/telink/prj.conf index 753040f73c6086..2a65b939cf343c 100644 --- a/examples/window-app/telink/prj.conf +++ b/examples/window-app/telink/prj.conf @@ -65,5 +65,5 @@ CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n CONFIG_PM=y # Custom RF power values -CONFIG_B91_BLE_CTRL_RF_POWER_P9P11DBM=y +CONFIG_B9X_BLE_CTRL_RF_POWER_P9P11DBM=y CONFIG_OPENTHREAD_DEFAULT_TX_POWER=9 diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index a1a8a1832d8726..dc66ec8eda7eb1 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -163,6 +163,7 @@ steps: --target qpg-qpg6105-light --target qpg-qpg6105-shell --target telink-tlsr9518adk80d-light + --target telink-tlsr9528a-light --target tizen-arm-light build --create-archives /workspace/artifacts/ diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 7f8f3812b95e01..0414a7e820fce7 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -674,8 +674,11 @@ def BuildGenioTarget(): def BuildTelinkTarget(): target = BuildTarget('telink', TelinkBuilder) - target.AppendFixedTargets( - [TargetPart('tlsr9518adk80d', board=TelinkBoard.TLSR9518ADK80D)]) + + target.AppendFixedTargets([ + TargetPart('tlsr9518adk80d', board=TelinkBoard.TLSR9518ADK80D), + TargetPart('tlsr9528a', board=TelinkBoard.TLSR9528A), + ]) target.AppendFixedTargets([ TargetPart('all-clusters', app=TelinkApp.ALL_CLUSTERS), diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index f023207146712c..754bc077f46254 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -108,10 +108,13 @@ def AppNamePrefix(self): class TelinkBoard(Enum): TLSR9518ADK80D = auto() + TLSR9528A = auto() def GnArgName(self): if self == TelinkBoard.TLSR9518ADK80D: return 'tlsr9518adk80d' + elif self == TelinkBoard.TLSR9528A: + return 'tlsr9528a' else: raise Exception('Unknown board type: %r' % self) @@ -122,7 +125,7 @@ def __init__(self, root, runner, app: TelinkApp = TelinkApp, - board: TelinkBoard = TelinkBoard.TLSR9518ADK80D, + board: TelinkBoard = TelinkBoard, enable_shell: bool = False, enable_rpcs: bool = False, enable_factory_data: bool = False): diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 44ca9c3fe2480d..7e945289bcb21c 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -22,5 +22,5 @@ nrf-native-posix-64-tests qpg-qpg6105-{lock,light,shell,persistent-storage} stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan] -telink-tlsr9518adk80d-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] +telink-{tlsr9518adk80d,tlsr9528a}-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] openiotsdk-{shell,lock}[-mbedtls][-psa] diff --git a/scripts/tools/telink/mfg_tool.py b/scripts/tools/telink/mfg_tool.py index 286648c37185d8..3725707d7c9c78 100644 --- a/scripts/tools/telink/mfg_tool.py +++ b/scripts/tools/telink/mfg_tool.py @@ -642,7 +642,7 @@ def base64_str(s): return base64.b64decode(s) basic_args.add_argument('--part_number', type=str, required=False, help='Provide human-readable product number') part_gen_args = parser.add_argument_group('Partition generator options') - part_gen_args.add_argument('--offset', type=allow_any_int, default=0x104000, + part_gen_args.add_argument('--offset', type=allow_any_int, default=0x107000, help='Partition offset - an address in devices NVM memory, where factory data will be stored') part_gen_args.add_argument('--size', type=allow_any_int, default=0x1000, help='The maximum partition size') diff --git a/scripts/tools/telink/readme.md b/scripts/tools/telink/readme.md index 1ee492c2ffc695..37e0418342436d 100644 --- a/scripts/tools/telink/readme.md +++ b/scripts/tools/telink/readme.md @@ -188,7 +188,7 @@ You can try one of these factory partition FW on developing stage. > [v1.0-branch](https://github.com/telink-semi/zephyr/blob/telink_matter_v1.0-branch/boards/riscv/tlsr9518adk80d/tlsr9518adk80d.dts) > is `0xF4000` and for > [master branch](https://github.com/telink-semi/zephyr/blob/telink_matter/boards/riscv/tlsr9518adk80d/tlsr9518adk80d.dts) - > is `0x104000`. You can check the `factory_partition` reg at + > is `0x107000`. You can check the `factory_partition` reg at > `tlsr9518adk80d.dts` for details. For example, the `factory_data_bin` with serial number diff --git a/src/platform/Zephyr/ThreadStackManagerImpl.h b/src/platform/Zephyr/ThreadStackManagerImpl.h index d9a9020dfadf5c..1345a9ba27bc5a 100644 --- a/src/platform/Zephyr/ThreadStackManagerImpl.h +++ b/src/platform/Zephyr/ThreadStackManagerImpl.h @@ -29,9 +29,9 @@ #include #include -#if !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#if !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include -#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include diff --git a/src/platform/telink/ThreadStackManagerImpl.h b/src/platform/telink/ThreadStackManagerImpl.h index 508382332072c6..d1040542f3c616 100644 --- a/src/platform/telink/ThreadStackManagerImpl.h +++ b/src/platform/telink/ThreadStackManagerImpl.h @@ -29,9 +29,9 @@ #include #include -#if !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#if !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include -#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B91 +#endif // !CONFIG_SOC_SERIES_RISCV_TELINK_B9X #include diff --git a/src/platform/telink/tlsr9518adk80d.overlay b/src/platform/telink/tlsr9518adk80d.overlay index 22b5ac801ac974..32fbb3f5661809 100644 --- a/src/platform/telink/tlsr9518adk80d.overlay +++ b/src/platform/telink/tlsr9518adk80d.overlay @@ -61,16 +61,16 @@ &pinctrl { pwm_ch0_pb4_default: pwm_ch0_pb4_default { - pinmux = ; + pinmux = ; }; pwm_ch1_pb5_default: pwm_ch1_pb5_default { - pinmux = ; + pinmux = ; }; pwm_ch2_pe2_default: pwm_ch2_pe2_default { - pinmux = ; + pinmux = ; }; pwm_ch3_pe0_default: pwm_ch3_pe0_default { - pinmux = ; + pinmux = ; }; }; @@ -83,30 +83,30 @@ partitions { /delete-node/ partition@0; - /delete-node/ partition@18000; - /delete-node/ partition@84000; + /delete-node/ partition@20000; + /delete-node/ partition@88000; /delete-node/ partition@f0000; /delete-node/ partition@f4000; boot_partition: partition@0 { label = "mcuboot"; - reg = <0x00000000 0x13000>; + reg = <0x00000000 0x19000>; }; - slot0_partition: partition@13000 { + slot0_partition: partition@19000 { label = "image-0"; - reg = <0x13000 0xf1000>; + reg = <0x19000 0xee000>; }; - factory_partition: partition@104000 { + factory_partition: partition@107000 { label = "factory-data"; - reg = <0x104000 0x1000>; + reg = <0x107000 0x1000>; }; - storage_partition: partition@105000 { + storage_partition: partition@108000 { label = "storage"; - reg = <0x105000 0x8000>; + reg = <0x108000 0x8000>; }; - slot1_partition: partition@10d000 { + slot1_partition: partition@110000 { label = "image-1"; - reg = <0x10d000 0xf1000>; + reg = <0x110000 0xee000>; }; /* region <0x1fe000 0x2000> is reserved for Telink B91 SDK's data */ }; -}; \ No newline at end of file +}; diff --git a/src/platform/telink/tlsr9518adk80d_usb.conf b/src/platform/telink/tlsr9518adk80d_usb.conf new file mode 100644 index 00000000000000..3e0b1849d2969c --- /dev/null +++ b/src/platform/telink/tlsr9518adk80d_usb.conf @@ -0,0 +1,4 @@ +CONFIG_USB_DEVICE_STACK=y +CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n +CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y +CONFIG_CHIP_BUTTON_MANAGER_IRQ_MODE=y diff --git a/src/platform/telink/tlsr9518adk80d_usb.overlay b/src/platform/telink/tlsr9518adk80d_usb.overlay new file mode 100644 index 00000000000000..f2523794a0d110 --- /dev/null +++ b/src/platform/telink/tlsr9518adk80d_usb.overlay @@ -0,0 +1,99 @@ +/ { + chosen { + zephyr,console = &cdc_acm_uart0; + zephyr,shell-uart = &cdc_acm_uart0; + }; + + keys { + /delete-node/ button_1; + /delete-node/ button_2; + /delete-node/ button_3; + /delete-node/ button_4; + + key_1: button_1 { + gpios = <&gpiob 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_2: button_2 { + gpios = <&gpioc 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_3: button_3 { + gpios = <&gpioc 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_4: button_4 { + gpios = <&gpiob 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + }; + + pwm_leds { + /delete-node/ pwm_led_0; + /delete-node/ pwm_led_1; + /delete-node/ pwm_led_2; + /delete-node/ pwm_led_3; + + pwm_led0: pwm_led_0 { + pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Blue"; + }; + pwm_led1: pwm_led_1 { + pwms = <&pwm0 5 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Green"; + }; + pwm_led2: pwm_led_2 { + pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Red"; + }; + pwm_led3: pwm_led_3 { + pwms = <&pwm0 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM IDENTIFY LED White"; + }; + }; + + aliases { + system-state-led = &led_yellow; + }; + + leds { + led_yellow: led_yellow { + gpios = <&gpiob 5 GPIO_ACTIVE_HIGH>; + label = "LED Yellow"; + }; + }; +}; + +&pinctrl { + pwm_ch2_pb7_default: pwm_ch2_pb7_default { + pinmux = ; + }; + pwm_ch5_pb0_default: pwm_ch5_pb0_default { + pinmux = ; + }; + pwm_ch0_pb4_default: pwm_ch0_pb4_default { + pinmux = ; + }; + pwm_ch3_pb1_default: pwm_ch3_pb1_default { + pinmux = ; + }; +}; + +&pwm0 { + pinctrl-0 = <&pwm_ch2_pb7_default &pwm_ch5_pb0_default &pwm_ch0_pb4_default &pwm_ch3_pb1_default>; +}; + + +&zephyr_udc0 { + cdc_acm_uart0: cdc_acm_uart0 { + compatible = "zephyr,cdc-acm-uart"; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_pa3_default &uart0_rx_pa4_default>; +}; + +&gpiob { + interrupts = <37 1>; +}; + +&gpioc { + interrupts = <38 1>; +}; diff --git a/src/platform/telink/tlsr9518adk80d_usb_boot.overlay b/src/platform/telink/tlsr9518adk80d_usb_boot.overlay new file mode 100644 index 00000000000000..7eeb3a96eb6e50 --- /dev/null +++ b/src/platform/telink/tlsr9518adk80d_usb_boot.overlay @@ -0,0 +1,23 @@ +/ { + leds { + /delete-node/ led_0; + + led_blue: led_0 { + gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>; + label = "LED Blue"; + }; + }; + + keys { + /delete-node/ button_dfu; + + key_dfu: button_dfu { + label = "USB DFU"; + gpios = <&gpiob 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + }; +}; + +&uart0 { + pinctrl-0 = <&uart0_tx_pa3_default &uart0_rx_pa4_default>; +}; diff --git a/src/platform/telink/tlsr9528a.overlay b/src/platform/telink/tlsr9528a.overlay new file mode 100644 index 00000000000000..996981e6834b0b --- /dev/null +++ b/src/platform/telink/tlsr9528a.overlay @@ -0,0 +1,112 @@ +/ { + aliases { + system-state-led = &led_red; + pwm-led0 = &pwm_led0; + pwm-led1 = &pwm_led1; + pwm-led2 = &pwm_led2; + pwm-led3 = &pwm_led3; + }; + + pwm_leds { + /delete-node/ pwm_led_0; + pwm_led0: pwm_led_0 { + pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Blue"; + }; + pwm_led1: pwm_led_1 { + pwms = <&pwm0 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Green"; + }; + pwm_led2: pwm_led_2 { + pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM LED Red"; + }; + pwm_led3: pwm_led_3 { + pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + label = "PWM IDENTIFY LED Green"; + }; + }; + + keys { + /delete-node/ button_1; + /delete-node/ button_3; + compatible = "gpio-keys"; + key_1: button_1 { + gpios = <&gpiod 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_2: button_2 { + gpios = <&gpiod 7 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_3: button_3 { + gpios = <&gpiod 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + key_4: button_4 { + gpios = <&gpiof 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>; + }; + + key_matrix_col1: key_matrix_col1 { + gpios = <&gpiod 6 GPIO_ACTIVE_HIGH>; + }; + key_matrix_col2: key_matrix_col2 { + gpios = <&gpiof 6 GPIO_ACTIVE_HIGH>; + }; + key_matrix_row1: key_matrix_row1 { + gpios = <&gpiod 2 GPIO_PULL_DOWN>; + }; + key_matrix_row2: key_matrix_row2 { + gpios = <&gpiod 7 GPIO_PULL_DOWN>; + }; + }; +}; + +&pinctrl { + pwm_ch0_pd0_default: pwm_ch0_pd0_default { + pinmux = ; + }; + pwm_ch1_pd1_default: pwm_ch1_pd1_default { + pinmux = ; + }; + pwm_ch2_pe2_default: pwm_ch2_pe2_default { + pinmux = ; + }; + pwm_ch3_pe0_default: pwm_ch3_pe0_default { + pinmux = ; + }; +}; + +&pwm0 { + pinctrl-0 = <&pwm_ch0_pd0_default &pwm_ch1_pd1_default &pwm_ch2_pe2_default &pwm_ch3_pe0_default>; +}; + +&flash { + reg = <0x20000000 0x200000>; + + partitions { + /delete-node/ partition@0; + /delete-node/ partition@20000; + /delete-node/ partition@88000; + /delete-node/ partition@f0000; + /delete-node/ partition@f4000; + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 0x19000>; + }; + slot0_partition: partition@19000 { + label = "image-0"; + reg = <0x19000 0xee000>; + }; + factory_partition: partition@107000 { + label = "factory-data"; + reg = <0x107000 0x1000>; + }; + storage_partition: partition@108000 { + label = "storage"; + reg = <0x108000 0x8000>; + }; + slot1_partition: partition@110000 { + label = "image-1"; + reg = <0x110000 0xee000>; + }; + /* region <0x1fe000 0x2000> is reserved for Telink B92 SDK's data */ + }; +}; From b0bc001a098031f71079b4397cb4962f4bcf2dce Mon Sep 17 00:00:00 2001 From: Matt Hazley Date: Thu, 7 Sep 2023 14:13:52 +0100 Subject: [PATCH 031/134] Added Feature Map to `AirQuality` Read Handler (#29105) * Added Feature Map to read handler * Set the air quality feature map to zero in zapfile so that we are sure the value is being encoded by the read handler --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-common/all-clusters-app.zap | 8 ++++---- .../clusters/air-quality-server/air-quality-server.cpp | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 58f744659d5801..705324367f39e9 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -6826,7 +6826,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 15; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index bcd0bb239ab26d..191519900a4990 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -10495,7 +10495,7 @@ ] }, { - "id": 4, + "id": 2, "name": "MA-onofflight", "deviceTypeRef": { "code": 256, @@ -16926,7 +16926,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "15", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -34866,7 +34866,7 @@ ] }, { - "id": 2, + "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { "code": 61442, @@ -35394,4 +35394,4 @@ } ], "log": [] -} +} \ No newline at end of file diff --git a/src/app/clusters/air-quality-server/air-quality-server.cpp b/src/app/clusters/air-quality-server/air-quality-server.cpp index 875bd4c4dfa9bb..f9ff17bc4fe53f 100644 --- a/src/app/clusters/air-quality-server/air-quality-server.cpp +++ b/src/app/clusters/air-quality-server/air-quality-server.cpp @@ -115,6 +115,9 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu case Attributes::AirQuality::Id: ReturnErrorOnFailure(aEncoder.Encode(mAirQuality)); break; + case Attributes::FeatureMap::Id: + ReturnErrorOnFailure(aEncoder.Encode(mFeature.Raw())); + break; } return CHIP_NO_ERROR; } From 27ab38892792182a2eaab7d7d1fceffc5e764593 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 7 Sep 2023 06:15:59 -0700 Subject: [PATCH 032/134] Reture result directly instead of via reference (#29078) --- .../ManualOnboardingPayloadParser.kt | 5 +- .../OnboardingPayloadParser.kt | 7 +- .../QRCodeOnboardingPayloadParser.kt | 5 +- .../chip/onboardingpayload/ManualCodeTest.kt | 82 +++++++++++-------- .../chip/onboardingpayload/QRCodeTest.kt | 14 +--- 5 files changed, 61 insertions(+), 52 deletions(-) diff --git a/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt b/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt index f913a9d99206c8..3e2bac7be7d287 100644 --- a/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt +++ b/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt @@ -30,8 +30,9 @@ class ManualOnboardingPayloadParser(decimalRepresentation: String) { decimalStringRepresentation = decimalRepresentation.replace("-", "") } - fun populatePayload(outPayload: OnboardingPayload): Unit { + fun populatePayload(): OnboardingPayload { var representationWithoutCheckDigit: String + var outPayload: OnboardingPayload = OnboardingPayload() representationWithoutCheckDigit = checkDecimalStringValidity(decimalStringRepresentation) @@ -125,6 +126,8 @@ class ManualOnboardingPayloadParser(decimalRepresentation: String) { require(kManualSetupDiscriminatorFieldLengthInBits <= 8) { "Won't fit in UInt8" } outPayload.discriminator = discriminator outPayload.hasShortDiscriminator = true + + return outPayload } companion object { diff --git a/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt b/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt index e1d8357908e236..cef151816f9d6c 100644 --- a/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt +++ b/src/controller/java/src/chip/onboardingpayload/OnboardingPayloadParser.kt @@ -54,9 +54,7 @@ class OnboardingPayloadParser { qrCodeString: String, skipPayloadValidation: Boolean ): OnboardingPayload { - val payload = OnboardingPayload() - - QRCodeOnboardingPayloadParser(qrCodeString).populatePayload(payload) + val payload = QRCodeOnboardingPayloadParser(qrCodeString).populatePayload() if (skipPayloadValidation == false && !payload.isValidQRCodePayload()) { throw OnboardingPayloadException("Invalid payload") @@ -103,8 +101,7 @@ class OnboardingPayloadParser { manualPairingCodeString: String, skipPayloadValidation: Boolean ): OnboardingPayload { - val payload = OnboardingPayload() - ManualOnboardingPayloadParser(manualPairingCodeString).populatePayload(payload) + val payload = ManualOnboardingPayloadParser(manualPairingCodeString).populatePayload() if (skipPayloadValidation == false && !payload.isValidManualCode()) { throw OnboardingPayloadException("Invalid manual entry code") diff --git a/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt b/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt index 18d91e8b2b4f45..ef33405114e1ee 100644 --- a/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt +++ b/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt @@ -24,8 +24,9 @@ import java.util.concurrent.atomic.AtomicInteger * to a OnboardingPayload object */ class QRCodeOnboardingPayloadParser(private val mBase38Representation: String) { - fun populatePayload(outPayload: OnboardingPayload) { + fun populatePayload(): OnboardingPayload { var indexToReadFrom: AtomicInteger = AtomicInteger(0) + var outPayload: OnboardingPayload = OnboardingPayload() val payload = extractPayload(mBase38Representation) if (payload.length == 0) { @@ -60,6 +61,8 @@ class QRCodeOnboardingPayloadParser(private val mBase38Representation: String) { } // TODO: populate TLV optional fields + + return outPayload } companion object { diff --git a/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt b/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt index 51fb0bfc0c51ac..acaf7e8d4758b9 100644 --- a/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt +++ b/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt @@ -165,8 +165,7 @@ class ManualCodeTest { // Test short 11 digit code var generator = ManualOnboardingPayloadGenerator(payload) var result = generator.payloadDecimalStringRepresentation() - var outPayload = OnboardingPayload() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + var outPayload = ManualOnboardingPayloadParser(result).populatePayload() assertPayloadValues( outPayload, payload.setupPinCode, @@ -183,8 +182,7 @@ class ManualCodeTest { // Test long 21 digit code generator = ManualOnboardingPayloadGenerator(payload) result = generator.payloadDecimalStringRepresentation() - outPayload = OnboardingPayload() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + outPayload = ManualOnboardingPayloadParser(result).populatePayload() assertPayloadValues( outPayload, payload.setupPinCode, @@ -216,12 +214,11 @@ class ManualCodeTest { */ @Test fun testPayloadParser_partialPayload() { - val payload = getDefaultPayload() var decimalString = "2361087535" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(11, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + var payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -234,7 +231,7 @@ class ManualCodeTest { decimalString = "236-108753-5" decimalString += computeCheckChar(decimalString) assertEquals(13, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -246,13 +243,13 @@ class ManualCodeTest { decimalString = "0000010000" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(11, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues(payload, pinCode = 1, discriminator = 0, vendorId = 0, productId = 0) decimalString = "63610875350000000000" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(21, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -265,19 +262,40 @@ class ManualCodeTest { decimalString = "0033407535" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(11, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() + assertPayloadValues( + payload, + pinCode = 123456780, + discriminator = 0, + vendorId = 0, + productId = 0 + ) // no vid (= 0) decimalString = "63610875350000014526" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(21, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() + assertPayloadValues( + payload, + pinCode = 123456780, + discriminator = 0xa, + vendorId = 0, + productId = 14526 + ) // no pid (= 0) decimalString = "63610875354536700000" decimalString += Verhoeff10.computeCheckChar(decimalString) assertEquals(21, decimalString.length) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() + assertPayloadValues( + payload, + pinCode = 123456780, + discriminator = 0xa, + vendorId = 45367, + productId = 0 + ) } /* @@ -285,11 +303,10 @@ class ManualCodeTest { */ @Test fun testPayloadParser_fullPayload() { - val payload = getDefaultPayload() var decimalString = "63610875354536714526" decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + var payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -301,7 +318,7 @@ class ManualCodeTest { // The same thing, but with dashes separating digit groups. decimalString = "6361-0875-3545-3671-4526" decimalString += computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 123456780, @@ -312,7 +329,7 @@ class ManualCodeTest { decimalString = "52927623630456200032" decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues( payload, pinCode = 38728284, @@ -323,7 +340,7 @@ class ManualCodeTest { decimalString = "40000100000000100001" decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() assertPayloadValues(payload, pinCode = 1, discriminator = 0, vendorId = 1, productId = 1) } @@ -332,13 +349,13 @@ class ManualCodeTest { */ @Test fun testPayloadParser_invalidEntry() { - val payload = OnboardingPayload() + var payload = OnboardingPayload() // Empty input var decimalString = "" decimalString += Verhoeff10.computeCheckChar(decimalString) try { - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -348,7 +365,7 @@ class ManualCodeTest { decimalString = "24184.2196" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -358,7 +375,7 @@ class ManualCodeTest { decimalString = "2456" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -368,7 +385,7 @@ class ManualCodeTest { decimalString = "123456789123456785671" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -378,7 +395,7 @@ class ManualCodeTest { decimalString = "12749875380" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -388,7 +405,7 @@ class ManualCodeTest { decimalString = "23456789123456785610" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -398,7 +415,7 @@ class ManualCodeTest { decimalString = "2327680000" try { decimalString += Verhoeff10.computeCheckChar(decimalString) - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -407,7 +424,7 @@ class ManualCodeTest { // wrong check digit decimalString = "02684354589" try { - ManualOnboardingPayloadParser(decimalString).populatePayload(payload) + payload = ManualOnboardingPayloadParser(decimalString).populatePayload() } catch (e: Exception) { println("Expected exception occurred: ${e.message}") } @@ -420,11 +437,9 @@ class ManualCodeTest { @Test fun testShortCodeReadWrite() { val inPayload = getDefaultPayload() - val outPayload = OnboardingPayload() - var generator = ManualOnboardingPayloadGenerator(inPayload) var result = generator.payloadDecimalStringRepresentation() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + val outPayload = ManualOnboardingPayloadParser(result).populatePayload() // Override the discriminator in the input payload with the short version, // since that's what we will produce. @@ -442,10 +457,9 @@ class ManualCodeTest { inPayload.vendorId = 1 inPayload.productId = 1 - val outPayload = OnboardingPayload() var generator = ManualOnboardingPayloadGenerator(inPayload) var result = generator.payloadDecimalStringRepresentation() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + val outPayload = ManualOnboardingPayloadParser(result).populatePayload() // Override the discriminator in the input payload with the short version, // since that's what we will produce. @@ -651,8 +665,7 @@ class ManualCodeTest { val generator = ManualOnboardingPayloadGenerator(payload) val result = generator.payloadDecimalStringRepresentation() - val outPayload = OnboardingPayload() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + val outPayload = ManualOnboardingPayloadParser(result).populatePayload() assertPayloadValues( outPayload, @@ -672,8 +685,7 @@ class ManualCodeTest { val generator = ManualOnboardingPayloadGenerator(payload) val result = generator.payloadDecimalStringRepresentation() - val outPayload = OnboardingPayload() - ManualOnboardingPayloadParser(result).populatePayload(outPayload) + val outPayload = ManualOnboardingPayloadParser(result).populatePayload() assertPayloadValues( outPayload, diff --git a/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt b/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt index afbfdd0e3e477d..92ad1bf8c55909 100644 --- a/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt +++ b/src/controller/java/tests/chip/onboardingpayload/QRCodeTest.kt @@ -48,8 +48,7 @@ class QRCodeTest { generator.setAllowInvalidPayload(allowInvalidPayload) var result = generator.payloadBase38Representation() - var outPayload = OnboardingPayload() - QRCodeOnboardingPayloadParser(result).populatePayload(outPayload) + var outPayload = QRCodeOnboardingPayloadParser(result).populatePayload() return inPayload == outPayload } @@ -223,10 +222,8 @@ class QRCodeTest { var invalidString = kDefaultPayloadQRCode invalidString = invalidString.dropLast(1) + " " // space is not contained in the base38 alphabet - var payload = OnboardingPayload() - try { - QRCodeOnboardingPayloadParser(invalidString).populatePayload(payload) + QRCodeOnboardingPayloadParser(invalidString).populatePayload() assertThat(false) } catch (e: Exception) { println("Expected exception occurred: ${e.message}") @@ -241,10 +238,8 @@ class QRCodeTest { var invalidString = kDefaultPayloadQRCode invalidString = invalidString.dropLast(1) - var payload = OnboardingPayload() - try { - QRCodeOnboardingPayloadParser(invalidString).populatePayload(payload) + QRCodeOnboardingPayloadParser(invalidString).populatePayload() assertThat(false) } catch (e: Exception) { println("Expected exception occurred: ${e.message}") @@ -284,8 +279,7 @@ class QRCodeTest { var generator = QRCodeOnboardingPayloadGenerator(payload) var base38Rep = generator.payloadBase38Representation() - var resultingPayload = OnboardingPayload() - QRCodeOnboardingPayloadParser(base38Rep).populatePayload(resultingPayload) + var resultingPayload = QRCodeOnboardingPayloadParser(base38Rep).populatePayload() assertEquals(true, resultingPayload.isValidQRCodePayload()) assertEquals(true, payload == resultingPayload) From 5867ac5a69a2bc93ca1e38b93ab4098d878b1420 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Thu, 7 Sep 2023 09:17:27 -0400 Subject: [PATCH 033/134] [Scenes] Level control handler bugfix (#29076) * Used NumericAttributesTraits for storage null values, removed un-necessary typing and added doc on on-off and level control handlers interactions * Update src/app/clusters/on-off-server/on-off-server.cpp Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> --------- Co-authored-by: Junior Martinez <67972863+jmartinez-silabs@users.noreply.github.com> --- .../clusters/level-control/level-control.cpp | 19 +++++++++++++------ .../clusters/on-off-server/on-off-server.cpp | 5 +++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index b61d2c34156570..28f7c16573d86f 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -171,9 +171,16 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl uint8_t maxLevel; VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == Attributes::MaxLevel::Get(endpoint, &maxLevel), CHIP_ERROR_READ_FAILED); - pairs[0].attributeID = Attributes::CurrentLevel::Id; - pairs[0].attributeValue = (!level.IsNull()) ? level.Value() : maxLevel + 1; - size_t attributeCount = 1; + pairs[0].attributeID = Attributes::CurrentLevel::Id; + if (!level.IsNull()) + { + pairs[0].attributeValue = level.Value(); + } + else + { + chip::app::NumericAttributeTraits::SetNull(pairs[0].attributeValue); + } + size_t attributeCount = 1; if (LevelControlHasFeature(endpoint, LevelControl::Feature::kFrequency)) { uint16_t frequency; @@ -238,9 +245,9 @@ class DefaultLevelControlSceneHandler : public scenes::DefaultSceneHandlerImpl CommandId command = LevelControlHasFeature(endpoint, LevelControl::Feature::kOnOff) ? Commands::MoveToLevelWithOnOff::Id : Commands::MoveToLevel::Id; - status = moveToLevelHandler( - endpoint, command, level, app::DataModel::MakeNullable(static_cast(timeMs / 100)), - chip::Optional>(), chip::Optional>(), INVALID_STORED_LEVEL); + status = moveToLevelHandler(endpoint, command, level, app::DataModel::MakeNullable(static_cast(timeMs / 100)), + chip::Optional>(), chip::Optional>(), + INVALID_STORED_LEVEL); if (status != Status::Success) { diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index 16a7e60664d658..a3ebc06d740b7c 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -289,6 +289,11 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl return err; } + // This handler assumes it is being used with the default handler for the level control. Therefore if the level control + // cluster with on off feature is present on the endpoint and the level control handler is registered, it assumes this + // handler will take action on the on-off state. This assumes the level control attributes were also saved in the scene. + // This is to prevent a behavior where the on off state is set by this handler, and then the level control handler or vice + // versa. #ifdef EMBER_AF_PLUGIN_LEVEL_CONTROL if (!(LevelControlWithOnOffFeaturePresent(endpoint) && Scenes::ScenesServer::Instance().IsHandlerRegistered(endpoint, LevelControlServer::GetSceneHandler()))) From f58ca4783ec414ae200182257736c4fc37b43589 Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Thu, 7 Sep 2023 08:33:45 -0700 Subject: [PATCH 034/134] [Darwin] MTRDevice should change state to reachable immediately upon receiving subscription reports (#28996) * [Darwin] MTRDevice should change state to reachable immediately upon receiving subscription reports * Fix unit tests * Address review comment on _handleEventReport: needing to handle _state behavior change Co-authored-by: Boris Zbarsky * Clarify _handleEventReport comments * Clarify further _handleEventReport comments --------- Co-authored-by: Boris Zbarsky --- .../CHIP/MTRBaseSubscriptionCallback.h | 9 ++- .../CHIP/MTRBaseSubscriptionCallback.mm | 11 +++- src/darwin/Framework/CHIP/MTRDevice.mm | 65 +++++++++++++++++-- .../Framework/CHIPTests/MTRDeviceTests.m | 49 ++++++++------ 4 files changed, 107 insertions(+), 27 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h index dc2dda374db49e..12488e6817b970 100644 --- a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h +++ b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.h @@ -56,13 +56,16 @@ typedef void (^ErrorCallback)(NSError * error); typedef void (^SubscriptionEstablishedHandler)(void); typedef void (^OnDoneHandler)(void); typedef void (^UnsolicitedMessageFromPublisherHandler)(void); +typedef void (^ReportBeginHandler)(void); +typedef void (^ReportEndHandler)(void); class MTRBaseSubscriptionCallback : public chip::app::ClusterStateCache::Callback { public: MTRBaseSubscriptionCallback(DataReportCallback attributeReportCallback, DataReportCallback eventReportCallback, ErrorCallback errorCallback, MTRDeviceResubscriptionScheduledHandler _Nullable resubscriptionCallback, SubscriptionEstablishedHandler _Nullable subscriptionEstablishedHandler, OnDoneHandler _Nullable onDoneHandler, - UnsolicitedMessageFromPublisherHandler _Nullable unsolicitedMessageFromPublisherHandler = NULL) + UnsolicitedMessageFromPublisherHandler _Nullable unsolicitedMessageFromPublisherHandler = nil, + ReportBeginHandler _Nullable reportBeginHandler = nil, ReportEndHandler _Nullable reportEndHandler = nil) : mAttributeReportCallback(attributeReportCallback) , mEventReportCallback(eventReportCallback) , mErrorCallback(errorCallback) @@ -71,6 +74,8 @@ class MTRBaseSubscriptionCallback : public chip::app::ClusterStateCache::Callbac , mBufferedReadAdapter(*this) , mOnDoneHandler(onDoneHandler) , mUnsolicitedMessageFromPublisherHandler(unsolicitedMessageFromPublisherHandler) + , mReportBeginHandler(reportBeginHandler) + , mReportEndHandler(reportEndHandler) { } @@ -137,6 +142,8 @@ class MTRBaseSubscriptionCallback : public chip::app::ClusterStateCache::Callbac MTRDeviceResubscriptionScheduledHandler _Nullable mResubscriptionCallback = nil; SubscriptionEstablishedHandler _Nullable mSubscriptionEstablishedHandler = nil; UnsolicitedMessageFromPublisherHandler _Nullable mUnsolicitedMessageFromPublisherHandler = nil; + ReportBeginHandler _Nullable mReportBeginHandler = nil; + ReportEndHandler _Nullable mReportEndHandler = nil; chip::app::BufferedReadCallback mBufferedReadAdapter; // Our lifetime management is a little complicated. On errors that don't diff --git a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm index 7e077206a6730c..24301ce2a28062 100644 --- a/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm +++ b/src/darwin/Framework/CHIP/MTRBaseSubscriptionCallback.mm @@ -27,6 +27,9 @@ { mAttributeReports = [NSMutableArray new]; mEventReports = [NSMutableArray new]; + if (mReportBeginHandler) { + mReportBeginHandler(); + } } // Reports attribute and event data if any exists @@ -48,7 +51,13 @@ } } -void MTRBaseSubscriptionCallback::OnReportEnd() { ReportData(); } +void MTRBaseSubscriptionCallback::OnReportEnd() +{ + ReportData(); + if (mReportEndHandler) { + mReportEndHandler(); + } +} void MTRBaseSubscriptionCallback::OnError(CHIP_ERROR aError) { diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 3b9f0bd793c852..7fbff236a2d9cb 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -91,6 +91,8 @@ - (id)strongObject using namespace chip::app; using namespace chip::Protocols::InteractionModel; +typedef void (^FirstReportHandler)(void); + namespace { class SubscriptionCallback final : public MTRBaseSubscriptionCallback { @@ -98,9 +100,11 @@ - (id)strongObject SubscriptionCallback(DataReportCallback attributeReportCallback, DataReportCallback eventReportCallback, ErrorCallback errorCallback, MTRDeviceResubscriptionScheduledHandler resubscriptionCallback, SubscriptionEstablishedHandler subscriptionEstablishedHandler, OnDoneHandler onDoneHandler, - UnsolicitedMessageFromPublisherHandler unsolicitedMessageFromPublisherHandler) + UnsolicitedMessageFromPublisherHandler unsolicitedMessageFromPublisherHandler, ReportBeginHandler reportBeginHandler, + ReportEndHandler reportEndHandler) : MTRBaseSubscriptionCallback(attributeReportCallback, eventReportCallback, errorCallback, resubscriptionCallback, - subscriptionEstablishedHandler, onDoneHandler, unsolicitedMessageFromPublisherHandler) + subscriptionEstablishedHandler, onDoneHandler, unsolicitedMessageFromPublisherHandler, reportBeginHandler, + reportEndHandler) { } @@ -278,7 +282,6 @@ - (void)nodeMayBeAdvertisingOperational // Return YES if there's a valid delegate AND subscription is expected to report value - (BOOL)_subscriptionAbleToReport { - // TODO: include period from when first report comes in until establish callback return (_weakDelegate.strongObject) && (_state == MTRDeviceStateReachable); } @@ -290,9 +293,11 @@ - (void)_changeState:(MTRDeviceState)state _state = state; if (lastState != state) { if (state != MTRDeviceStateReachable) { - MTR_LOG_INFO("%@ Set estimated start time to nil due to state change", self); + MTR_LOG_INFO("%@ State change %lu => %lu, set estimated start time to nil", self, lastState, state); _estimatedStartTime = nil; _estimatedStartTimeFromGeneralDiagnosticsUpTime = nil; + } else { + MTR_LOG_INFO("%@ State change %lu => %lu", self, lastState, state); } id delegate = _weakDelegate.strongObject; if (delegate) { @@ -411,6 +416,20 @@ - (void)_handleUnsolicitedMessageFromPublisher os_unfair_lock_unlock(&self->_lock); } +- (void)_handleReportBegin +{ + os_unfair_lock_lock(&self->_lock); + [self _changeState:MTRDeviceStateReachable]; + os_unfair_lock_unlock(&self->_lock); +} + +- (void)_handleReportEnd +{ + os_unfair_lock_lock(&self->_lock); + _estimatedStartTimeFromGeneralDiagnosticsUpTime = nil; + os_unfair_lock_unlock(&self->_lock); +} + // assume lock is held - (void)_reportAttributes:(NSArray *> *)attributes { @@ -442,11 +461,33 @@ - (void)_handleEventReport:(NSArray *> *)eventRepor NSDate * oldEstimatedStartTime = _estimatedStartTime; for (NSDictionary * eventDict in eventReport) { // Whenever a StartUp event is received, reset the estimated start time + // New subscription case + // - Starts Unreachable + // - Start CASE and send subscription request + // - Receive priming report ReportBegin + // - Optionally receive UpTime attribute - update time and save start time estimate + // - Optionally receive StartUp event + // - Set estimated system time from event receipt time, or saved UpTime estimate if exists + // - ReportEnd handler clears the saved start time estimate based on UpTime + // Subscription dropped from client point of view case + // - Starts Unreachable + // - Resubscribe happens after some time, and then same as the above + // Server resuming subscription after reboot case + // - Starts Reachable + // - Receive priming report ReportBegin + // - Optionally receive UpTime attribute - update time and save value + // - Optionally receive StartUp event + // - Set estimated system time from event receipt time, or saved UpTime estimate if exists + // - ReportEnd handler clears the saved start time estimate based on UpTime + // Server resuming subscription after timeout case + // - Starts Reachable + // - Receive priming report ReportBegin + // - Optionally receive UpTime attribute - update time and save value + // - ReportEnd handler clears the saved start time estimate based on UpTime MTREventPath * eventPath = eventDict[MTREventPathKey]; BOOL isStartUpEvent = (eventPath.cluster.unsignedLongValue == MTRClusterIDTypeBasicInformationID) && (eventPath.event.unsignedLongValue == MTREventIDTypeClusterBasicInformationEventStartUpID); - if (isStartUpEvent && (_state == MTRDeviceStateReachable)) { - // StartUp event received when server resumes subscription + if (isStartUpEvent) { if (_estimatedStartTimeFromGeneralDiagnosticsUpTime) { // If UpTime was received, make use of it as mark of system start time MTR_LOG_INFO("%@ StartUp event: set estimated start time forward to %@", self, @@ -610,6 +651,18 @@ - (void)_setupSubscription // OnUnsolicitedMessageFromPublisher [self _handleUnsolicitedMessageFromPublisher]; }); + }, + ^(void) { + MTR_LOG_DEFAULT("%@ got report begin", self); + dispatch_async(self.queue, ^{ + [self _handleReportBegin]; + }); + }, + ^(void) { + MTR_LOG_DEFAULT("%@ got report end", self); + dispatch_async(self.queue, ^{ + [self _handleReportEnd]; + }); }); // Set up a cluster state cache. We just want this for the logic it has for diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 0d9b693296bc2d..95f4aab4d5d30c 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -118,19 +118,19 @@ - (void)controller:(MTRDeviceController *)controller commissioningComplete:(NSEr typedef void (^MTRDeviceTestDelegateDataHandler)(NSArray *> *); @interface MTRDeviceTestDelegate : NSObject -@property (nonatomic) dispatch_block_t onSubscriptionEstablished; +@property (nonatomic) dispatch_block_t onReachable; +@property (nonatomic, nullable) dispatch_block_t onNotReachable; @property (nonatomic, nullable) MTRDeviceTestDelegateDataHandler onAttributeDataReceived; @property (nonatomic, nullable) MTRDeviceTestDelegateDataHandler onEventDataReceived; -@property (nonatomic, nullable) dispatch_block_t onSubscriptionDropped; @end @implementation MTRDeviceTestDelegate - (void)device:(MTRDevice *)device stateChanged:(MTRDeviceState)state { if (state == MTRDeviceStateReachable) { - self.onSubscriptionEstablished(); - } else if (state == MTRDeviceStateUnknown && self.onSubscriptionDropped != nil) { - self.onSubscriptionDropped(); + self.onReachable(); + } else if (state != MTRDeviceStateReachable && self.onNotReachable != nil) { + self.onNotReachable(); } } @@ -1423,10 +1423,12 @@ - (void)test017_TestMTRDeviceBasics __auto_type * device = [MTRDevice deviceWithNodeID:kDeviceId deviceController:sController]; dispatch_queue_t queue = dispatch_get_main_queue(); + // Given reachable state becomes true before underlying OnSubscriptionEstablished callback, this expectation is necessary but + // not sufficient as a mark to the end of reports XCTestExpectation * subscriptionExpectation = [self expectationWithDescription:@"Subscription has been set up"]; __auto_type * delegate = [[MTRDeviceTestDelegate alloc] init]; - delegate.onSubscriptionEstablished = ^() { + delegate.onReachable = ^() { [subscriptionExpectation fulfill]; }; @@ -1435,6 +1437,10 @@ - (void)test017_TestMTRDeviceBasics attributeReportsReceived += data.count; }; + // This is dependent on current implementation that priming reports send attributes and events in that order, and also that + // events in this test would fit in one report. So receiving events would mean all attributes and events have been received, and + // can satisfy the test below. + XCTestExpectation * gotReportsExpectation = [self expectationWithDescription:@"Attribute and Event reports have been received"]; __block unsigned eventReportsReceived = 0; delegate.onEventDataReceived = ^(NSArray *> * eventReport) { eventReportsReceived += eventReport.count; @@ -1451,6 +1457,7 @@ - (void)test017_TestMTRDeviceBasics XCTAssertNotNil(eventDict[MTREventTimestampDateKey]); } } + [gotReportsExpectation fulfill]; }; [device setDelegate:delegate queue:queue]; @@ -1481,7 +1488,7 @@ - (void)test017_TestMTRDeviceBasics [device readAttributeWithEndpointID:@(1) clusterID:@(MTRClusterIDTypeLevelControlID) attributeID:@(4) params:nil]; [device readAttributeWithEndpointID:@(1) clusterID:@(MTRClusterIDTypeLevelControlID) attributeID:@(4) params:nil]; - [self waitForExpectations:@[ subscriptionExpectation ] timeout:60]; + [self waitForExpectations:@[ subscriptionExpectation, gotReportsExpectation ] timeout:60]; XCTAssertNotEqual(attributeReportsReceived, 0); XCTAssertNotEqual(eventReportsReceived, 0); @@ -1489,16 +1496,6 @@ - (void)test017_TestMTRDeviceBasics attributeReportsReceived = 0; eventReportsReceived = 0; - XCTestExpectation * resubscriptionExpectation = [self expectationWithDescription:@"Resubscription has happened"]; - delegate.onSubscriptionEstablished = ^() { - [resubscriptionExpectation fulfill]; - }; - - XCTestExpectation * subscriptionDroppedExpectation = [self expectationWithDescription:@"Subscription has dropped"]; - delegate.onSubscriptionDropped = ^() { - [subscriptionDroppedExpectation fulfill]; - }; - // Before resubscribe, first test write failure and expected value effects NSNumber * testEndpointID = @(1); NSNumber * testClusterID = @(8); @@ -1547,11 +1544,25 @@ - (void)test017_TestMTRDeviceBasics [device readAttributeWithEndpointID:testEndpointID clusterID:testClusterID attributeID:testAttributeID params:nil]; [self waitForExpectations:@[ attributeReportErrorExpectation ] timeout:10]; + // Resubscription test setup + XCTestExpectation * subscriptionDroppedExpectation = [self expectationWithDescription:@"Subscription has dropped"]; + delegate.onNotReachable = ^() { + [subscriptionDroppedExpectation fulfill]; + }; + XCTestExpectation * resubscriptionExpectation = [self expectationWithDescription:@"Resubscription has happened"]; + delegate.onReachable = ^() { + [resubscriptionExpectation fulfill]; + }; + // reset the onAttributeDataReceived to validate the following resubscribe test delegate.onAttributeDataReceived = ^(NSArray *> * data) { attributeReportsReceived += data.count; }; + delegate.onEventDataReceived = ^(NSArray *> * eventReport) { + eventReportsReceived += eventReport.count; + }; + // Now trigger another subscription which will cause ours to drop; we should re-subscribe after that. MTRBaseDevice * baseDevice = GetConnectedDevice(); __auto_type params = [[MTRSubscribeParams alloc] initWithMinInterval:@(1) maxInterval:@(10)]; @@ -1580,9 +1591,9 @@ - (void)test017_TestMTRDeviceBasics // Now make sure we ignore later tests. Ideally we would just unsubscribe // or remove the delegate, but there's no good way to do that. - delegate.onSubscriptionEstablished = ^() { + delegate.onReachable = ^() { }; - delegate.onSubscriptionDropped = nil; + delegate.onNotReachable = nil; delegate.onAttributeDataReceived = nil; delegate.onEventDataReceived = nil; From 8b7f55b4306c353cdb413934cda1ac4aaee7c122 Mon Sep 17 00:00:00 2001 From: EricZijian_SiterWell Date: Fri, 8 Sep 2023 00:43:42 +0800 Subject: [PATCH 035/134] Change chip-tool.py to chip-tool (#29081) Co-authored-by: Hare --- .../certification/Test_TC_SMOKECO_2_2.yaml | 6 +-- .../certification/Test_TC_SMOKECO_2_3.yaml | 6 +-- .../certification/Test_TC_SMOKECO_2_4.yaml | 16 +++---- .../certification/Test_TC_SMOKECO_2_5.yaml | 44 +++++++++---------- .../certification/Test_TC_SMOKECO_2_6.yaml | 20 ++++----- 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml index fbd307e0a0928a..efe21c12ec5090 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_2.yaml @@ -105,7 +105,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 1 @@ -191,7 +191,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 2 @@ -242,7 +242,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 0 diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml index 9e6430731dce5d..eb98f64d53f4b0 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_3.yaml @@ -104,7 +104,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 1 @@ -190,7 +190,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 2 @@ -241,7 +241,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 0 diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml index 7333b55fd247b4..d9374a8fa82a78 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_4.yaml @@ -117,7 +117,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 1 @@ -168,7 +168,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 2 @@ -219,7 +219,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 0 @@ -281,7 +281,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read hardware-fault-alert 1 1 + ./chip-tool smokecoalarm read hardware-fault-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0006 DataVersion: 1795725838 [TOO] HardwareFaultAlert: TRUE @@ -333,7 +333,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read hardware-fault-alert 1 1 + ./chip-tool smokecoalarm read hardware-fault-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0006 DataVersion: 1795725838 [TOO] HardwareFaultAlert: FALSE @@ -395,7 +395,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read end-of-service-alert 1 1 + ./chip-tool smokecoalarm read end-of-service-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0007 DataVersion: 1795725838 [TOO] EndOfServiceAlert: 1 @@ -447,7 +447,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read end-of-service-alert 1 1 + ./chip-tool smokecoalarm read end-of-service-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0007 DataVersion: 1795725838 [TOO] EndOfServiceAlert: 0 @@ -577,7 +577,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read test-in-progress 1 1 + ./chip-tool smokecoalarm read test-in-progress 1 1 This step needs to be completed quickly diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml index f44ce08ab77d82..8fb355e1ed18dd 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_5.yaml @@ -152,7 +152,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + ./chip-tool smokecoalarm read interconnect-smoke-alarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 [TOO] InterconnectSmokeAlarm: 1 @@ -204,7 +204,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + ./chip-tool smokecoalarm read interconnect-smoke-alarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 [TOO] InterconnectSmokeAlarm: 0 @@ -275,7 +275,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + ./chip-tool smokecoalarm read interconnect-coalarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 [TOO] InterconnectCOAlarm: 1 @@ -327,7 +327,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + ./chip-tool smokecoalarm read interconnect-coalarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 [TOO] InterconnectCOAlarm: 0 @@ -390,7 +390,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read contamination-state 1 1 + ./chip-tool smokecoalarm read contamination-state 1 1 Verify that the value of ContaminationState is 2 or 3 @@ -427,7 +427,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read contamination-state 1 1 + ./chip-tool smokecoalarm read contamination-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 [TOO] ContaminationState: 0 @@ -462,7 +462,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read contamination-state 1 1 + ./chip-tool smokecoalarm read contamination-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 [TOO] ContaminationState: 1 @@ -497,7 +497,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read contamination-state 1 1 + ./chip-tool smokecoalarm read contamination-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000A DataVersion: 1795725838 [TOO] ContaminationState: 0 @@ -544,7 +544,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + ./chip-tool smokecoalarm read smoke-sensitivity-level 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 [TOO] SmokeSensitivityLevel: 0 @@ -579,7 +579,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + ./chip-tool smokecoalarm read smoke-sensitivity-level 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 [TOO] SmokeSensitivityLevel: 1 @@ -614,7 +614,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + ./chip-tool smokecoalarm read smoke-sensitivity-level 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 [TOO] SmokeSensitivityLevel: 2 @@ -649,7 +649,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-sensitivity-level 1 1 + ./chip-tool smokecoalarm read smoke-sensitivity-level 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_000B DataVersion: 1795725838 [TOO] SmokeSensitivityLevel: 1 @@ -716,7 +716,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 1 @@ -757,7 +757,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read device-muted 1 1 + ./chip-tool smokecoalarm read device-muted 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 [TOO] DeviceMuted: 1 @@ -800,7 +800,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read device-muted 1 1 + ./chip-tool smokecoalarm read device-muted 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 [TOO] DeviceMuted: 0 @@ -851,7 +851,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 2 @@ -928,7 +928,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 0 @@ -984,7 +984,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 1 @@ -1025,7 +1025,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read device-muted 1 1 + ./chip-tool smokecoalarm read device-muted 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 [TOO] DeviceMuted: 1 @@ -1068,7 +1068,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read device-muted 1 1 + ./chip-tool smokecoalarm read device-muted 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0004 DataVersion: 1795725838 [TOO] DeviceMuted: 0 @@ -1119,7 +1119,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 2 @@ -1196,7 +1196,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 0 diff --git a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml index f5106b7f316591..00ecd8b85a63b2 100644 --- a/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_SMOKECO_2_6.yaml @@ -188,7 +188,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 1 @@ -231,7 +231,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + ./chip-tool smokecoalarm read interconnect-smoke-alarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 [TOO] InterconnectSmokeAlarm: 1 @@ -272,7 +272,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + ./chip-tool smokecoalarm read interconnect-coalarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 [TOO] InterconnectCOAlarm: 1 @@ -313,7 +313,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 1 @@ -354,7 +354,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 1 @@ -397,7 +397,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read smoke-state 1 1 + ./chip-tool smokecoalarm read smoke-state 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0001 DataVersion: 1795725838 [TOO] SmokeState: 0 @@ -447,7 +447,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read costate 1 1 + ./chip-tool smokecoalarm read costate 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0002 DataVersion: 1795725838 [TOO] COState: 0 @@ -498,7 +498,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-coalarm 1 1 + ./chip-tool smokecoalarm read interconnect-coalarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0009 DataVersion: 1795725838 [TOO] InterconnectCOAlarm: 0 @@ -550,7 +550,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read interconnect-smoke-alarm 1 1 + ./chip-tool smokecoalarm read interconnect-smoke-alarm 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0008 DataVersion: 1795725838 [TOO] InterconnectSmokeAlarm: 0 @@ -600,7 +600,7 @@ tests: cluster: "LogCommands" command: "UserPrompt" verification: | - ./chip-tool.py smokecoalarm read battery-alert 1 1 + ./chip-tool smokecoalarm read battery-alert 1 1 [TOO] Endpoint: 1 Cluster: 0x0000_005C Attribute 0x0000_0003 DataVersion: 1795725838 [TOO] BatteryAlert: 0 From 5bdfb7524d6421252c17266f1a928b27afb2ba53 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 7 Sep 2023 09:44:41 -0700 Subject: [PATCH 036/134] Optimize the algorithm to replace all occurrences of java/util/Optional (#29077) * Optimize the algorithm to replace all occurrences of java/util/Optional * Restyled by clang-format * Address review comment --------- Co-authored-by: Restyled.io --- src/lib/support/JniReferences.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/lib/support/JniReferences.cpp b/src/lib/support/JniReferences.cpp index 36f6b98e7e8a6a..edf9b8544d2665 100644 --- a/src/lib/support/JniReferences.cpp +++ b/src/lib/support/JniReferences.cpp @@ -124,7 +124,6 @@ CHIP_ERROR JniReferences::N2J_ByteArray(JNIEnv * env, const uint8_t * inArray, j CHIP_ERROR JniReferences::FindMethod(JNIEnv * env, jobject object, const char * methodName, const char * methodSignature, jmethodID * methodId) { - CHIP_ERROR err = CHIP_NO_ERROR; jclass javaClass = nullptr; VerifyOrReturnError(env != nullptr && object != nullptr, CHIP_JNI_ERROR_NULL_OBJECT); @@ -132,23 +131,31 @@ CHIP_ERROR JniReferences::FindMethod(JNIEnv * env, jobject object, const char * VerifyOrReturnError(javaClass != nullptr, CHIP_JNI_ERROR_TYPE_NOT_FOUND); *methodId = env->GetMethodID(javaClass, methodName, methodSignature); + env->ExceptionClear(); + + if (*methodId != nullptr) + { + return CHIP_NO_ERROR; + } // Try `j$` when enabling Java8. std::string methodSignature_java8_str(methodSignature); - if (*methodId == nullptr && methodSignature_java8_str.find("java/util/Optional") != std::string::npos) + size_t pos = methodSignature_java8_str.find("java/util/Optional"); + if (pos != std::string::npos) { // Replace all "java/util/Optional" with "j$/util/Optional". - while (methodSignature_java8_str.find("java/util/Optional") != std::string::npos) + while (pos != std::string::npos) { - size_t pos = methodSignature_java8_str.find("java/util/Optional"); methodSignature_java8_str.replace(pos, strlen("java/util/Optional"), "j$/util/Optional"); + pos = methodSignature_java8_str.find("java/util/Optional"); } *methodId = env->GetMethodID(javaClass, methodName, methodSignature_java8_str.c_str()); + env->ExceptionClear(); } VerifyOrReturnError(*methodId != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - return err; + return CHIP_NO_ERROR; } void JniReferences::CallVoidInt(JNIEnv * env, jobject object, const char * methodName, jint argument) @@ -218,11 +225,13 @@ CHIP_ERROR JniReferences::CreateOptional(jobject objectToWrap, jobject & outOpti chip::JniClass jniClass(optionalCls); jmethodID ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Ljava/util/Optional;"); + env->ExceptionClear(); // Try `Lj$/util/Optional;` when enabling Java8. if (ofMethod == nullptr) { ofMethod = env->GetStaticMethodID(optionalCls, "ofNullable", "(Ljava/lang/Object;)Lj$/util/Optional;"); + env->ExceptionClear(); } VerifyOrReturnError(ofMethod != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); From 971047f5931ee7ca1c49c9c7870cfb29b6a6e1c8 Mon Sep 17 00:00:00 2001 From: shchen-Lab <75290921+shchen-Lab@users.noreply.github.com> Date: Fri, 8 Sep 2023 01:08:15 +0800 Subject: [PATCH 037/134] [BouffaloLab]update sdk to support open network (#29070) * BL702&BL602 Support OpenNetWork * update sdk to support open network on bl706-wifi * Restyled by whitespace * BLCONFIG Bytes alignment * remove repo openthread misc * code style * Restyled by gn * remove otPlatCAlloc/otPlatFree * Restyled by gn * add comment and check credentials length * Restyled by clang-format --------- Co-authored-by: wyhong Co-authored-by: Restyled.io --- .../BL602/NetworkCommissioningDriver.cpp | 34 ++++++++++++++++--- .../BL602/NetworkCommissioningDriver.h | 9 ++++- .../BL702/NetworkCommissioningDriver.cpp | 28 ++++++++++++++- .../BL702/NetworkCommissioningDriver.h | 9 ++++- .../BL702/ThreadStackManagerImpl.cpp | 10 ------ .../BL702L/ThreadStackManagerImpl.cpp | 10 ------ src/platform/bouffalolab/common/BLConfig.cpp | 33 +++++++++++++++--- third_party/bouffalolab/repo | 2 +- 8 files changed, 102 insertions(+), 33 deletions(-) diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp index d9dd83c923cd57..b051a44a44a0d5 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp @@ -44,11 +44,11 @@ CHIP_ERROR BLWiFiDriver::Init(NetworkStatusChangeCallback * networkStatusChangeC size_t ssidLen = 0; size_t credentialsLen = 0; - err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiSSID, mSavedNetwork.credentials, + err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiPassword, mSavedNetwork.credentials, sizeof(mSavedNetwork.credentials), &credentialsLen); SuccessOrExit(err); - err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiPassword, mSavedNetwork.ssid, - sizeof(mSavedNetwork.ssid), &ssidLen); + err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiSSID, mSavedNetwork.ssid, sizeof(mSavedNetwork.ssid), + &ssidLen); SuccessOrExit(err); mSavedNetwork.credentialsLen = credentialsLen; @@ -160,7 +160,33 @@ CHIP_ERROR BLWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, memcpy(passwd, key, keyLen); wifi_interface_t wifi_interface; wifi_interface = wifi_mgmr_sta_enable(); - wifi_mgmr_sta_connect(&wifi_interface, wifi_ssid, passwd, NULL, NULL, 0, 0); + // Valid Credentials length are: + // - 0 bytes: Unsecured (open) connection + // - 5 bytes: WEP-64 passphrase + // - 10 hexadecimal ASCII characters: WEP-64 40-bit hex raw PSK + // - 13 bytes: WEP-128 passphrase + // - 26 hexadecimal ASCII characters: WEP-128 104-bit hex raw PSK + // - 8..63 bytes: WPA/WPA2/WPA3 passphrase + // - 64 bytes: WPA/WPA2/WPA3 raw hex PSK + // Note 10 hex WEP64 and 13 bytes / 26 hex WEP128 passphrase are covered by 8~63 bytes WPA passphrase, so we don't check WEP64 + // hex and WEP128 passphrase. + if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen || keyLen == BLWiFiDriver::WiFiCredentialLength::kWEP64 || + (keyLen >= BLWiFiDriver::WiFiCredentialLength::kMinWPAPSK && keyLen <= BLWiFiDriver::WiFiCredentialLength::kMaxWPAPSK)) + { + + if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen) + { + wifi_mgmr_sta_connect(&wifi_interface, wifi_ssid, NULL, NULL, NULL, 0, 0); + } + else + { + wifi_mgmr_sta_connect(&wifi_interface, wifi_ssid, passwd, NULL, NULL, 0, 0); + } + } + else + { + return CHIP_ERROR_INVALID_STRING_LENGTH; + } return CHIP_NO_ERROR; } diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h index 7e0fd1b30727a1..83416a534988ac 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h @@ -86,6 +86,14 @@ class BLWiFiDriver final : public WiFiDriver char credentials[DeviceLayer::Internal::kMaxWiFiKeyLength]; uint8_t credentialsLen = 0; }; + enum WiFiCredentialLength + { + kOpen = 0, + kWEP64 = 5, + kMinWPAPSK = 8, + kMaxWPAPSK = 63, + kWPAPSKHex = 64, + }; // BaseDriver NetworkIterator * GetNetworks() override { return new WiFiNetworkIterator(this); } @@ -116,7 +124,6 @@ class BLWiFiDriver final : public WiFiDriver CHIP_ERROR SetLastDisconnectReason(const ChipDeviceEvent * event); int32_t GetLastDisconnectReason(); - static BLWiFiDriver & GetInstance() { static BLWiFiDriver instance; diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp index 6087fce9d94f66..252a1eba7f2475 100644 --- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp +++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp @@ -132,7 +132,33 @@ Status BLWiFiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, MutableCh CHIP_ERROR BLWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen) { ChipLogProgress(NetworkProvisioning, "ConnectWiFiNetwork"); - wifiInterface_connect((char *) ssid, (char *) key); + // Valid Credentials length are: + // - 0 bytes: Unsecured (open) connection + // - 5 bytes: WEP-64 passphrase + // - 10 hexadecimal ASCII characters: WEP-64 40-bit hex raw PSK + // - 13 bytes: WEP-128 passphrase + // - 26 hexadecimal ASCII characters: WEP-128 104-bit hex raw PSK + // - 8..63 bytes: WPA/WPA2/WPA3 passphrase + // - 64 bytes: WPA/WPA2/WPA3 raw hex PSK + // Note 10 hex WEP64 and 13 bytes / 26 hex WEP128 passphrase are covered by 8~63 bytes WPA passphrase, so we don't check WEP64 + // hex and WEP128 passphrase. + if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen || keyLen == BLWiFiDriver::WiFiCredentialLength::kWEP64 || + (keyLen >= BLWiFiDriver::WiFiCredentialLength::kMinWPAPSK && keyLen <= BLWiFiDriver::WiFiCredentialLength::kMaxWPAPSK)) + { + + if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen) + { + wifiInterface_connect((char *) ssid, NULL); + } + else + { + wifiInterface_connect((char *) ssid, (char *) key); + } + } + else + { + return CHIP_ERROR_INVALID_STRING_LENGTH; + } ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting); return CHIP_NO_ERROR; } diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h index 48bf7d098c869f..caa071ddd467b2 100644 --- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h @@ -78,7 +78,14 @@ class BLWiFiDriver final : public WiFiDriver char credentials[DeviceLayer::Internal::kMaxWiFiKeyLength + 1]; uint8_t credentialsLen = 0; }; - + enum WiFiCredentialLength + { + kOpen = 0, + kWEP64 = 5, + kMinWPAPSK = 8, + kMaxWPAPSK = 63, + kWPAPSKHex = 64, + }; // BaseDriver NetworkIterator * GetNetworks() override { return new WiFiNetworkIterator(this); } CHIP_ERROR Init(NetworkStatusChangeCallback * networkStatusChangeCallback) override; diff --git a/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp b/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp index c4981afe84a656..94932a9febb8c8 100644 --- a/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp @@ -103,16 +103,6 @@ extern "C" otInstance * otrGetInstance() return ThreadStackMgrImpl().OTInstance(); } -extern "C" void * otPlatCAlloc(size_t aNum, size_t aSize) -{ - return calloc(aNum, aSize); -} - -extern "C" void otPlatFree(void * aPtr) -{ - free(aPtr); -} - extern "C" uint32_t otrEnterCrit(void) { if (xPortIsInsideInterrupt()) diff --git a/src/platform/bouffalolab/BL702L/ThreadStackManagerImpl.cpp b/src/platform/bouffalolab/BL702L/ThreadStackManagerImpl.cpp index 1b1ebf197e006f..f2996526e84445 100644 --- a/src/platform/bouffalolab/BL702L/ThreadStackManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702L/ThreadStackManagerImpl.cpp @@ -106,16 +106,6 @@ extern "C" otInstance * otrGetInstance() return ThreadStackMgrImpl().OTInstance(); } -extern "C" void * otPlatCAlloc(size_t aNum, size_t aSize) -{ - return calloc(aNum, aSize); -} - -extern "C" void otPlatFree(void * aPtr) -{ - free(aPtr); -} - extern "C" ot_system_event_t otrGetNotifyEvent(void) { ot_system_event_t sevent = OT_SYSTEM_EVENT_NONE; diff --git a/src/platform/bouffalolab/common/BLConfig.cpp b/src/platform/bouffalolab/common/BLConfig.cpp index de1cc24d139508..ff03eb662a1bb7 100644 --- a/src/platform/bouffalolab/common/BLConfig.cpp +++ b/src/platform/bouffalolab/common/BLConfig.cpp @@ -111,9 +111,21 @@ CHIP_ERROR BLConfig::WriteConfigValue(const char * key, uint8_t * val, size_t si ef_port_env_lock(); - if (size && val) + if (size) { - ret = ef_set_env_blob(key, val, size); + if (val) + { + ret = ef_set_env_blob(key, val, size); + } + else + { + ret = EF_ENV_ARG_ERR; + } + } + else + { + uint32_t value_null = 0; + ret = ef_set_env_blob(key, &value_null, size); } ef_port_env_unlock(); @@ -240,11 +252,22 @@ CHIP_ERROR BLConfig::WriteKVS(const char * key, const void * value, size_t value ef_port_env_lock(); - if (value && value_size) + if (value_size) { - ret = ef_set_env_blob(key, value, value_size); + if (value) + { + ret = ef_set_env_blob(key, value, value_size); + } + else + { + ret = EF_ENV_ARG_ERR; + } + } + else + { + uint32_t value_null = 0; + ret = ef_set_env_blob(key, &value_null, value_size); } - ef_port_env_unlock(); if (ret == EF_NO_ERR) diff --git a/third_party/bouffalolab/repo b/third_party/bouffalolab/repo index dbca8b07013852..0c5772fb31ad08 160000 --- a/third_party/bouffalolab/repo +++ b/third_party/bouffalolab/repo @@ -1 +1 @@ -Subproject commit dbca8b07013852985a8bcea9cc56f486f53c77bd +Subproject commit 0c5772fb31ad083cafdedc9a9de578d3abd5a234 From 1b31a96879c576ab1bafff8b4d99863ccc15d549 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 7 Sep 2023 19:19:33 +0200 Subject: [PATCH 038/134] [MatterYamlTests] Add basic support for darwin-framework-tool (#28969) * Add darwin-framework-tool python yaml parser connection support. For the moment darwin-framework-tool does not send back anything nor supports special test commands that have been added to chip-tool to fully support yaml * Add sleep command to darwin-framework-tool * Add wait-for-commissionee command to darwin-framework-tool * Add darwin-framework-tool python yaml parser output connection support * Hack examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py so it does use the right argument names for darwin-framework-tool --------- Co-authored-by: Vivien Nicolas --- .../matter_chip_tool_adapter/decoder.py | 16 + .../matter_chip_tool_adapter/encoder.py | 21 +- examples/darwin-framework-tool/BUILD.gn | 20 +- .../commands/common/CHIPCommandBridge.mm | 6 + .../commands/common/RemoteDataModelLogger.h | 35 + .../commands/common/RemoteDataModelLogger.mm | 195 + .../commands/delay/Commands.h | 34 + .../commands/delay/SleepCommand.h | 52 + .../commands/delay/SleepCommand.mm | 28 + .../delay/WaitForCommissioneeCommand.h | 57 + .../delay/WaitForCommissioneeCommand.mm | 76 + .../commands/interactive/Commands.h | 1 + .../interactive/InteractiveCommands.h | 47 +- .../interactive/InteractiveCommands.mm | 241 +- examples/darwin-framework-tool/main.mm | 2 + .../templates/commands.zapt | 52 +- scripts/tests/yaml/chiptool.py | 55 +- scripts/tests/yaml/darwinframeworktool.py | 85 + scripts/tests/yaml/runner.py | 14 + scripts/tests/yaml/tests_tool.py | 68 + .../Matter.xcodeproj/project.pbxproj | 230 + .../zap-generated/cluster/Commands.h | 19363 +++++++++++++--- 22 files changed, 17961 insertions(+), 2737 deletions(-) create mode 100644 examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h create mode 100644 examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm create mode 100644 examples/darwin-framework-tool/commands/delay/Commands.h create mode 100644 examples/darwin-framework-tool/commands/delay/SleepCommand.h create mode 100644 examples/darwin-framework-tool/commands/delay/SleepCommand.mm create mode 100644 examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h create mode 100644 examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm create mode 100755 scripts/tests/yaml/darwinframeworktool.py create mode 100644 scripts/tests/yaml/tests_tool.py diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py index ec9b4702de0a3d..dc721b24268447 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py @@ -303,6 +303,22 @@ def run(self, specs, value, cluster_name: str, typename: str, array: bool): ) del value[str(field_code)] + # darwin-framework-tool returns the field name but with a different casing than what + # the test suite expects. + # To not confuse the test suite, the field name is replaced by its field name + # equivalent from the spec and then removed. + wrong_casing_field_name = field_name[0].lower( + ) + field_name[1:] + if field_name not in value and field_name[0].upper() == field_name[0] and wrong_casing_field_name in value: + value[field_name] = self.run( + specs, + value[wrong_casing_field_name], + cluster_name, + field_type, + field_array + ) + del value[wrong_casing_field_name] + if specs.is_fabric_scoped(struct): value[_FABRIC_INDEX_FIELD_NAME] = self.run( specs, diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py index 7a3735e213e049..355a2b18433e31 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/encoder.py @@ -14,7 +14,9 @@ import base64 import json +import os import re +import sys _ANY_COMMANDS_LIST = [ 'ReadById', @@ -208,6 +210,12 @@ class Encoder: def __init__(self, specifications): self.__specs = specifications + # This is not the best way to toggle this flag. But for now it prevents having + # to build a new adapter for the very small differences that exists... + is_darwin_framework_tool = os.path.basename( + sys.argv[0]) == 'darwinframeworktool.py' + self.__is_darwin_framework_tool = is_darwin_framework_tool + def encode(self, request): cluster = self.__get_cluster_name(request) command, command_specifier = self.__get_command_name(request) @@ -305,7 +313,10 @@ def __maybe_add_destination(self, rv, request): if not self._supports_destination(request): return rv - destination_argument_name = 'destination-id' + if self.__is_darwin_framework_tool: + destination_argument_name = 'node-id' + else: + destination_argument_name = 'destination-id' destination_argument_value = None if request.group_id: @@ -333,6 +344,9 @@ def __maybe_add_endpoint(self, rv, request): if (request.is_attribute and not request.command == "writeAttribute") or request.is_event or (request.command in _ANY_COMMANDS_LIST and not request.command == "WriteById"): endpoint_argument_name = 'endpoint-ids' + if self.__is_darwin_framework_tool: + endpoint_argument_name = 'endpoint-id' + if rv: rv += ', ' rv += f'"{endpoint_argument_name}": "{endpoint_argument_value}"' @@ -378,7 +392,10 @@ def __get_argument_name(self, request, entry): if request.is_attribute: if command_name == 'writeAttribute': - argument_name = 'attribute-values' + if self.__is_darwin_framework_tool: + argument_name = 'attr-value' + else: + argument_name = 'attribute-values' else: argument_name = 'value' diff --git a/examples/darwin-framework-tool/BUILD.gn b/examples/darwin-framework-tool/BUILD.gn index c32fda585f7cca..1c792dfbd605ee 100644 --- a/examples/darwin-framework-tool/BUILD.gn +++ b/examples/darwin-framework-tool/BUILD.gn @@ -14,6 +14,7 @@ import("//build_overrides/build.gni") import("//build_overrides/chip.gni") +import("//build_overrides/jsoncpp.gni") import("${chip_root}/build/chip/tools.gni") import("${chip_root}/build/config/compiler/compiler.gni") @@ -132,6 +133,7 @@ action("build-darwin-framework") { config("config") { include_dirs = [ ".", + "${chip_root}/examples/common", "${chip_root}/examples/darwin-framework-tool/commands/common", "${chip_root}/zzz_generated/darwin-framework-tool", "${chip_root}/zzz_generated/controller-clusters", @@ -178,6 +180,13 @@ executable("darwin-framework-tool") { "commands/common/MTRError.mm", "commands/common/MTRError_Utils.h", "commands/common/MTRLogging.h", + "commands/common/RemoteDataModelLogger.h", + "commands/common/RemoteDataModelLogger.mm", + "commands/delay/Commands.h", + "commands/delay/SleepCommand.h", + "commands/delay/SleepCommand.mm", + "commands/delay/WaitForCommissioneeCommand.h", + "commands/delay/WaitForCommissioneeCommand.mm", "commands/discover/Commands.h", "commands/discover/DiscoverCommissionablesCommand.h", "commands/discover/DiscoverCommissionablesCommand.mm", @@ -200,12 +209,16 @@ executable("darwin-framework-tool") { deps = [ ":build-darwin-framework", - "${chip_root}/third_party/jsoncpp", + jsoncpp_root, ] if (config_use_interactive_mode) { sources += [ "commands/interactive/InteractiveCommands.mm" ] - deps += [ "${editline_root}:editline" ] + + deps += [ + "${chip_root}/examples/common/websocket-server", + "${editline_root}:editline", + ] } ldflags = [ @@ -240,6 +253,7 @@ executable("darwin-framework-tool") { # pics is needed by tests "${chip_root}/src/app/tests/suites/pics", + "${chip_root}/src/protocols:im_status", ] defines = [] @@ -248,6 +262,8 @@ executable("darwin-framework-tool") { "${chip_root}/config/standalone/", "${chip_root}/src/", "${chip_root}/src/include/", + "${chip_root}/src/protocols/", + "${chip_root}/src/protocols/interaction_model", "${chip_root}/third_party/nlassert/repo/include/", "${chip_root}/third_party/nlio/repo/include/", "${chip_root}/zzz_generated/app-common/", diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm index 55f429caeca981..eb938c2abb0614 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm @@ -40,6 +40,12 @@ ChipLogProgress(chipTool, "Running Command"); ReturnErrorOnFailure(MaybeSetUpStack()); SetIdentity(mCommissionerName.HasValue() ? mCommissionerName.Value() : kIdentityAlpha); + + { + std::lock_guard lk(cvWaitingForResponseMutex); + mWaitingForResponse = YES; + } + ReturnLogErrorOnFailure(RunCommand()); auto err = StartWaiting(GetWaitDuration()); diff --git a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h new file mode 100644 index 00000000000000..d8130143e20d8c --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#import + +#include + +class RemoteDataModelLoggerDelegate { +public: + CHIP_ERROR virtual LogJSON(const char *) = 0; + virtual ~RemoteDataModelLoggerDelegate() {}; +}; + +namespace RemoteDataModelLogger { +CHIP_ERROR LogAttributeAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * attributeId, id result); +CHIP_ERROR LogCommandAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * commandId, id result); +CHIP_ERROR LogAttributeErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * attributeId, NSError * error); +CHIP_ERROR LogCommandErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * commandId, NSError * error); +void SetDelegate(RemoteDataModelLoggerDelegate * delegate); +}; // namespace RemoteDataModelLogger diff --git a/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm new file mode 100644 index 00000000000000..679dca5bd3be83 --- /dev/null +++ b/examples/darwin-framework-tool/commands/common/RemoteDataModelLogger.mm @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "RemoteDataModelLogger.h" + +#import "MTRError_Utils.h" +#import + +#include +#include +#include + +#include + +constexpr const char * kClusterIdKey = "clusterId"; +constexpr const char * kEndpointIdKey = "endpointId"; +constexpr const char * kAttributeIdKey = "attributeId"; +constexpr const char * kCommandIdKey = "commandId"; +constexpr const char * kErrorIdKey = "error"; +constexpr const char * kClusterErrorIdKey = "clusterError"; +constexpr const char * kValueKey = "value"; + +constexpr const char kBase64Header[] = "base64:"; + +namespace { +RemoteDataModelLoggerDelegate * gDelegate; + +std::string JsonToString(Json::Value & json) +{ + Json::FastWriter writer; + writer.omitEndingLineFeed(); + return writer.write(json); +} + +CHIP_ERROR LogError(Json::Value & value, const chip::app::StatusIB & status) +{ + if (status.mClusterStatus.HasValue()) { + auto statusValue = status.mClusterStatus.Value(); + value[kClusterErrorIdKey] = statusValue; + } + +#if CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT + auto statusName = chip::Protocols::InteractionModel::StatusName(status.mStatus); + value[kErrorIdKey] = statusName; +#else + auto statusName = status.mStatus; + value[kErrorIdKey] = chip::to_underlying(statusName); +#endif // CHIP_CONFIG_IM_STATUS_CODE_VERBOSE_FORMAT + + auto valueStr = JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR AsJsonValue(id value, Json::Value & jsonValue) +{ + if (value == nil) { + jsonValue = Json::nullValue; + } else if ([value isKindOfClass:[NSNumber class]]) { + if (CFNumberIsFloatType((CFNumberRef) value)) { + jsonValue = [value doubleValue]; + } else if ([[value stringValue] hasPrefix:@"-"]) { + jsonValue = [value longLongValue]; + } else { + jsonValue = [value unsignedLongLongValue]; + } + } else if ([value isKindOfClass:[NSArray class]]) { + jsonValue = Json::arrayValue; + + NSArray * array = value; + for (id element in array) { + Json::Value jsonElement; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(element, jsonElement)); + jsonValue.append(jsonElement); + } + } else if ([value isKindOfClass:[NSDictionary class]]) { + jsonValue = Json::ValueType::objectValue; + + NSDictionary * dict = value; + for (id key in dict) { + Json::Value jsonElement; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue([dict objectForKey:key], jsonElement)); + jsonValue[[key UTF8String]] = jsonElement; + } + } else if ([value isKindOfClass:[NSData class]]) { + NSData * data = value; + data = [data base64EncodedDataWithOptions:0]; + auto base64Str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + auto prefix = [NSString stringWithUTF8String:kBase64Header]; + auto base64PrefixedStr = [prefix stringByAppendingString:base64Str]; + jsonValue = [base64PrefixedStr UTF8String]; + } else if ([value isKindOfClass:[NSString class]]) { + jsonValue = [value UTF8String]; + } else if ([value isKindOfClass:[NSObject class]]) { + jsonValue = Json::ValueType::objectValue; + + unsigned int numberOfProperties; + objc_property_t * properties = class_copyPropertyList([value class], &numberOfProperties); + for (NSUInteger i = 0; i < numberOfProperties; i++) { + objc_property_t property = properties[i]; + NSString * key = [[NSString alloc] initWithUTF8String:property_getName(property)]; + + Json::Value jsonElement; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue([value valueForKey:key], jsonElement)); + jsonValue[[key UTF8String]] = jsonElement; + } + free(properties); + } else { + return CHIP_ERROR_NOT_IMPLEMENTED; + } + + return CHIP_NO_ERROR; +} + +} // namespace + +namespace RemoteDataModelLogger { +CHIP_ERROR LogAttributeAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * attributeId, id result) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kEndpointIdKey] = [endpointId unsignedLongLongValue]; + value[kClusterIdKey] = [clusterId unsignedLongLongValue]; + value[kAttributeIdKey] = [attributeId unsignedLongLongValue]; + + Json::Value jsonValue; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(result, jsonValue)); + value[kValueKey] = jsonValue; + + auto valueStr = JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR LogCommandAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * commandId, id result) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kEndpointIdKey] = [endpointId unsignedLongLongValue]; + value[kClusterIdKey] = [clusterId unsignedLongLongValue]; + value[kCommandIdKey] = [commandId unsignedLongLongValue]; + + Json::Value jsonValue; + VerifyOrDie(CHIP_NO_ERROR == AsJsonValue(result, jsonValue)); + value[kValueKey] = jsonValue; + + auto valueStr = JsonToString(value); + return gDelegate->LogJSON(valueStr.c_str()); +} + +CHIP_ERROR LogAttributeErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * attributeId, NSError * error) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kEndpointIdKey] = [endpointId unsignedLongLongValue]; + value[kClusterIdKey] = [clusterId unsignedLongLongValue]; + value[kAttributeIdKey] = [attributeId unsignedLongLongValue]; + + auto err = MTRErrorToCHIPErrorCode(error); + auto status = chip::app::StatusIB(err); + return LogError(value, status); +} + +CHIP_ERROR LogCommandErrorAsJSON(NSNumber * endpointId, NSNumber * clusterId, NSNumber * commandId, NSError * error) +{ + VerifyOrReturnError(gDelegate != nullptr, CHIP_NO_ERROR); + + Json::Value value; + value[kEndpointIdKey] = [endpointId unsignedLongLongValue]; + value[kClusterIdKey] = [clusterId unsignedLongLongValue]; + value[kCommandIdKey] = [commandId unsignedLongLongValue]; + + auto err = MTRErrorToCHIPErrorCode(error); + auto status = chip::app::StatusIB(err); + return LogError(value, status); +} + +void SetDelegate(RemoteDataModelLoggerDelegate * delegate) { gDelegate = delegate; } +}; // namespace RemoteDataModelLogger diff --git a/examples/darwin-framework-tool/commands/delay/Commands.h b/examples/darwin-framework-tool/commands/delay/Commands.h new file mode 100644 index 00000000000000..1f0ecfb8e997a4 --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/Commands.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include "commands/common/Commands.h" +#include "commands/delay/SleepCommand.h" +#include "commands/delay/WaitForCommissioneeCommand.h" + +void registerCommandsDelay(Commands & commands) +{ + const char * clusterName = "Delay"; + commands_list clusterCommands = { + make_unique(), // + make_unique(), // + }; + + commands.RegisterCommandSet(clusterName, clusterCommands, "Commands for waiting for something to happen."); +} diff --git a/examples/darwin-framework-tool/commands/delay/SleepCommand.h b/examples/darwin-framework-tool/commands/delay/SleepCommand.h new file mode 100644 index 00000000000000..417bc59688b2d5 --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/SleepCommand.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "../common/CHIPCommandBridge.h" + +/** + * This command blocks the event loop processing for a given amount of time. + * + * For example when the event loop is blocked the messages coming-in will not be acked, + * forcing a retransmission on the other side. + * + */ + +class SleepCommand : public CHIPCommandBridge +{ +public: + SleepCommand() : CHIPCommandBridge("sleep") + { + AddArgument("duration-in-ms", 0, UINT32_MAX, &mDurationInMs, + "Block the event loop processing for duration-in-ms milliseconds."); + } + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; + chip::System::Clock::Timeout GetWaitDuration() const override + { + // The allowed duration of this method is at least as long as the time specified for blocking the + // event loop. In order to not fail on some small delays in processing some extra time before + // failing is added. + constexpr uint16_t mExtraTimeForFailure = 1000; + + return chip::System::Clock::Milliseconds32(mDurationInMs + mExtraTimeForFailure); + } + +private: + uint32_t mDurationInMs; +}; diff --git a/examples/darwin-framework-tool/commands/delay/SleepCommand.mm b/examples/darwin-framework-tool/commands/delay/SleepCommand.mm new file mode 100644 index 00000000000000..8fefd145e8acee --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/SleepCommand.mm @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "SleepCommand.h" +#include +#include + +CHIP_ERROR SleepCommand::RunCommand() +{ + std::this_thread::sleep_for(std::chrono::milliseconds(mDurationInMs)); + SetCommandExitStatus(CHIP_NO_ERROR); + return CHIP_NO_ERROR; +} diff --git a/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h new file mode 100644 index 00000000000000..053d8c04247493 --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include "../common/CHIPCommandBridge.h" +#include +#include + +NS_ASSUME_NONNULL_BEGIN +@interface MTRDeviceTestDelegate : NSObject +@property CHIPCommandBridge * commandBridge; +- (instancetype)initWithCommandBridge:(CHIPCommandBridge *)commandBridge; +- (instancetype)init NS_UNAVAILABLE; +@end +NS_ASSUME_NONNULL_END + +class WaitForCommissioneeCommand : public CHIPCommandBridge { +public: + WaitForCommissioneeCommand() + : CHIPCommandBridge("wait-for-commissionee") + , mDeviceDelegate([[MTRDeviceTestDelegate alloc] initWithCommandBridge:this]) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("expire-existing-session", 0, 1, &mExpireExistingSession); + AddArgument( + "timeout", 0, UINT64_MAX, &mTimeoutSecs, "Time, in seconds, before this command is considered to have timed out."); + } + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeoutSecs.ValueOr(10)); + } + +private: + chip::NodeId mNodeId; + chip::Optional mTimeoutSecs; + chip::Optional mExpireExistingSession; + id _Nullable mDeviceDelegate; +}; diff --git a/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm new file mode 100644 index 00000000000000..a806757ac1eb85 --- /dev/null +++ b/examples/darwin-framework-tool/commands/delay/WaitForCommissioneeCommand.mm @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#include "WaitForCommissioneeCommand.h" + +#import "MTRDevice_Externs.h" + +@implementation MTRDeviceTestDelegate +- (instancetype)initWithCommandBridge:(CHIPCommandBridge *)commandBridge +{ + if (!(self = [super init])) { + return nil; + } + + _commandBridge = commandBridge; + return self; +} + +- (void)device:(MTRDevice *)device stateChanged:(MTRDeviceState)state +{ + if (state == MTRDeviceStateReachable) { + _commandBridge->SetCommandExitStatus(CHIP_NO_ERROR); + } else if (state == MTRDeviceStateUnreachable) { + _commandBridge->SetCommandExitStatus(CHIP_ERROR_NOT_FOUND); + } else if (state == MTRDeviceStateUnknown) { + _commandBridge->SetCommandExitStatus(CHIP_ERROR_NOT_FOUND); + } else { + // This should not happens. + chipDie(); + } +} + +- (void)device:(MTRDevice *)device receivedAttributeReport:(NSArray *> *)attributeReport +{ +} + +- (void)device:(MTRDevice *)device receivedEventReport:(NSArray *> *)eventReport +{ +} +@end + +CHIP_ERROR WaitForCommissioneeCommand::RunCommand() +{ + MTRDeviceController * commissioner = CurrentCommissioner(); + + auto * base_device = [MTRBaseDevice deviceWithNodeID:@(mNodeId) controller:commissioner]; + VerifyOrReturnError(base_device != nil, CHIP_ERROR_INCORRECT_STATE); + + if (mExpireExistingSession.ValueOr(true)) { + [base_device invalidateCASESession]; + } + base_device = nil; + + auto * device = [MTRDevice deviceWithNodeID:@(mNodeId) controller:commissioner]; + VerifyOrReturnError(device != nil, CHIP_ERROR_INCORRECT_STATE); + + auto queue = dispatch_queue_create("com.chip.wait_for_commissionee", DISPATCH_QUEUE_SERIAL); + [device setDelegate:mDeviceDelegate queue:queue]; + + return CHIP_NO_ERROR; +} diff --git a/examples/darwin-framework-tool/commands/interactive/Commands.h b/examples/darwin-framework-tool/commands/interactive/Commands.h index fdc92f45579725..96cc657048899a 100644 --- a/examples/darwin-framework-tool/commands/interactive/Commands.h +++ b/examples/darwin-framework-tool/commands/interactive/Commands.h @@ -32,6 +32,7 @@ void registerCommandsInteractive(Commands & commands) commands_list clusterCommands = { #if CONFIG_USE_INTERACTIVE_MODE make_unique(&commands), + make_unique(&commands), #endif // CONFIG_USE_INTERACTIVE_MODE }; diff --git a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.h b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.h index cff524a1c0650e..15f1303f0fe54f 100644 --- a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.h +++ b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.h @@ -21,28 +21,63 @@ #import #include "../common/CHIPCommandBridge.h" +#include "../common/RemoteDataModelLogger.h" #include "commands/common/Commands.h" #include "InteractiveCommands.h" +#include + class Commands; -class InteractiveStartCommand : public CHIPCommandBridge +class InteractiveCommand : public CHIPCommandBridge { public: - InteractiveStartCommand(Commands * commandsHandler) : CHIPCommandBridge("start"), mHandler(commandsHandler) + InteractiveCommand(const char * name, Commands * commandsHandler) : CHIPCommandBridge(name), mHandler(commandsHandler) { AddArgument( "additional-prompt", &mAdditionalPrompt, "Force printing of an additional prompt that can then be detected by something trying to script interactive mode"); } - CHIP_ERROR RunCommand() override; - chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(0); } + bool ParseCommand(char * command, int * status); + +protected: + chip::Optional mAdditionalPrompt; + private: - bool ParseCommand(char * command); Commands * mHandler = nullptr; - chip::Optional mAdditionalPrompt; +}; + +class InteractiveStartCommand : public InteractiveCommand +{ +public: + InteractiveStartCommand(Commands * commandsHandler) : InteractiveCommand("start", commandsHandler) {} + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; +}; + +class InteractiveServerCommand : public InteractiveCommand, public WebSocketServerDelegate, public RemoteDataModelLoggerDelegate +{ +public: + InteractiveServerCommand(Commands * commandsHandler) : InteractiveCommand("server", commandsHandler) + { + AddArgument("port", 0, UINT16_MAX, &mPort, "Port the websocket will listen to. Defaults to 9002."); + } + + /////////// CHIPCommandBridge Interface ///////// + CHIP_ERROR RunCommand() override; + + /////////// WebSocketServerDelegate Interface ///////// + bool OnWebSocketMessageReceived(char * msg) override; + + /////////// RemoteDataModelLoggerDelegate interface ///////// + CHIP_ERROR LogJSON(const char * json) override; + +private: + WebSocketServer mWebSocketServer; + chip::Optional mPort; }; diff --git a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm index a3db301d6529ee..ab55be5a245cfe 100644 --- a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm +++ b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm @@ -18,6 +18,7 @@ #include "InteractiveCommands.h" +#include #include #include @@ -25,6 +26,9 @@ constexpr const char * kInteractiveModePrompt = "Stop and restart stack: [Ctrl+_] & [Ctrl+^] \nQuit Interactive: 'quit()'\n>>> "; constexpr const char * kInteractiveModeHistoryFilePath = "/tmp/darwin_framework_tool_history"; constexpr const char * kInteractiveModeStopCommand = "quit()"; +constexpr const char * kCategoryError = "Error"; +constexpr const char * kCategoryProgress = "Info"; +constexpr const char * kCategoryDetail = "Debug"; namespace { @@ -71,6 +75,187 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category, chip::Logging::Platform::LogV(module, category, msg, args); ClearLine(); } + +class ScopedLock { +public: + ScopedLock(std::mutex & mutex) + : mMutex(mutex) + { + mMutex.lock(); + } + + ~ScopedLock() { mMutex.unlock(); } + +private: + std::mutex & mMutex; +}; + +struct InteractiveServerResultLog { + std::string module; + std::string message; + std::string messageType; +}; + +struct InteractiveServerResult { + bool mEnabled = false; + uint16_t mTimeout = 0; + int mStatus = EXIT_SUCCESS; + bool mIsAsyncReport = false; + std::vector mResults; + std::vector mLogs; + + // The InteractiveServerResult instance (gInteractiveServerResult) is initially + // accessed on the main thread in InteractiveServerCommand::RunCommand, which is + // when chip-tool starts in 'interactive server' mode. + // + // Then command results are normally sent over the wire onto the main thread too + // when a command is received over WebSocket in InteractiveServerCommand::OnWebSocketMessageReceived + // which for most cases runs a command onto the chip thread and block until + // it is resolved (or until it timeouts). + // + // But in the meantime, when some parts of the command result happens, it is appended + // to the mResults vector onto the chip thread. + // + // For empty commands, which means that the test suite is *waiting* for some events + // (e.g a subscription report), the command results are sent over the chip thread + // (this is the isAsyncReport use case). + // + // Finally, logs can be appended from either the chip thread or the main thread. + // + // This class should be refactored to abstract that properly and reduce the scope of + // of the mutex, but in the meantime, the access to the members of this class are + // protected by a mutex. + std::mutex mMutex; + + void Setup(bool isAsyncReport, uint16_t timeout) + { + auto lock = ScopedLock(mMutex); + mEnabled = true; + mIsAsyncReport = isAsyncReport; + mTimeout = timeout; + } + + void Reset() + { + auto lock = ScopedLock(mMutex); + + mEnabled = false; + mIsAsyncReport = false; + mTimeout = 0; + mStatus = EXIT_SUCCESS; + mResults.clear(); + mLogs.clear(); + } + + bool IsAsyncReport() + { + auto lock = ScopedLock(mMutex); + return mIsAsyncReport; + } + + void MaybeAddLog(const char * module, uint8_t category, const char * base64Message) + { + auto lock = ScopedLock(mMutex); + VerifyOrReturn(mEnabled); + + const char * messageType = nullptr; + switch (category) { + case chip::Logging::kLogCategory_Error: + messageType = kCategoryError; + break; + case chip::Logging::kLogCategory_Progress: + messageType = kCategoryProgress; + break; + case chip::Logging::kLogCategory_Detail: + messageType = kCategoryDetail; + break; + default: + // This should not happen. + chipDie(); + break; + } + + mLogs.push_back(InteractiveServerResultLog({ module, base64Message, messageType })); + } + + void MaybeAddResult(const char * result) + { + auto lock = ScopedLock(mMutex); + VerifyOrReturn(mEnabled); + + mResults.push_back(result); + } + + std::string AsJsonString() + { + auto lock = ScopedLock(mMutex); + + std::stringstream content; + content << "{"; + + content << " \"results\": ["; + if (mResults.size()) { + for (const auto & result : mResults) { + content << result << ","; + } + + // Remove last comma. + content.seekp(-1, std::ios_base::end); + } + + if (mStatus != EXIT_SUCCESS) { + if (mResults.size()) { + content << ","; + } + content << "{ \"error\": \"FAILURE\" }"; + } + content << "],"; + + content << "\"logs\": ["; + if (mLogs.size()) { + for (const auto & log : mLogs) { + content << "{" + " \"module\": \"" + + log.module + + "\"," + " \"category\": \"" + + log.messageType + + "\"," + " \"message\": \"" + + log.message + + "\"" + "},"; + } + + // Remove last comma. + content.seekp(-1, std::ios_base::end); + } + content << "]"; + + content << "}"; + return content.str(); + } +}; + +InteractiveServerResult gInteractiveServerResult; + +void ENFORCE_FORMAT(3, 0) InteractiveServerLoggingCallback(const char * module, uint8_t category, const char * msg, va_list args) +{ + va_list args_copy; + va_copy(args_copy, args); + + chip::Logging::Platform::LogV(module, category, msg, args); + + char message[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; + vsnprintf(message, sizeof(message), msg, args_copy); + va_end(args_copy); + + char base64Message[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE * 2] = {}; + chip::Base64Encode(chip::Uint8::from_char(message), static_cast(strlen(message)), base64Message); + + gInteractiveServerResult.MaybeAddLog(module, category, base64Message); +} + } // namespace char * GetCommand(const chip::Optional & mAdditionalPrompt, char * command) @@ -122,9 +307,10 @@ el_status_t StopFunction() el_bind_key(CTL('_'), StopFunction); char * command = nullptr; + int status; while (YES) { command = GetCommand(mAdditionalPrompt, command); - if (command != nullptr && !ParseCommand(command)) { + if (command != nullptr && !ParseCommand(command, &status)) { break; } } @@ -138,7 +324,54 @@ el_status_t StopFunction() return CHIP_NO_ERROR; } -bool InteractiveStartCommand::ParseCommand(char * command) +CHIP_ERROR InteractiveServerCommand::RunCommand() +{ + read_history(kInteractiveModeHistoryFilePath); + + // Logs needs to be redirected in order to refresh the screen appropriately when something + // is dumped to stdout while the user is typing a command. + chip::Logging::SetLogRedirectCallback(InteractiveServerLoggingCallback); + + RemoteDataModelLogger::SetDelegate(this); + ReturnErrorOnFailure(mWebSocketServer.Run(mPort, this)); + + gInteractiveServerResult.Reset(); + SetCommandExitStatus(CHIP_NO_ERROR); + return CHIP_NO_ERROR; +} + +bool InteractiveServerCommand::OnWebSocketMessageReceived(char * msg) +{ + bool isAsyncReport = strlen(msg) == 0; + uint16_t timeout = 0; + if (!isAsyncReport && strlen(msg) <= 5 /* Only look for numeric values <= 65535 */) { + std::stringstream ss; + ss << msg; + ss >> timeout; + if (!ss.fail()) { + isAsyncReport = true; + } + } + gInteractiveServerResult.Setup(isAsyncReport, timeout); + VerifyOrReturnValue(!isAsyncReport, true); + + auto shouldStop = ParseCommand(msg, &gInteractiveServerResult.mStatus); + mWebSocketServer.Send(gInteractiveServerResult.AsJsonString().c_str()); + gInteractiveServerResult.Reset(); + return shouldStop; +} + +CHIP_ERROR InteractiveServerCommand::LogJSON(const char * json) +{ + gInteractiveServerResult.MaybeAddResult(json); + if (gInteractiveServerResult.IsAsyncReport()) { + mWebSocketServer.Send(gInteractiveServerResult.AsJsonString().c_str()); + gInteractiveServerResult.Reset(); + } + return CHIP_NO_ERROR; +} + +bool InteractiveCommand::ParseCommand(char * command, int * status) { if (strcmp(command, kInteractiveModeStopCommand) == 0) { ExecuteDeferredCleanups(); @@ -146,6 +379,8 @@ el_status_t StopFunction() } ClearLine(); - mHandler->RunInteractive(command); + + *status = mHandler->RunInteractive(command); + return YES; } diff --git a/examples/darwin-framework-tool/main.mm b/examples/darwin-framework-tool/main.mm index 51325001e59c2e..8c96d490dc5ed8 100644 --- a/examples/darwin-framework-tool/main.mm +++ b/examples/darwin-framework-tool/main.mm @@ -21,6 +21,7 @@ #import "logging/logging.h" #include "commands/common/Commands.h" +#include "commands/delay/Commands.h" #include "commands/discover/Commands.h" #include "commands/interactive/Commands.h" #include "commands/pairing/Commands.h" @@ -38,6 +39,7 @@ int main(int argc, const char * argv[]) Commands commands; registerCommandsPairing(commands); + registerCommandsDelay(commands); registerCommandsDiscover(commands); registerCommandsInteractive(commands); registerCommandsPayload(commands); diff --git a/examples/darwin-framework-tool/templates/commands.zapt b/examples/darwin-framework-tool/templates/commands.zapt index f572311a53c2c5..9d1c98e1d1d06f 100644 --- a/examples/darwin-framework-tool/templates/commands.zapt +++ b/examples/darwin-framework-tool/templates/commands.zapt @@ -74,6 +74,10 @@ public: {{#if hasSpecificResponse}} ^(MTR{{asUpperCamelCase parent.name preserveAcronyms=true}}Cluster{{asUpperCamelCase responseName}}Params * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase responseName}}::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } {{else}} ^(NSError * _Nullable error) { {{/if}} @@ -81,6 +85,12 @@ public: if (error != nil) { mError = error; LogNSError("Error", error); + {{#if hasSpecificResponse}} + constexpr chip::CommandId responseId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase responseName}}::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + {{else}} + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + {{/if}} } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -153,8 +163,11 @@ public: {{~/if_is_fabric_scoped_struct~}} ^({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error) { NSLog(@"{{asUpperCamelCase parent.name preserveAcronyms=true}}.{{asUpperCamelCase name preserveAcronyms=true}} response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("{{asUpperCamelCase parent.name preserveAcronyms=true}} {{asUpperCamelCase name preserveAcronyms=true}} read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -200,17 +213,33 @@ public: {{#if_chip_complex}} {{asObjectiveCType type parent.name}} value; {{>decodable_value target="value" source="mValue" cluster=parent.name errorCode="return err;" depth=0}} - {{else if (isOctetString type)}} - {{asObjectiveCType type parent.name}} value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; - {{else if (isString type)}} - {{asObjectiveCType type parent.name}} value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding]; {{else}} - {{asObjectiveCType type parent.name}} value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue]; + {{#if isNullable}} + {{asObjectiveCType type parent.name}} value = nil; + if (!mValue.IsNull()) { + {{#if (isOctetString type)}} + value = [[NSData alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size()]; + {{else if (isString type)}} + value = [[NSString alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size() encoding:NSUTF8StringEncoding]; + {{else}} + value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue.Value()]; + {{/if}} + } + {{else}} + {{#if (isOctetString type)}} + {{asObjectiveCType type parent.name}} value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; + {{else if (isString type)}} + {{asObjectiveCType type parent.name}} value = [[NSString alloc] initWithBytes:mValue.data() length:mValue.size() encoding:NSUTF8StringEncoding]; + {{else}} + {{asObjectiveCType type parent.name}} value = [NSNumber numberWith{{asObjectiveCNumberType "" type false}}:mValue{{#if isNullable}}.Value(){{/if}}]; + {{/if}} + {{/if}} {{/if_chip_complex}} [cluster write{{>attribute}}WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("{{asUpperCamelCase parent.name preserveAcronyms=true}} {{asUpperCamelCase name preserveAcronyms=true}} write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -222,11 +251,11 @@ private: {{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotOptional=true}} mValue; TypedComplexArgument<{{zapTypeToEncodableClusterObjectType type ns=parent.name forceNotOptional=true}}> mComplex; {{else if (isOctetString type)}} - chip::ByteSpan mValue; + {{#if isNullable}}chip::app::DataModel::Nullable{{else}}chip::ByteSpan{{/if}} mValue; {{else if (isCharString type)}} - chip::ByteSpan mValue; + {{#if isNullable}}chip::app::DataModel::Nullable{{else}}chip::ByteSpan{{/if}} mValue; {{else}} - {{as_underlying_zcl_type type}} mValue; + {{#if isNullable}}chip::app::DataModel::Nullable<{{as_underlying_zcl_type type}}>{{else}}{{as_underlying_zcl_type type}}{{/if}} mValue; {{/if_chip_complex}} }; @@ -265,6 +294,11 @@ public: subscriptionEstablished:^(){ mSubscriptionEstablished=YES; } reportHandler:^({{asObjectiveCClass type parent.name}} * _Nullable value, NSError * _Nullable error) { NSLog(@"{{asUpperCamelCase parent.name preserveAcronyms=true}}.{{asUpperCamelCase name preserveAcronyms=true}} response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; diff --git a/scripts/tests/yaml/chiptool.py b/scripts/tests/yaml/chiptool.py index 757d304312d77b..60fc542d572311 100755 --- a/scripts/tests/yaml/chiptool.py +++ b/scripts/tests/yaml/chiptool.py @@ -16,64 +16,15 @@ import relative_importer # isort: split # noqa: F401 -import asyncio -import json import sys from typing import List import click -from matter_chip_tool_adapter.decoder import MatterLog -from matter_yamltests.websocket_runner import WebSocketRunner, WebSocketRunnerConfig from paths_finder import PathsFinder -from runner import CONTEXT_SETTINGS, chiptool, runner_base -from tests_logger import TestColoredLogPrinter, WebSocketRunnerLogger +from runner import CONTEXT_SETTINGS, chiptool +from tests_tool import send_raw_command, send_yaml_command _DEFAULT_EXTENSIONS_DIR = 'scripts/tests/yaml/extensions' - - -@click.pass_context -def send_yaml_command(ctx, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]): - kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'pics': pics, - 'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory} - - index = 0 - while len(commands) - index > 1: - kwargs[commands[index].replace('--', '')] = commands[index+1] - index += 2 - ctx.invoke(runner_base, **kwargs) - - del ctx.params['commands'] - del ctx.params['pics'] - del ctx.params['additional_pseudo_clusters_directory'] - - return ctx.forward(chiptool) - - -def send_raw_command(command: str, server_path: str, server_arguments: str): - websocket_runner_hooks = WebSocketRunnerLogger() - websocket_runner_config = WebSocketRunnerConfig( - server_path=server_path, server_arguments=server_arguments, hooks=websocket_runner_hooks) - runner = WebSocketRunner(websocket_runner_config) - - async def send_over_websocket(): - payload = None - try: - await runner.start() - payload = await runner.execute(command) - finally: - await runner.stop() - return payload - - payload = asyncio.run(send_over_websocket()) - json_payload = json.loads(payload) - - log_printer = TestColoredLogPrinter() - log_printer.print(MatterLog.decode_logs(json_payload.get('logs'))) - - success = not bool(len([lambda x: x.get('error') for x in json_payload.get('results')])) - return success - - _DEFAULT_PICS_FILE = 'src/app/tests/suites/certification/ci-pics-values' @@ -136,7 +87,7 @@ def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, se maybe_update_stop_on_error(ctx) if len(commands) > 1 and commands[0] == 'tests': - success = send_yaml_command(commands[1], server_path, server_arguments, show_adapter_logs, pics, + success = send_yaml_command(chiptool, commands[1], server_path, server_arguments, show_adapter_logs, pics, additional_pseudo_clusters_directory, commands[2:]) else: if server_path is None and server_name: diff --git a/scripts/tests/yaml/darwinframeworktool.py b/scripts/tests/yaml/darwinframeworktool.py new file mode 100755 index 00000000000000..77ab3d8b813716 --- /dev/null +++ b/scripts/tests/yaml/darwinframeworktool.py @@ -0,0 +1,85 @@ +#!/usr/bin/env -S python3 -B + +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import relative_importer # isort: split # noqa: F401 + +import sys +from typing import List + +import click +from paths_finder import PathsFinder +from runner import CONTEXT_SETTINGS, darwinframeworktool +from tests_tool import send_raw_command, send_yaml_command + +_DEFAULT_EXTENSIONS_DIR = 'scripts/tests/yaml/extensions' +_DEFAULT_PICS_FILE = 'src/app/tests/suites/certification/ci-pics-values' + + +def darwinframeworktool_runner_options(f): + f = click.option('--server_path', type=click.Path(exists=True), default=None, + help='Path to an websocket server to run at launch.')(f) + f = click.option('--server_name', type=str, default='darwin-framework-tool', + help='Name of a websocket server to run at launch.')(f) + f = click.option('--server_arguments', type=str, default='interactive server', + help='Optional arguments to pass to the websocket server at launch.')(f) + f = click.option('--show_adapter_logs', type=bool, default=False, show_default=True, + help='Show additional logs provided by the adapter.')(f) + f = click.option('--delay-in-ms', '--delayInMs', type=int, default=0, show_default=True, + help='Add a delay between each test suite steps.')(f) + f = click.option('--continueOnFailure', type=bool, default=False, show_default=True, + help='Do not stop running the test suite on first error.')(f) + f = click.option('--PICS', type=click.Path(exists=True), show_default=True, default=_DEFAULT_PICS_FILE, + help='Path to the PICS file to use.')(f) + f = click.option('--additional_pseudo_clusters_directory', type=click.Path(), show_default=True, default=_DEFAULT_EXTENSIONS_DIR, + help='Path to a directory containing additional pseudo clusters.')(f) + return f + + +CONTEXT_SETTINGS['ignore_unknown_options'] = True +CONTEXT_SETTINGS['default_map']['darwinframeworktool']['use_test_harness_log_format'] = True + + +def maybe_update_stop_on_error(ctx): + if ctx.params['continueonfailure']: + ctx.params['stop_on_error'] = False + + del ctx.params['continueonfailure'] + + +@click.command(context_settings=CONTEXT_SETTINGS) +@click.argument('commands', nargs=-1) +@darwinframeworktool_runner_options +@click.pass_context +def darwinframeworktool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str): + success = False + + server_arguments = ctx.params['server_arguments'] + maybe_update_stop_on_error(ctx) + + if len(commands) > 1 and commands[0] == 'tests': + success = send_yaml_command(darwinframeworktool, commands[1], server_path, server_arguments, show_adapter_logs, pics, + additional_pseudo_clusters_directory, commands[2:]) + else: + if server_path is None and server_name: + paths_finder = PathsFinder() + server_path = paths_finder.get(server_name) + success = send_raw_command(' '.join(commands), server_path, server_arguments) + + sys.exit(0 if success else 1) + + +if __name__ == '__main__': + darwinframeworktool_py() diff --git a/scripts/tests/yaml/runner.py b/scripts/tests/yaml/runner.py index 04f30401eb1b02..073726fa7e4813 100755 --- a/scripts/tests/yaml/runner.py +++ b/scripts/tests/yaml/runner.py @@ -224,6 +224,11 @@ def __add_custom_params(self, ctx): 'server_name': 'chip-tool', 'server_arguments': 'interactive server', }, + 'darwinframeworktool': { + 'adapter': 'matter_chip_tool_adapter.adapter', + 'server_name': 'darwin-framework-tool', + 'server_arguments': 'interactive server', + }, 'app1': { 'configuration_directory': 'examples/placeholder/linux/apps/app1', 'adapter': 'matter_placeholder_adapter.adapter', @@ -349,6 +354,15 @@ def chiptool(ctx, *args, **kwargs): return ctx.forward(websocket) +@runner_base.command() +@test_runner_options +@websocket_runner_options +@click.pass_context +def darwinframeworktool(ctx, *args, **kwargs): + """Run the test suite using darwin-framework-tool.""" + return ctx.forward(websocket) + + @runner_base.command() @test_runner_options @websocket_runner_options diff --git a/scripts/tests/yaml/tests_tool.py b/scripts/tests/yaml/tests_tool.py new file mode 100644 index 00000000000000..65883a4bf8def5 --- /dev/null +++ b/scripts/tests/yaml/tests_tool.py @@ -0,0 +1,68 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import relative_importer # isort: split # noqa: F401 + +import asyncio +import json +from typing import List + +import click +from matter_chip_tool_adapter.decoder import MatterLog +from matter_yamltests.websocket_runner import WebSocketRunner, WebSocketRunnerConfig +from runner import runner_base +from tests_logger import TestColoredLogPrinter, WebSocketRunnerLogger + + +@click.pass_context +def send_yaml_command(ctx, test_tool, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]): + kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'pics': pics, + 'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory} + + index = 0 + while len(commands) - index > 1: + kwargs[commands[index].replace('--', '')] = commands[index+1] + index += 2 + ctx.invoke(runner_base, **kwargs) + + del ctx.params['commands'] + del ctx.params['pics'] + del ctx.params['additional_pseudo_clusters_directory'] + + return ctx.forward(test_tool) + + +def send_raw_command(command: str, server_path: str, server_arguments: str): + websocket_runner_hooks = WebSocketRunnerLogger() + websocket_runner_config = WebSocketRunnerConfig( + server_path=server_path, server_arguments=server_arguments, hooks=websocket_runner_hooks) + runner = WebSocketRunner(websocket_runner_config) + + async def send_over_websocket(): + payload = None + try: + await runner.start() + payload = await runner.execute(command) + finally: + await runner.stop() + return payload + + payload = asyncio.run(send_over_websocket()) + json_payload = json.loads(payload) + + log_printer = TestColoredLogPrinter() + log_printer.print(MatterLog.decode_logs(json_payload.get('logs'))) + + success = not bool(len([lambda x: x.get('error') for x in json_payload.get('results')])) + return success diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index fc6fcc5c7f2c13..6f901de32ab3d5 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -259,6 +259,49 @@ B2E0D7B8245B0B5C003C5B48 /* MTRSetupPayload.h in Headers */ = {isa = PBXBuildFile; fileRef = B2E0D7AF245B0B5C003C5B48 /* MTRSetupPayload.h */; settings = {ATTRIBUTES = (Public, ); }; }; B2E0D7B9245B0B5C003C5B48 /* MTRSetupPayload.mm in Sources */ = {isa = PBXBuildFile; fileRef = B2E0D7B0245B0B5C003C5B48 /* MTRSetupPayload.mm */; }; B2F53AF2245B0DCF0010745E /* MTRSetupPayloadParserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B2F53AF1245B0DCF0010745E /* MTRSetupPayloadParserTests.m */; }; + B45373AA2A9FE73400807602 /* WebSocketServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B45373A92A9FE73400807602 /* WebSocketServer.cpp */; }; + B45373BD2A9FEA9100807602 /* service.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B22A9FEA9000807602 /* service.c */; }; + B45373BE2A9FEA9100807602 /* network.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B32A9FEA9000807602 /* network.c */; }; + B45373BF2A9FEA9100807602 /* adopt.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B42A9FEA9000807602 /* adopt.c */; }; + B45373C02A9FEA9100807602 /* output.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B52A9FEA9000807602 /* output.c */; }; + B45373C12A9FEA9100807602 /* close.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B62A9FEA9000807602 /* close.c */; }; + B45373C22A9FEA9100807602 /* vhost.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B72A9FEA9000807602 /* vhost.c */; }; + B45373C32A9FEA9100807602 /* wsi.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B82A9FEA9000807602 /* wsi.c */; }; + B45373C42A9FEA9100807602 /* dummy-callback.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373B92A9FEA9000807602 /* dummy-callback.c */; }; + B45373C52A9FEA9100807602 /* wsi-timeout.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373BA2A9FEA9000807602 /* wsi-timeout.c */; }; + B45373C62A9FEA9100807602 /* sorted-usec-list.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373BB2A9FEA9100807602 /* sorted-usec-list.c */; }; + B45373C72A9FEA9100807602 /* pollfd.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373BC2A9FEA9100807602 /* pollfd.c */; }; + B45373D12A9FEB0C00807602 /* alloc.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CA2A9FEB0C00807602 /* alloc.c */; }; + B45373D22A9FEB0C00807602 /* buflist.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CB2A9FEB0C00807602 /* buflist.c */; }; + B45373D32A9FEB0C00807602 /* libwebsockets.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CC2A9FEB0C00807602 /* libwebsockets.c */; }; + B45373D42A9FEB0C00807602 /* context.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CD2A9FEB0C00807602 /* context.c */; }; + B45373D52A9FEB0C00807602 /* logs.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373CE2A9FEB0C00807602 /* logs.c */; }; + B45373D72A9FEB0C00807602 /* lws_dll2.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373D02A9FEB0C00807602 /* lws_dll2.c */; }; + B45373D92A9FEB3800807602 /* poll.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373D82A9FEB3800807602 /* poll.c */; }; + B45373DC2A9FEB5300807602 /* sha-1.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373DA2A9FEB5300807602 /* sha-1.c */; }; + B45373DD2A9FEB5300807602 /* base64-decode.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373DB2A9FEB5300807602 /* base64-decode.c */; }; + B45373DF2A9FEB6F00807602 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373DE2A9FEB6F00807602 /* system.c */; }; + B45373E12A9FEB7F00807602 /* ops-h1.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E02A9FEB7F00807602 /* ops-h1.c */; }; + B45373E52A9FEBA400807602 /* date.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E22A9FEBA400807602 /* date.c */; }; + B45373E62A9FEBA400807602 /* header.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E32A9FEBA400807602 /* header.c */; }; + B45373E72A9FEBA400807602 /* parsers.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E42A9FEBA400807602 /* parsers.c */; }; + B45373E92A9FEBC100807602 /* server.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373E82A9FEBC100807602 /* server.c */; }; + B45373EB2A9FEBDB00807602 /* ops-listen.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373EA2A9FEBDB00807602 /* ops-listen.c */; }; + B45373ED2A9FEBEC00807602 /* ops-pipe.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373EC2A9FEBEC00807602 /* ops-pipe.c */; }; + B45373EF2A9FEBFE00807602 /* ops-raw-skt.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373EE2A9FEBFE00807602 /* ops-raw-skt.c */; }; + B45373F22A9FEC1A00807602 /* ops-ws.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F02A9FEC1A00807602 /* ops-ws.c */; }; + B45373F32A9FEC1A00807602 /* server-ws.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F12A9FEC1A00807602 /* server-ws.c */; }; + B45373FB2A9FEC4F00807602 /* unix-service.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F42A9FEC4F00807602 /* unix-service.c */; }; + B45373FC2A9FEC4F00807602 /* unix-caps.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F52A9FEC4F00807602 /* unix-caps.c */; }; + B45373FD2A9FEC4F00807602 /* unix-pipe.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F62A9FEC4F00807602 /* unix-pipe.c */; }; + B45373FE2A9FEC4F00807602 /* unix-fds.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F72A9FEC4F00807602 /* unix-fds.c */; }; + B45373FF2A9FEC4F00807602 /* unix-misc.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F82A9FEC4F00807602 /* unix-misc.c */; }; + B45374002A9FEC4F00807602 /* unix-init.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373F92A9FEC4F00807602 /* unix-init.c */; }; + B45374012A9FEC4F00807602 /* unix-sockets.c in Sources */ = {isa = PBXBuildFile; fileRef = B45373FA2A9FEC4F00807602 /* unix-sockets.c */; }; + B4E262162AA0CF1C00DBA5BC /* RemoteDataModelLogger.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */; }; + B4E262172AA0CF2000DBA5BC /* RemoteDataModelLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */; }; + B4E2621B2AA0D02000DBA5BC /* SleepCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */; }; + B4E2621E2AA0D02D00DBA5BC /* WaitForCommissioneeCommand.mm in Sources */ = {isa = PBXBuildFile; fileRef = B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */; }; BA09EB43247477BA00605257 /* libCHIP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BA09EB3F2474762900605257 /* libCHIP.a */; }; D4772A46285AE98400383630 /* MTRClusterConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = D4772A45285AE98300383630 /* MTRClusterConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; /* End PBXBuildFile section */ @@ -581,6 +624,49 @@ B2E0D7AF245B0B5C003C5B48 /* MTRSetupPayload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRSetupPayload.h; sourceTree = ""; }; B2E0D7B0245B0B5C003C5B48 /* MTRSetupPayload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRSetupPayload.mm; sourceTree = ""; }; B2F53AF1245B0DCF0010745E /* MTRSetupPayloadParserTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRSetupPayloadParserTests.m; sourceTree = ""; }; + B45373A92A9FE73400807602 /* WebSocketServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketServer.cpp; sourceTree = ""; }; + B45373B22A9FEA9000807602 /* service.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = service.c; path = "repo/lib/core-net/service.c"; sourceTree = ""; }; + B45373B32A9FEA9000807602 /* network.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = network.c; path = "repo/lib/core-net/network.c"; sourceTree = ""; }; + B45373B42A9FEA9000807602 /* adopt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = adopt.c; path = "repo/lib/core-net/adopt.c"; sourceTree = ""; }; + B45373B52A9FEA9000807602 /* output.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = output.c; path = "repo/lib/core-net/output.c"; sourceTree = ""; }; + B45373B62A9FEA9000807602 /* close.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = close.c; path = "repo/lib/core-net/close.c"; sourceTree = ""; }; + B45373B72A9FEA9000807602 /* vhost.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vhost.c; path = "repo/lib/core-net/vhost.c"; sourceTree = ""; }; + B45373B82A9FEA9000807602 /* wsi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = wsi.c; path = "repo/lib/core-net/wsi.c"; sourceTree = ""; }; + B45373B92A9FEA9000807602 /* dummy-callback.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "dummy-callback.c"; path = "repo/lib/core-net/dummy-callback.c"; sourceTree = ""; }; + B45373BA2A9FEA9000807602 /* wsi-timeout.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "wsi-timeout.c"; path = "repo/lib/core-net/wsi-timeout.c"; sourceTree = ""; }; + B45373BB2A9FEA9100807602 /* sorted-usec-list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "sorted-usec-list.c"; path = "repo/lib/core-net/sorted-usec-list.c"; sourceTree = ""; }; + B45373BC2A9FEA9100807602 /* pollfd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pollfd.c; path = "repo/lib/core-net/pollfd.c"; sourceTree = ""; }; + B45373CA2A9FEB0C00807602 /* alloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = alloc.c; path = repo/lib/core/alloc.c; sourceTree = ""; }; + B45373CB2A9FEB0C00807602 /* buflist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = buflist.c; path = repo/lib/core/buflist.c; sourceTree = ""; }; + B45373CC2A9FEB0C00807602 /* libwebsockets.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = libwebsockets.c; path = repo/lib/core/libwebsockets.c; sourceTree = ""; }; + B45373CD2A9FEB0C00807602 /* context.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = context.c; path = repo/lib/core/context.c; sourceTree = ""; }; + B45373CE2A9FEB0C00807602 /* logs.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = logs.c; path = repo/lib/core/logs.c; sourceTree = ""; }; + B45373D02A9FEB0C00807602 /* lws_dll2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lws_dll2.c; path = repo/lib/core/lws_dll2.c; sourceTree = ""; }; + B45373D82A9FEB3800807602 /* poll.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = poll.c; path = "repo/lib/event-libs/poll/poll.c"; sourceTree = ""; }; + B45373DA2A9FEB5300807602 /* sha-1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "sha-1.c"; path = "repo/lib/misc/sha-1.c"; sourceTree = ""; }; + B45373DB2A9FEB5300807602 /* base64-decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "base64-decode.c"; path = "repo/lib/misc/base64-decode.c"; sourceTree = ""; }; + B45373DE2A9FEB6F00807602 /* system.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = system.c; path = repo/lib/system/system.c; sourceTree = ""; }; + B45373E02A9FEB7F00807602 /* ops-h1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-h1.c"; path = "repo/lib/roles/h1/ops-h1.c"; sourceTree = ""; }; + B45373E22A9FEBA400807602 /* date.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = date.c; path = repo/lib/roles/http/date.c; sourceTree = ""; }; + B45373E32A9FEBA400807602 /* header.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = header.c; path = repo/lib/roles/http/header.c; sourceTree = ""; }; + B45373E42A9FEBA400807602 /* parsers.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = parsers.c; path = repo/lib/roles/http/parsers.c; sourceTree = ""; }; + B45373E82A9FEBC100807602 /* server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = server.c; path = repo/lib/roles/http/server/server.c; sourceTree = ""; }; + B45373EA2A9FEBDB00807602 /* ops-listen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-listen.c"; path = "repo/lib/roles/listen/ops-listen.c"; sourceTree = ""; }; + B45373EC2A9FEBEC00807602 /* ops-pipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-pipe.c"; path = "repo/lib/roles/pipe/ops-pipe.c"; sourceTree = ""; }; + B45373EE2A9FEBFE00807602 /* ops-raw-skt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-raw-skt.c"; path = "repo/lib/roles/raw-skt/ops-raw-skt.c"; sourceTree = ""; }; + B45373F02A9FEC1A00807602 /* ops-ws.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ops-ws.c"; path = "repo/lib/roles/ws/ops-ws.c"; sourceTree = ""; }; + B45373F12A9FEC1A00807602 /* server-ws.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "server-ws.c"; path = "repo/lib/roles/ws/server-ws.c"; sourceTree = ""; }; + B45373F42A9FEC4F00807602 /* unix-service.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-service.c"; path = "repo/lib/plat/unix/unix-service.c"; sourceTree = ""; }; + B45373F52A9FEC4F00807602 /* unix-caps.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-caps.c"; path = "repo/lib/plat/unix/unix-caps.c"; sourceTree = ""; }; + B45373F62A9FEC4F00807602 /* unix-pipe.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-pipe.c"; path = "repo/lib/plat/unix/unix-pipe.c"; sourceTree = ""; }; + B45373F72A9FEC4F00807602 /* unix-fds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-fds.c"; path = "repo/lib/plat/unix/unix-fds.c"; sourceTree = ""; }; + B45373F82A9FEC4F00807602 /* unix-misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-misc.c"; path = "repo/lib/plat/unix/unix-misc.c"; sourceTree = ""; }; + B45373F92A9FEC4F00807602 /* unix-init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-init.c"; path = "repo/lib/plat/unix/unix-init.c"; sourceTree = ""; }; + B45373FA2A9FEC4F00807602 /* unix-sockets.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "unix-sockets.c"; path = "repo/lib/plat/unix/unix-sockets.c"; sourceTree = ""; }; + B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteDataModelLogger.mm; sourceTree = ""; }; + B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteDataModelLogger.h; sourceTree = ""; }; + B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SleepCommand.mm; sourceTree = ""; }; + B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WaitForCommissioneeCommand.mm; sourceTree = ""; }; BA09EB3F2474762900605257 /* libCHIP.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libCHIP.a; path = lib/libCHIP.a; sourceTree = BUILT_PRODUCTS_DIR; }; BA107AEE2470CFBB004287EB /* chip_xcode_build_connector.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = chip_xcode_build_connector.sh; sourceTree = ""; }; D437613E285BDC0D0051FEA2 /* MTRErrorTestUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRErrorTestUtils.h; sourceTree = ""; }; @@ -639,6 +725,8 @@ 039546872991C400006D42A8 /* chip-tool */, 037C3D7B2991BD4F00B7EEE2 /* commands */, 037C3DAA2991BD4F00B7EEE2 /* logging */, + B45373AD2A9FE9BF00807602 /* libwebsockets */, + B4551B352A9FE53800331CD1 /* websocket-server */, ); name = "darwin-framework-tool"; path = "../../../examples/darwin-framework-tool"; @@ -647,6 +735,7 @@ 037C3D7B2991BD4F00B7EEE2 /* commands */ = { isa = PBXGroup; children = ( + B4E262182AA0CFFE00DBA5BC /* delay */, 03FB93DA2A46200A0048CB35 /* discover */, 037C3D7C2991BD4F00B7EEE2 /* pairing */, 037C3D852991BD4F00B7EEE2 /* clusters */, @@ -732,6 +821,8 @@ 037C3D9B2991BD4F00B7EEE2 /* common */ = { isa = PBXGroup; children = ( + B4E262132AA0C7A300DBA5BC /* RemoteDataModelLogger.h */, + B4E262122AA0C7A300DBA5BC /* RemoteDataModelLogger.mm */, 037C3D9C2991BD4F00B7EEE2 /* CHIPCommandBridge.mm */, 037C3D9D2991BD4F00B7EEE2 /* CHIPToolKeypair.mm */, 037C3D9E2991BD4F00B7EEE2 /* CHIPToolKeypair.h */, @@ -1173,6 +1264,70 @@ path = CHIPTests; sourceTree = ""; }; + B45373AD2A9FE9BF00807602 /* libwebsockets */ = { + isa = PBXGroup; + children = ( + B45373F52A9FEC4F00807602 /* unix-caps.c */, + B45373F72A9FEC4F00807602 /* unix-fds.c */, + B45373F92A9FEC4F00807602 /* unix-init.c */, + B45373F82A9FEC4F00807602 /* unix-misc.c */, + B45373F62A9FEC4F00807602 /* unix-pipe.c */, + B45373F42A9FEC4F00807602 /* unix-service.c */, + B45373FA2A9FEC4F00807602 /* unix-sockets.c */, + B45373F02A9FEC1A00807602 /* ops-ws.c */, + B45373F12A9FEC1A00807602 /* server-ws.c */, + B45373EE2A9FEBFE00807602 /* ops-raw-skt.c */, + B45373EC2A9FEBEC00807602 /* ops-pipe.c */, + B45373EA2A9FEBDB00807602 /* ops-listen.c */, + B45373E82A9FEBC100807602 /* server.c */, + B45373E22A9FEBA400807602 /* date.c */, + B45373E32A9FEBA400807602 /* header.c */, + B45373E42A9FEBA400807602 /* parsers.c */, + B45373E02A9FEB7F00807602 /* ops-h1.c */, + B45373DE2A9FEB6F00807602 /* system.c */, + B45373DB2A9FEB5300807602 /* base64-decode.c */, + B45373DA2A9FEB5300807602 /* sha-1.c */, + B45373D82A9FEB3800807602 /* poll.c */, + B45373CA2A9FEB0C00807602 /* alloc.c */, + B45373CB2A9FEB0C00807602 /* buflist.c */, + B45373CD2A9FEB0C00807602 /* context.c */, + B45373CC2A9FEB0C00807602 /* libwebsockets.c */, + B45373CE2A9FEB0C00807602 /* logs.c */, + B45373D02A9FEB0C00807602 /* lws_dll2.c */, + B45373B42A9FEA9000807602 /* adopt.c */, + B45373B62A9FEA9000807602 /* close.c */, + B45373B92A9FEA9000807602 /* dummy-callback.c */, + B45373B32A9FEA9000807602 /* network.c */, + B45373B52A9FEA9000807602 /* output.c */, + B45373BC2A9FEA9100807602 /* pollfd.c */, + B45373B22A9FEA9000807602 /* service.c */, + B45373BB2A9FEA9100807602 /* sorted-usec-list.c */, + B45373B72A9FEA9000807602 /* vhost.c */, + B45373BA2A9FEA9000807602 /* wsi-timeout.c */, + B45373B82A9FEA9000807602 /* wsi.c */, + ); + name = libwebsockets; + path = ../../third_party/libwebsockets; + sourceTree = ""; + }; + B4551B352A9FE53800331CD1 /* websocket-server */ = { + isa = PBXGroup; + children = ( + B45373A92A9FE73400807602 /* WebSocketServer.cpp */, + ); + name = "websocket-server"; + path = "../common/websocket-server"; + sourceTree = ""; + }; + B4E262182AA0CFFE00DBA5BC /* delay */ = { + isa = PBXGroup; + children = ( + B4E2621C2AA0D02A00DBA5BC /* WaitForCommissioneeCommand.mm */, + B4E262192AA0D01D00DBA5BC /* SleepCommand.mm */, + ); + path = delay; + sourceTree = ""; + }; BA09EB3E2474762900605257 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -1216,6 +1371,7 @@ 037C3DBD2991BD5000B7EEE2 /* OTAProviderDelegate.h in Headers */, 037C3DB02991BD4F00B7EEE2 /* Commands.h in Headers */, 037C3DC02991BD5100B7EEE2 /* Commands.h in Headers */, + B4E262172AA0CF2000DBA5BC /* RemoteDataModelLogger.h in Headers */, 037C3DCB2991BD5100B7EEE2 /* CHIPCommandStorageDelegate.h in Headers */, 037C3DD32991BD5200B7EEE2 /* logging.h in Headers */, 037C3DB72991BD5000B7EEE2 /* ModelCommandBridge.h in Headers */, @@ -1468,22 +1624,53 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + B45373C32A9FEA9100807602 /* wsi.c in Sources */, + B45373D42A9FEB0C00807602 /* context.c in Sources */, + B45373D32A9FEB0C00807602 /* libwebsockets.c in Sources */, + B45373C12A9FEA9100807602 /* close.c in Sources */, 039546A62991E151006D42A8 /* InteractionModel.cpp in Sources */, + B45373E72A9FEBA400807602 /* parsers.c in Sources */, + B45373BF2A9FEA9100807602 /* adopt.c in Sources */, + B45373F32A9FEC1A00807602 /* server-ws.c in Sources */, 03F430AA2994113500166449 /* sysunix.c in Sources */, + B45373C42A9FEA9100807602 /* dummy-callback.c in Sources */, 039145E82993179300257B3E /* GetCommissionerNodeIdCommand.mm in Sources */, 0395469F2991DFC5006D42A8 /* json_reader.cpp in Sources */, + B45373D22A9FEB0C00807602 /* buflist.c in Sources */, + B45373D72A9FEB0C00807602 /* lws_dll2.c in Sources */, + B45373FE2A9FEC4F00807602 /* unix-fds.c in Sources */, + B45373C72A9FEA9100807602 /* pollfd.c in Sources */, + B45373BE2A9FEA9100807602 /* network.c in Sources */, + B45373BD2A9FEA9100807602 /* service.c in Sources */, 0395469E2991DFC5006D42A8 /* json_writer.cpp in Sources */, 03FB93E02A46200A0048CB35 /* DiscoverCommissionablesCommand.mm in Sources */, + B45373EF2A9FEBFE00807602 /* ops-raw-skt.c in Sources */, 037C3DD52991C2E200B7EEE2 /* CHIPCommandBridge.mm in Sources */, 039546BC2991E1CB006D42A8 /* LogCommands.cpp in Sources */, 039547042992D9BF006D42A8 /* ota-provider.cpp in Sources */, 039547022992D952006D42A8 /* privilege-storage.cpp in Sources */, + B45373E12A9FEB7F00807602 /* ops-h1.c in Sources */, + B45373EB2A9FEBDB00807602 /* ops-listen.c in Sources */, 0382FA2C2992F06C00247BBB /* Commands.cpp in Sources */, + B45373FD2A9FEC4F00807602 /* unix-pipe.c in Sources */, + B45373C52A9FEA9100807602 /* wsi-timeout.c in Sources */, + B4E2621E2AA0D02D00DBA5BC /* WaitForCommissioneeCommand.mm in Sources */, 03F430A7299410C000166449 /* ExamplePersistentStorage.cpp in Sources */, + B45373AA2A9FE73400807602 /* WebSocketServer.cpp in Sources */, + B45373E62A9FEBA400807602 /* header.c in Sources */, + B45374002A9FEC4F00807602 /* unix-init.c in Sources */, + B45373DF2A9FEB6F00807602 /* system.c in Sources */, 039547032992D991006D42A8 /* MTRIMDispatch.mm in Sources */, 039546BD2991E1CB006D42A8 /* SystemCommands.cpp in Sources */, + B45373FC2A9FEC4F00807602 /* unix-caps.c in Sources */, + B4E262162AA0CF1C00DBA5BC /* RemoteDataModelLogger.mm in Sources */, + B45373ED2A9FEBEC00807602 /* ops-pipe.c in Sources */, + B45373C02A9FEA9100807602 /* output.c in Sources */, 0395470F2992DB37006D42A8 /* complete.c in Sources */, 039546BE2991E1CB006D42A8 /* DelayCommands.cpp in Sources */, + B4E2621B2AA0D02000DBA5BC /* SleepCommand.mm in Sources */, + B45373FF2A9FEC4F00807602 /* unix-misc.c in Sources */, + B45373D92A9FEB3800807602 /* poll.c in Sources */, 037C3DC12991BD5100B7EEE2 /* SetupPayloadParseCommand.mm in Sources */, 037C3DBF2991BD5100B7EEE2 /* OTAProviderDelegate.mm in Sources */, 037C3DD02991BD5200B7EEE2 /* InteractiveCommands.mm in Sources */, @@ -1493,17 +1680,28 @@ 039546A12991DFC5006D42A8 /* json_value.cpp in Sources */, 0382FA322992FDCE00247BBB /* MTRFramework.mm in Sources */, 0382FA302992F40C00247BBB /* ComplexArgumentParser.cpp in Sources */, + B45373DD2A9FEB5300807602 /* base64-decode.c in Sources */, 039145E12993102B00257B3E /* main.mm in Sources */, 037C3DD42991BD5200B7EEE2 /* logging.mm in Sources */, + B45374012A9FEC4F00807602 /* unix-sockets.c in Sources */, 03F430A82994112B00166449 /* editline.c in Sources */, + B45373E92A9FEBC100807602 /* server.c in Sources */, 037C3DB32991BD5000B7EEE2 /* OpenCommissioningWindowCommand.mm in Sources */, 037C3DAE2991BD4F00B7EEE2 /* PairingCommandBridge.mm in Sources */, + B45373FB2A9FEC4F00807602 /* unix-service.c in Sources */, + B45373F22A9FEC1A00807602 /* ops-ws.c in Sources */, 037C3DCA2991BD5100B7EEE2 /* CHIPCommandStorageDelegate.mm in Sources */, 037C3DCF2991BD5200B7EEE2 /* MTRError.mm in Sources */, 037C3DC72991BD5100B7EEE2 /* CHIPToolKeypair.mm in Sources */, + B45373E52A9FEBA400807602 /* date.c in Sources */, + B45373DC2A9FEB5300807602 /* sha-1.c in Sources */, + B45373D12A9FEB0C00807602 /* alloc.c in Sources */, + B45373C62A9FEA9100807602 /* sorted-usec-list.c in Sources */, 037C3DB62991BD5000B7EEE2 /* ModelCommandBridge.mm in Sources */, + B45373C22A9FEA9100807602 /* vhost.c in Sources */, 037C3DB42991BD5000B7EEE2 /* DeviceControllerDelegateBridge.mm in Sources */, 039547012992D461006D42A8 /* generic-callback-stubs.cpp in Sources */, + B45373D52A9FEB0C00807602 /* logs.c in Sources */, 0382FA312992FD6E00247BBB /* MTRLogging.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1659,8 +1857,22 @@ "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/gen/include", "$(CHIP_ROOT)/third_party/inipp/repo/inipp", "$(CHIP_ROOT)/third_party/editline/include", + "$(CHIP_ROOT)/third_party/libwebsockets/", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/include", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/core", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/core-net", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/plat/unix", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/secure-streams", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/event-libs", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/system/metrics", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/http", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/h1", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/ws", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/system/async-dns", "$(CHIP_ROOT)/examples/chip-tool", "$(CHIP_ROOT)/examples/chip-tool/commands/clusters", + "$(CHIP_ROOT)/examples/common", "$(CHIP_ROOT)/zzz_generated/chip-tool", ); LD_RUNPATH_SEARCH_PATHS = ( @@ -1671,6 +1883,8 @@ "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/lib", "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/obj/src/app/lib", ); + OTHER_CFLAGS = "-DLWS_PLAT_UNIX"; + OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; @@ -1709,6 +1923,19 @@ "$(CHIP_ROOT)/third_party/jsoncpp/repo/include", "$(CHIP_ROOT)/config/ios", "$(CHIP_ROOT)/third_party/editline/repo/include", + "$(CHIP_ROOT)/third_party/libwebsockets", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/include", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/core", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/core-net", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/plat/unix", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/secure-streams", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/event-libs", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/system/metrics", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/http", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/h1", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/roles/ws", + "$(CHIP_ROOT)/third_party/libwebsockets/repo/lib/system/async-dns", "$(CHIP_ROOT)/src/include", "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/gen/include", "$(SRCROOT)/darwin-framework-tool", @@ -1716,6 +1943,7 @@ "$(CHIP_ROOT)/third_party/editline/include", "$(CHIP_ROOT)/examples/chip-tool/commands/clusters", "$(CHIP_ROOT)/examples/chip-tool", + "$(CHIP_ROOT)/examples/common", "$(CHIP_ROOT)/zzz_generated/chip-tool", ); LD_RUNPATH_SEARCH_PATHS = ( @@ -1726,6 +1954,8 @@ "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/lib", "$(CONFIGURATION_TEMP_DIR)/Matter.build/out/obj/src/app/lib", ); + OTHER_CFLAGS = "-DLWS_PLAT_UNIX"; + OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 83b5c849f16e53..ecdb4adc9b032f 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -191,6 +191,7 @@ class IdentifyIdentify : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -235,17 +236,19 @@ class IdentifyTriggerEffect : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster triggerEffectWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + triggerEffectWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -278,8 +281,11 @@ class ReadIdentifyIdentifyTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeIdentifyTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.IdentifyTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify IdentifyTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -319,6 +325,8 @@ class WriteIdentifyIdentifyTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Identify IdentifyTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -363,6 +371,11 @@ class SubscribeAttributeIdentifyIdentifyTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.IdentifyTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -394,8 +407,11 @@ class ReadIdentifyIdentifyType : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeIdentifyTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.IdentifyType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify IdentifyType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -437,6 +453,11 @@ class SubscribeAttributeIdentifyIdentifyType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.IdentifyType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -468,8 +489,11 @@ class ReadIdentifyGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -511,6 +535,11 @@ class SubscribeAttributeIdentifyGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -542,8 +571,11 @@ class ReadIdentifyAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -585,6 +617,11 @@ class SubscribeAttributeIdentifyAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -618,8 +655,11 @@ class ReadIdentifyEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -661,6 +701,11 @@ class SubscribeAttributeIdentifyEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -694,8 +739,11 @@ class ReadIdentifyAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -737,6 +785,11 @@ class SubscribeAttributeIdentifyAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -768,8 +821,11 @@ class ReadIdentifyFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -811,6 +867,11 @@ class SubscribeAttributeIdentifyFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -842,8 +903,11 @@ class ReadIdentifyClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterIdentify alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Identify ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -885,6 +949,11 @@ class SubscribeAttributeIdentifyClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Identify.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -948,18 +1017,25 @@ class GroupsAddGroup : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster addGroupWithParams:params - completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + addGroupWithParams:params + completion:^(MTRGroupsClusterAddGroupResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::Groups::Commands::AddGroupResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::Groups::Commands::AddGroupResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -997,18 +1073,27 @@ class GroupsViewGroup : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster viewGroupWithParams:params - completion:^(MTRGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + viewGroupWithParams:params + completion:^(MTRGroupsClusterViewGroupResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::ViewGroupResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::ViewGroupResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -1059,10 +1144,20 @@ class GroupsGetGroupMembership : public ClusterCommand { completion:^(MTRGroupsClusterGetGroupMembershipResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::GetGroupMembershipResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1110,10 +1205,18 @@ class GroupsRemoveGroup : public ClusterCommand { removeGroupWithParams:params completion:^(MTRGroupsClusterRemoveGroupResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::RemoveGroupResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Groups::Commands::RemoveGroupResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1160,6 +1263,8 @@ class GroupsRemoveAllGroups : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1211,6 +1316,8 @@ class GroupsAddGroupIfIdentifying : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1248,8 +1355,11 @@ class ReadGroupsNameSupport : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNameSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.NameSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups NameSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1291,6 +1401,11 @@ class SubscribeAttributeGroupsNameSupport : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.NameSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1322,8 +1437,11 @@ class ReadGroupsGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1365,6 +1483,11 @@ class SubscribeAttributeGroupsGeneratedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1396,8 +1519,11 @@ class ReadGroupsAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1439,6 +1565,11 @@ class SubscribeAttributeGroupsAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1472,8 +1603,11 @@ class ReadGroupsEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1515,6 +1649,11 @@ class SubscribeAttributeGroupsEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1548,8 +1687,11 @@ class ReadGroupsAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1591,6 +1733,11 @@ class SubscribeAttributeGroupsAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1622,8 +1769,11 @@ class ReadGroupsFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1665,6 +1815,11 @@ class SubscribeAttributeGroupsFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1696,8 +1851,11 @@ class ReadGroupsClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterGroups alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Groups ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -1739,6 +1897,11 @@ class SubscribeAttributeGroupsClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Groups.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -1840,18 +2003,25 @@ class ScenesAddScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster addSceneWithParams:params - completion:^(MTRScenesClusterAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + addSceneWithParams:params + completion:^(MTRScenesClusterAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::Scenes::Commands::AddSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::Scenes::Commands::AddSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -1893,18 +2063,27 @@ class ScenesViewScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster viewSceneWithParams:params - completion:^(MTRScenesClusterViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + viewSceneWithParams:params + completion:^(MTRScenesClusterViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::ViewSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::ViewSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -1948,10 +2127,18 @@ class ScenesRemoveScene : public ClusterCommand { removeSceneWithParams:params completion:^(MTRScenesClusterRemoveSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::RemoveSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -1994,19 +2181,29 @@ class ScenesRemoveAllScenes : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster removeAllScenesWithParams:params - completion:^(MTRScenesClusterRemoveAllScenesResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + removeAllScenesWithParams:params + completion:^( + MTRScenesClusterRemoveAllScenesResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::RemoveAllScenesResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -2050,10 +2247,18 @@ class ScenesStoreScene : public ClusterCommand { storeSceneWithParams:params completion:^(MTRScenesClusterStoreSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::StoreSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::StoreSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -2108,17 +2313,19 @@ class ScenesRecallScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster recallSceneWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + recallSceneWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -2160,10 +2367,20 @@ class ScenesGetSceneMembership : public ClusterCommand { completion:^(MTRScenesClusterGetSceneMembershipResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::GetSceneMembershipResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -2237,19 +2454,29 @@ class ScenesEnhancedAddScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster enhancedAddSceneWithParams:params - completion:^(MTRScenesClusterEnhancedAddSceneResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + enhancedAddSceneWithParams:params + completion:^( + MTRScenesClusterEnhancedAddSceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::EnhancedAddSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -2295,10 +2522,20 @@ class ScenesEnhancedViewScene : public ClusterCommand { completion:^(MTRScenesClusterEnhancedViewSceneResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::EnhancedViewSceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -2349,18 +2586,27 @@ class ScenesCopyScene : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster copySceneWithParams:params - completion:^(MTRScenesClusterCopySceneResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + copySceneWithParams:params + completion:^(MTRScenesClusterCopySceneResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::CopySceneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Scenes::Commands::CopySceneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -2393,8 +2639,11 @@ class ReadScenesSceneCount : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSceneCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes SceneCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2436,6 +2685,11 @@ class SubscribeAttributeScenesSceneCount : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2467,8 +2721,11 @@ class ReadScenesCurrentScene : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCurrentSceneWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.CurrentScene response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes CurrentScene read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2510,6 +2767,11 @@ class SubscribeAttributeScenesCurrentScene : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.CurrentScene response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2541,8 +2803,11 @@ class ReadScenesCurrentGroup : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCurrentGroupWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.CurrentGroup response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes CurrentGroup read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2584,6 +2849,11 @@ class SubscribeAttributeScenesCurrentGroup : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.CurrentGroup response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2615,8 +2885,11 @@ class ReadScenesSceneValid : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSceneValidWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneValid response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes SceneValid read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2658,6 +2931,11 @@ class SubscribeAttributeScenesSceneValid : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneValid response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2689,8 +2967,11 @@ class ReadScenesNameSupport : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNameSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.NameSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes NameSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2732,6 +3013,11 @@ class SubscribeAttributeScenesNameSupport : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.NameSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2763,8 +3049,11 @@ class ReadScenesLastConfiguredBy : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLastConfiguredByWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.LastConfiguredBy response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes LastConfiguredBy read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2806,6 +3095,11 @@ class SubscribeAttributeScenesLastConfiguredBy : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.LastConfiguredBy response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2839,8 +3133,11 @@ class ReadScenesSceneTableSize : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSceneTableSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneTableSize response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes SceneTableSize read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2882,6 +3179,11 @@ class SubscribeAttributeScenesSceneTableSize : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.SceneTableSize response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2916,8 +3218,11 @@ class ReadScenesRemainingCapacity : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeRemainingCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.RemainingCapacity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes RemainingCapacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -2959,6 +3264,11 @@ class SubscribeAttributeScenesRemainingCapacity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.RemainingCapacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -2992,8 +3302,11 @@ class ReadScenesGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3035,6 +3348,11 @@ class SubscribeAttributeScenesGeneratedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3066,8 +3384,11 @@ class ReadScenesAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3109,6 +3430,11 @@ class SubscribeAttributeScenesAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3142,8 +3468,11 @@ class ReadScenesEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3185,6 +3514,11 @@ class SubscribeAttributeScenesEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3218,8 +3552,11 @@ class ReadScenesAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3261,6 +3598,11 @@ class SubscribeAttributeScenesAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3292,8 +3634,11 @@ class ReadScenesFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3335,6 +3680,11 @@ class SubscribeAttributeScenesFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3366,8 +3716,11 @@ class ReadScenesClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterScenes alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Scenes ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3409,6 +3762,11 @@ class SubscribeAttributeScenesClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Scenes.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3476,6 +3834,7 @@ class OnOffOff : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3521,6 +3880,7 @@ class OnOffOn : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3566,6 +3926,7 @@ class OnOffToggle : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3609,17 +3970,19 @@ class OnOffOffWithEffect : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster offWithEffectWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + offWithEffectWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -3661,6 +4024,8 @@ class OnOffOnWithRecallGlobalScene : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3712,6 +4077,8 @@ class OnOffOnWithTimedOff : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -3749,8 +4116,11 @@ class ReadOnOffOnOff : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OnOff response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff OnOff read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3792,6 +4162,11 @@ class SubscribeAttributeOnOffOnOff : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OnOff response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3823,8 +4198,11 @@ class ReadOnOffGlobalSceneControl : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGlobalSceneControlWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.GlobalSceneControl response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff GlobalSceneControl read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3866,6 +4244,11 @@ class SubscribeAttributeOnOffGlobalSceneControl : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.GlobalSceneControl response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -3897,8 +4280,11 @@ class ReadOnOffOnTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOnTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OnTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff OnTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3938,6 +4324,8 @@ class WriteOnOffOnTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OnOff OnTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -3982,6 +4370,11 @@ class SubscribeAttributeOnOffOnTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OnTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4013,8 +4406,11 @@ class ReadOnOffOffWaitTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOffWaitTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OffWaitTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff OffWaitTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4054,6 +4450,8 @@ class WriteOnOffOffWaitTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OnOff OffWaitTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4098,6 +4496,11 @@ class SubscribeAttributeOnOffOffWaitTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.OffWaitTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4129,8 +4532,11 @@ class ReadOnOffStartUpOnOff : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeStartUpOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.StartUpOnOff response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff StartUpOnOff read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4163,13 +4569,18 @@ class WriteOnOffStartUpOnOff : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpOnOffWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OnOff StartUpOnOff write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4177,7 +4588,7 @@ class WriteOnOffStartUpOnOff : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeOnOffStartUpOnOff : public SubscribeAttribute { @@ -4214,6 +4625,11 @@ class SubscribeAttributeOnOffStartUpOnOff : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.StartUpOnOff response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4245,8 +4661,11 @@ class ReadOnOffGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4288,6 +4707,11 @@ class SubscribeAttributeOnOffGeneratedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4319,8 +4743,11 @@ class ReadOnOffAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4362,6 +4789,11 @@ class SubscribeAttributeOnOffAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4395,8 +4827,11 @@ class ReadOnOffEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4438,6 +4873,11 @@ class SubscribeAttributeOnOffEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4471,8 +4911,11 @@ class ReadOnOffAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4514,6 +4957,11 @@ class SubscribeAttributeOnOffAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4545,8 +4993,11 @@ class ReadOnOffFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4588,6 +5039,11 @@ class SubscribeAttributeOnOffFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4619,8 +5075,11 @@ class ReadOnOffClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOff ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4662,6 +5121,11 @@ class SubscribeAttributeOnOffClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOff.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4713,8 +5177,11 @@ class ReadOnOffSwitchConfigurationSwitchType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSwitchTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.SwitchType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration SwitchType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4758,6 +5225,11 @@ class SubscribeAttributeOnOffSwitchConfigurationSwitchType : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.SwitchType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4791,8 +5263,11 @@ class ReadOnOffSwitchConfigurationSwitchActions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSwitchActionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.SwitchActions response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration SwitchActions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4834,6 +5309,8 @@ class WriteOnOffSwitchConfigurationSwitchActions : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OnOffSwitchConfiguration SwitchActions write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4880,6 +5357,11 @@ class SubscribeAttributeOnOffSwitchConfigurationSwitchActions : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.SwitchActions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4914,8 +5396,11 @@ class ReadOnOffSwitchConfigurationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -4959,6 +5444,11 @@ class SubscribeAttributeOnOffSwitchConfigurationGeneratedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -4993,8 +5483,11 @@ class ReadOnOffSwitchConfigurationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5038,6 +5531,11 @@ class SubscribeAttributeOnOffSwitchConfigurationAcceptedCommandList : public Sub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5073,8 +5571,11 @@ class ReadOnOffSwitchConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5118,6 +5619,11 @@ class SubscribeAttributeOnOffSwitchConfigurationEventList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5153,8 +5659,11 @@ class ReadOnOffSwitchConfigurationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5198,6 +5707,11 @@ class SubscribeAttributeOnOffSwitchConfigurationAttributeList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5231,8 +5745,11 @@ class ReadOnOffSwitchConfigurationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5276,6 +5793,11 @@ class SubscribeAttributeOnOffSwitchConfigurationFeatureMap : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5309,8 +5831,11 @@ class ReadOnOffSwitchConfigurationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OnOffSwitchConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5354,6 +5879,11 @@ class SubscribeAttributeOnOffSwitchConfigurationClusterRevision : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OnOffSwitchConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -5441,17 +5971,19 @@ class LevelControlMoveToLevel : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToLevelWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveToLevelWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -5507,6 +6039,7 @@ class LevelControlMove : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5569,6 +6102,7 @@ class LevelControlStep : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5621,6 +6155,7 @@ class LevelControlStop : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5681,6 +6216,8 @@ class LevelControlMoveToLevelWithOnOff : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5735,17 +6272,19 @@ class LevelControlMoveWithOnOff : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveWithOnOffWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveWithOnOffWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -5797,17 +6336,19 @@ class LevelControlStepWithOnOff : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stepWithOnOffWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stepWithOnOffWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -5849,17 +6390,19 @@ class LevelControlStopWithOnOff : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopWithOnOffWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stopWithOnOffWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -5905,6 +6448,8 @@ class LevelControlMoveToClosestFrequency : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -5944,8 +6489,11 @@ class ReadLevelControlCurrentLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.CurrentLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl CurrentLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -5989,6 +6537,11 @@ class SubscribeAttributeLevelControlCurrentLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.CurrentLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6022,8 +6575,11 @@ class ReadLevelControlRemainingTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRemainingTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.RemainingTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl RemainingTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6067,6 +6623,11 @@ class SubscribeAttributeLevelControlRemainingTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.RemainingTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6100,8 +6661,11 @@ class ReadLevelControlMinLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MinLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl MinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6145,6 +6709,11 @@ class SubscribeAttributeLevelControlMinLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6178,8 +6747,11 @@ class ReadLevelControlMaxLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MaxLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl MaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6223,6 +6795,11 @@ class SubscribeAttributeLevelControlMaxLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6256,8 +6833,11 @@ class ReadLevelControlCurrentFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.CurrentFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl CurrentFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6301,6 +6881,11 @@ class SubscribeAttributeLevelControlCurrentFrequency : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.CurrentFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6334,8 +6919,11 @@ class ReadLevelControlMinFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MinFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl MinFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6379,6 +6967,11 @@ class SubscribeAttributeLevelControlMinFrequency : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MinFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6412,8 +7005,11 @@ class ReadLevelControlMaxFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MaxFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl MaxFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6457,6 +7053,11 @@ class SubscribeAttributeLevelControlMaxFrequency : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.MaxFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6490,8 +7091,11 @@ class ReadLevelControlOptions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.Options response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl Options read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6533,6 +7137,8 @@ class WriteLevelControlOptions : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl Options write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6579,6 +7185,11 @@ class SubscribeAttributeLevelControlOptions : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.Options response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6612,8 +7223,11 @@ class ReadLevelControlOnOffTransitionTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnOffTransitionTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl OnOffTransitionTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6655,6 +7269,8 @@ class WriteLevelControlOnOffTransitionTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl OnOffTransitionTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6701,6 +7317,11 @@ class SubscribeAttributeLevelControlOnOffTransitionTime : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnOffTransitionTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6734,8 +7355,11 @@ class ReadLevelControlOnLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl OnLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6770,13 +7394,18 @@ class WriteLevelControlOnLevel : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnLevelWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl OnLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6784,7 +7413,7 @@ class WriteLevelControlOnLevel : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlOnLevel : public SubscribeAttribute { @@ -6823,6 +7452,11 @@ class SubscribeAttributeLevelControlOnLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6856,8 +7490,11 @@ class ReadLevelControlOnTransitionTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnTransitionTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl OnTransitionTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6892,13 +7529,18 @@ class WriteLevelControlOnTransitionTime : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeOnTransitionTimeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl OnTransitionTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -6906,7 +7548,7 @@ class WriteLevelControlOnTransitionTime : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlOnTransitionTime : public SubscribeAttribute { @@ -6945,6 +7587,11 @@ class SubscribeAttributeLevelControlOnTransitionTime : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OnTransitionTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -6978,8 +7625,11 @@ class ReadLevelControlOffTransitionTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOffTransitionTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OffTransitionTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl OffTransitionTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7014,13 +7664,18 @@ class WriteLevelControlOffTransitionTime : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeOffTransitionTimeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl OffTransitionTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7028,7 +7683,7 @@ class WriteLevelControlOffTransitionTime : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlOffTransitionTime : public SubscribeAttribute { @@ -7067,6 +7722,11 @@ class SubscribeAttributeLevelControlOffTransitionTime : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.OffTransitionTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7100,8 +7760,11 @@ class ReadLevelControlDefaultMoveRate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDefaultMoveRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.DefaultMoveRate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl DefaultMoveRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7136,13 +7799,18 @@ class WriteLevelControlDefaultMoveRate : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeDefaultMoveRateWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl DefaultMoveRate write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7150,7 +7818,7 @@ class WriteLevelControlDefaultMoveRate : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlDefaultMoveRate : public SubscribeAttribute { @@ -7189,6 +7857,11 @@ class SubscribeAttributeLevelControlDefaultMoveRate : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.DefaultMoveRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7222,8 +7895,11 @@ class ReadLevelControlStartUpCurrentLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpCurrentLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.StartUpCurrentLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl StartUpCurrentLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7258,13 +7934,18 @@ class WriteLevelControlStartUpCurrentLevel : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpCurrentLevelWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LevelControl StartUpCurrentLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7272,7 +7953,7 @@ class WriteLevelControlStartUpCurrentLevel : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLevelControlStartUpCurrentLevel : public SubscribeAttribute { @@ -7311,6 +7992,11 @@ class SubscribeAttributeLevelControlStartUpCurrentLevel : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.StartUpCurrentLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7344,8 +8030,11 @@ class ReadLevelControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7389,6 +8078,11 @@ class SubscribeAttributeLevelControlGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7422,8 +8116,11 @@ class ReadLevelControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7467,6 +8164,11 @@ class SubscribeAttributeLevelControlAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7502,8 +8204,11 @@ class ReadLevelControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7547,6 +8252,11 @@ class SubscribeAttributeLevelControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7582,8 +8292,11 @@ class ReadLevelControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7627,6 +8340,11 @@ class SubscribeAttributeLevelControlAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7660,8 +8378,11 @@ class ReadLevelControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7705,6 +8426,11 @@ class SubscribeAttributeLevelControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7738,8 +8464,11 @@ class ReadLevelControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LevelControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7783,6 +8512,11 @@ class SubscribeAttributeLevelControlClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LevelControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7841,8 +8575,11 @@ class ReadBinaryInputBasicActiveText : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveTextWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ActiveText response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic ActiveText read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7886,6 +8623,8 @@ class WriteBinaryInputBasicActiveText : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic ActiveText write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -7932,6 +8671,11 @@ class SubscribeAttributeBinaryInputBasicActiveText : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ActiveText response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -7965,8 +8709,11 @@ class ReadBinaryInputBasicDescription : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDescriptionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Description response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic Description read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8010,6 +8757,8 @@ class WriteBinaryInputBasicDescription : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic Description write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8056,6 +8805,11 @@ class SubscribeAttributeBinaryInputBasicDescription : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Description response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8089,8 +8843,11 @@ class ReadBinaryInputBasicInactiveText : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInactiveTextWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.InactiveText response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic InactiveText read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8134,6 +8891,8 @@ class WriteBinaryInputBasicInactiveText : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic InactiveText write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8180,6 +8939,11 @@ class SubscribeAttributeBinaryInputBasicInactiveText : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.InactiveText response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8213,8 +8977,11 @@ class ReadBinaryInputBasicOutOfService : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOutOfServiceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.OutOfService response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic OutOfService read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8256,6 +9023,8 @@ class WriteBinaryInputBasicOutOfService : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic OutOfService write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8302,6 +9071,11 @@ class SubscribeAttributeBinaryInputBasicOutOfService : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.OutOfService response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8335,8 +9109,11 @@ class ReadBinaryInputBasicPolarity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePolarityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Polarity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic Polarity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8380,6 +9157,11 @@ class SubscribeAttributeBinaryInputBasicPolarity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Polarity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8413,8 +9195,11 @@ class ReadBinaryInputBasicPresentValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePresentValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.PresentValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic PresentValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8456,6 +9241,8 @@ class WriteBinaryInputBasicPresentValue : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic PresentValue write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8502,6 +9289,11 @@ class SubscribeAttributeBinaryInputBasicPresentValue : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.PresentValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8535,8 +9327,11 @@ class ReadBinaryInputBasicReliability : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReliabilityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Reliability response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic Reliability read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8578,6 +9373,8 @@ class WriteBinaryInputBasicReliability : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BinaryInputBasic Reliability write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8624,6 +9421,11 @@ class SubscribeAttributeBinaryInputBasicReliability : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.Reliability response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8657,8 +9459,11 @@ class ReadBinaryInputBasicStatusFlags : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStatusFlagsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.StatusFlags response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic StatusFlags read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8702,6 +9507,11 @@ class SubscribeAttributeBinaryInputBasicStatusFlags : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.StatusFlags response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8735,8 +9545,11 @@ class ReadBinaryInputBasicApplicationType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApplicationTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ApplicationType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic ApplicationType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8780,6 +9593,11 @@ class SubscribeAttributeBinaryInputBasicApplicationType : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ApplicationType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8813,8 +9631,11 @@ class ReadBinaryInputBasicGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8858,6 +9679,11 @@ class SubscribeAttributeBinaryInputBasicGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8891,8 +9717,11 @@ class ReadBinaryInputBasicAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -8936,6 +9765,11 @@ class SubscribeAttributeBinaryInputBasicAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -8971,8 +9805,11 @@ class ReadBinaryInputBasicEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9016,6 +9853,11 @@ class SubscribeAttributeBinaryInputBasicEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9051,8 +9893,11 @@ class ReadBinaryInputBasicAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9096,6 +9941,11 @@ class SubscribeAttributeBinaryInputBasicAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9129,8 +9979,11 @@ class ReadBinaryInputBasicFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9174,6 +10027,11 @@ class SubscribeAttributeBinaryInputBasicFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9207,8 +10065,11 @@ class ReadBinaryInputBasicClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BinaryInputBasic ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9252,6 +10113,11 @@ class SubscribeAttributeBinaryInputBasicClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BinaryInputBasic.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9304,8 +10170,11 @@ class ReadPulseWidthModulationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9349,6 +10218,11 @@ class SubscribeAttributePulseWidthModulationGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9385,8 +10259,11 @@ class ReadPulseWidthModulationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9430,6 +10307,11 @@ class SubscribeAttributePulseWidthModulationAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9466,8 +10348,11 @@ class ReadPulseWidthModulationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9511,6 +10396,11 @@ class SubscribeAttributePulseWidthModulationEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9547,8 +10437,11 @@ class ReadPulseWidthModulationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9592,6 +10485,11 @@ class SubscribeAttributePulseWidthModulationAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9628,8 +10526,11 @@ class ReadPulseWidthModulationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9673,6 +10574,11 @@ class SubscribeAttributePulseWidthModulationFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9709,8 +10615,11 @@ class ReadPulseWidthModulationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PulseWidthModulation ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9754,6 +10663,11 @@ class SubscribeAttributePulseWidthModulationClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PulseWidthModulation.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9810,8 +10724,11 @@ class ReadDescriptorDeviceTypeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDeviceTypeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.DeviceTypeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor DeviceTypeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9855,6 +10772,11 @@ class SubscribeAttributeDescriptorDeviceTypeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.DeviceTypeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9888,8 +10810,11 @@ class ReadDescriptorServerList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeServerListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ServerList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor ServerList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -9933,6 +10858,11 @@ class SubscribeAttributeDescriptorServerList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ServerList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -9966,8 +10896,11 @@ class ReadDescriptorClientList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClientListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ClientList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor ClientList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10011,6 +10944,11 @@ class SubscribeAttributeDescriptorClientList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ClientList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10044,8 +10982,11 @@ class ReadDescriptorPartsList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePartsListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.PartsList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor PartsList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10089,6 +11030,11 @@ class SubscribeAttributeDescriptorPartsList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.PartsList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10124,8 +11070,11 @@ class ReadDescriptorTagList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTagListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.TagList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor TagList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10169,6 +11118,11 @@ class SubscribeAttributeDescriptorTagList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.TagList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10204,8 +11158,11 @@ class ReadDescriptorGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10249,6 +11206,11 @@ class SubscribeAttributeDescriptorGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10282,8 +11244,11 @@ class ReadDescriptorAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10327,6 +11292,11 @@ class SubscribeAttributeDescriptorAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10362,8 +11332,11 @@ class ReadDescriptorEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10407,6 +11380,11 @@ class SubscribeAttributeDescriptorEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10442,8 +11420,11 @@ class ReadDescriptorAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10487,6 +11468,11 @@ class SubscribeAttributeDescriptorAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10520,8 +11506,11 @@ class ReadDescriptorFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10565,6 +11554,11 @@ class SubscribeAttributeDescriptorFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10598,8 +11592,11 @@ class ReadDescriptorClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Descriptor ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10643,6 +11640,11 @@ class SubscribeAttributeDescriptorClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Descriptor.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10696,8 +11698,13 @@ class ReadBindingBinding : public ReadAttribute { [cluster readAttributeBindingWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.Binding response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding Binding read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10768,6 +11775,8 @@ class WriteBindingBinding : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Binding Binding write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10813,6 +11822,11 @@ class SubscribeAttributeBindingBinding : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.Binding response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10844,8 +11858,11 @@ class ReadBindingGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10887,6 +11904,11 @@ class SubscribeAttributeBindingGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10918,8 +11940,11 @@ class ReadBindingAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -10961,6 +11986,11 @@ class SubscribeAttributeBindingAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -10994,8 +12024,11 @@ class ReadBindingEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11037,6 +12070,11 @@ class SubscribeAttributeBindingEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11070,8 +12108,11 @@ class ReadBindingAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11113,6 +12154,11 @@ class SubscribeAttributeBindingAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11144,8 +12190,11 @@ class ReadBindingFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11187,6 +12236,11 @@ class SubscribeAttributeBindingFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11218,8 +12272,11 @@ class ReadBindingClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterBinding alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Binding ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11261,6 +12318,11 @@ class SubscribeAttributeBindingClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Binding.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11319,14 +12381,19 @@ class ReadAccessControlAcl : public ReadAttribute { if (mFabricFiltered.HasValue()) { params.filterByFabric = mFabricFiltered.Value(); } - [cluster readAttributeACLWithParams:params - completion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"AccessControl.ACL response %@", [value description]); - if (error != nil) { - LogNSError("AccessControl ACL read Error", error); - } - SetCommandExitStatus(error); - }]; + [cluster + readAttributeACLWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"AccessControl.ACL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("AccessControl ACL read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; return CHIP_NO_ERROR; } }; @@ -11419,6 +12486,8 @@ class WriteAccessControlAcl : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("AccessControl ACL write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11468,6 +12537,11 @@ class SubscribeAttributeAccessControlAcl : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.ACL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11506,8 +12580,13 @@ class ReadAccessControlExtension : public ReadAttribute { [cluster readAttributeExtensionWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.Extension response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl Extension read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11561,6 +12640,8 @@ class WriteAccessControlExtension : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("AccessControl Extension write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11610,6 +12691,11 @@ class SubscribeAttributeAccessControlExtension : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.Extension response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11643,8 +12729,11 @@ class ReadAccessControlSubjectsPerAccessControlEntry : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSubjectsPerAccessControlEntryWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.SubjectsPerAccessControlEntry response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl SubjectsPerAccessControlEntry read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11688,6 +12777,11 @@ class SubscribeAttributeAccessControlSubjectsPerAccessControlEntry : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.SubjectsPerAccessControlEntry response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11721,8 +12815,11 @@ class ReadAccessControlTargetsPerAccessControlEntry : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTargetsPerAccessControlEntryWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.TargetsPerAccessControlEntry response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl TargetsPerAccessControlEntry read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11766,6 +12863,11 @@ class SubscribeAttributeAccessControlTargetsPerAccessControlEntry : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.TargetsPerAccessControlEntry response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11799,8 +12901,11 @@ class ReadAccessControlAccessControlEntriesPerFabric : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAccessControlEntriesPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AccessControlEntriesPerFabric response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl AccessControlEntriesPerFabric read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11844,6 +12949,11 @@ class SubscribeAttributeAccessControlAccessControlEntriesPerFabric : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AccessControlEntriesPerFabric response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11877,8 +12987,11 @@ class ReadAccessControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -11922,6 +13035,11 @@ class SubscribeAttributeAccessControlGeneratedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -11955,8 +13073,11 @@ class ReadAccessControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12000,6 +13121,11 @@ class SubscribeAttributeAccessControlAcceptedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12035,8 +13161,11 @@ class ReadAccessControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12080,6 +13209,11 @@ class SubscribeAttributeAccessControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12115,8 +13249,11 @@ class ReadAccessControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12160,6 +13297,11 @@ class SubscribeAttributeAccessControlAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12193,8 +13335,11 @@ class ReadAccessControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12238,6 +13383,11 @@ class SubscribeAttributeAccessControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12271,8 +13421,11 @@ class ReadAccessControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccessControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -12316,6 +13469,11 @@ class SubscribeAttributeAccessControlClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccessControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -12391,17 +13549,19 @@ class ActionsInstantAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster instantActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + instantActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12453,6 +13613,8 @@ class ActionsInstantActionWithTransition : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -12501,17 +13663,19 @@ class ActionsStartAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster startActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + startActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12563,6 +13727,8 @@ class ActionsStartActionWithDuration : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -12611,17 +13777,19 @@ class ActionsStopAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stopActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12665,17 +13833,19 @@ class ActionsPauseAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster pauseActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + pauseActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12727,6 +13897,8 @@ class ActionsPauseActionWithDuration : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -12775,17 +13947,19 @@ class ActionsResumeAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster resumeActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + resumeActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12829,17 +14003,19 @@ class ActionsEnableAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster enableActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + enableActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -12891,6 +14067,8 @@ class ActionsEnableActionWithDuration : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -12939,17 +14117,19 @@ class ActionsDisableAction : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster disableActionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + disableActionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -13001,6 +14181,8 @@ class ActionsDisableActionWithDuration : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -13038,8 +14220,11 @@ class ReadActionsActionList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeActionListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.ActionList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions ActionList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13081,6 +14266,11 @@ class SubscribeAttributeActionsActionList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.ActionList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13112,8 +14302,11 @@ class ReadActionsEndpointLists : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEndpointListsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.EndpointLists response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions EndpointLists read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13155,6 +14348,11 @@ class SubscribeAttributeActionsEndpointLists : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.EndpointLists response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13186,8 +14384,11 @@ class ReadActionsSetupURL : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSetupURLWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.SetupURL response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions SetupURL read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13229,6 +14430,11 @@ class SubscribeAttributeActionsSetupURL : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.SetupURL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13260,8 +14466,11 @@ class ReadActionsGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13303,6 +14512,11 @@ class SubscribeAttributeActionsGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13334,8 +14548,11 @@ class ReadActionsAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13377,6 +14594,11 @@ class SubscribeAttributeActionsAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13410,8 +14632,11 @@ class ReadActionsEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13453,6 +14678,11 @@ class SubscribeAttributeActionsEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13486,8 +14716,11 @@ class ReadActionsAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13529,6 +14762,11 @@ class SubscribeAttributeActionsAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13560,8 +14798,11 @@ class ReadActionsFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13603,6 +14844,11 @@ class SubscribeAttributeActionsFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13634,8 +14880,11 @@ class ReadActionsClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterActions alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Actions ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13677,6 +14926,11 @@ class SubscribeAttributeActionsClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Actions.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13752,8 +15006,11 @@ class ReadBasicInformationDataModelRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDataModelRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.DataModelRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation DataModelRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13797,6 +15054,11 @@ class SubscribeAttributeBasicInformationDataModelRevision : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.DataModelRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13830,8 +15092,11 @@ class ReadBasicInformationVendorName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.VendorName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation VendorName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13875,6 +15140,11 @@ class SubscribeAttributeBasicInformationVendorName : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.VendorName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13908,8 +15178,11 @@ class ReadBasicInformationVendorID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.VendorID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation VendorID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -13953,6 +15226,11 @@ class SubscribeAttributeBasicInformationVendorID : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.VendorID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -13986,8 +15264,11 @@ class ReadBasicInformationProductName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14031,6 +15312,11 @@ class SubscribeAttributeBasicInformationProductName : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14064,8 +15350,11 @@ class ReadBasicInformationProductID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14109,6 +15398,11 @@ class SubscribeAttributeBasicInformationProductID : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14142,8 +15436,11 @@ class ReadBasicInformationNodeLabel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNodeLabelWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.NodeLabel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation NodeLabel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14187,6 +15484,8 @@ class WriteBasicInformationNodeLabel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BasicInformation NodeLabel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14233,6 +15532,11 @@ class SubscribeAttributeBasicInformationNodeLabel : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.NodeLabel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14266,8 +15570,11 @@ class ReadBasicInformationLocation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocationWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.Location response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation Location read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14311,6 +15618,8 @@ class WriteBasicInformationLocation : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BasicInformation Location write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14357,6 +15666,11 @@ class SubscribeAttributeBasicInformationLocation : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.Location response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14390,8 +15704,11 @@ class ReadBasicInformationHardwareVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHardwareVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.HardwareVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation HardwareVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14435,6 +15752,11 @@ class SubscribeAttributeBasicInformationHardwareVersion : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.HardwareVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14468,8 +15790,11 @@ class ReadBasicInformationHardwareVersionString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHardwareVersionStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.HardwareVersionString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation HardwareVersionString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14513,6 +15838,11 @@ class SubscribeAttributeBasicInformationHardwareVersionString : public Subscribe } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.HardwareVersionString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14546,8 +15876,11 @@ class ReadBasicInformationSoftwareVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSoftwareVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SoftwareVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation SoftwareVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14591,6 +15924,11 @@ class SubscribeAttributeBasicInformationSoftwareVersion : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SoftwareVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14624,8 +15962,11 @@ class ReadBasicInformationSoftwareVersionString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSoftwareVersionStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SoftwareVersionString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation SoftwareVersionString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14669,6 +16010,11 @@ class SubscribeAttributeBasicInformationSoftwareVersionString : public Subscribe } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SoftwareVersionString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14702,8 +16048,11 @@ class ReadBasicInformationManufacturingDate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeManufacturingDateWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ManufacturingDate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ManufacturingDate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14747,6 +16096,11 @@ class SubscribeAttributeBasicInformationManufacturingDate : public SubscribeAttr } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ManufacturingDate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14780,8 +16134,11 @@ class ReadBasicInformationPartNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePartNumberWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.PartNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation PartNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14825,6 +16182,11 @@ class SubscribeAttributeBasicInformationPartNumber : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.PartNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14858,8 +16220,11 @@ class ReadBasicInformationProductURL : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductURLWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductURL response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductURL read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14903,6 +16268,11 @@ class SubscribeAttributeBasicInformationProductURL : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductURL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -14936,8 +16306,11 @@ class ReadBasicInformationProductLabel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductLabelWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductLabel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductLabel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -14981,6 +16354,11 @@ class SubscribeAttributeBasicInformationProductLabel : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductLabel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15014,8 +16392,11 @@ class ReadBasicInformationSerialNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSerialNumberWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SerialNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation SerialNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15059,6 +16440,11 @@ class SubscribeAttributeBasicInformationSerialNumber : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.SerialNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15092,8 +16478,11 @@ class ReadBasicInformationLocalConfigDisabled : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocalConfigDisabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.LocalConfigDisabled response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation LocalConfigDisabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15135,6 +16524,8 @@ class WriteBasicInformationLocalConfigDisabled : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BasicInformation LocalConfigDisabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15181,6 +16572,11 @@ class SubscribeAttributeBasicInformationLocalConfigDisabled : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.LocalConfigDisabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15214,8 +16610,11 @@ class ReadBasicInformationReachable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReachableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.Reachable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation Reachable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15259,6 +16658,11 @@ class SubscribeAttributeBasicInformationReachable : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.Reachable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15292,8 +16696,11 @@ class ReadBasicInformationUniqueID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUniqueIDWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.UniqueID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation UniqueID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15337,6 +16744,11 @@ class SubscribeAttributeBasicInformationUniqueID : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.UniqueID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15371,8 +16783,11 @@ class ReadBasicInformationCapabilityMinima : public ReadAttribute { [cluster readAttributeCapabilityMinimaWithCompletion:^( MTRBasicInformationClusterCapabilityMinimaStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.CapabilityMinima response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation CapabilityMinima read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15416,6 +16831,11 @@ class SubscribeAttributeBasicInformationCapabilityMinima : public SubscribeAttri } reportHandler:^(MTRBasicInformationClusterCapabilityMinimaStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.CapabilityMinima response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15450,8 +16870,11 @@ class ReadBasicInformationProductAppearance : public ReadAttribute { [cluster readAttributeProductAppearanceWithCompletion:^( MTRBasicInformationClusterProductAppearanceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductAppearance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ProductAppearance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15495,6 +16918,11 @@ class SubscribeAttributeBasicInformationProductAppearance : public SubscribeAttr } reportHandler:^(MTRBasicInformationClusterProductAppearanceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ProductAppearance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15528,8 +16956,11 @@ class ReadBasicInformationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15573,6 +17004,11 @@ class SubscribeAttributeBasicInformationGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15606,8 +17042,11 @@ class ReadBasicInformationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15651,6 +17090,11 @@ class SubscribeAttributeBasicInformationAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15686,8 +17130,11 @@ class ReadBasicInformationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15731,6 +17178,11 @@ class SubscribeAttributeBasicInformationEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15766,8 +17218,11 @@ class ReadBasicInformationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15811,6 +17266,11 @@ class SubscribeAttributeBasicInformationAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15844,8 +17304,11 @@ class ReadBasicInformationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15889,6 +17352,11 @@ class SubscribeAttributeBasicInformationFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -15922,8 +17390,11 @@ class ReadBasicInformationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BasicInformation ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -15967,6 +17438,11 @@ class SubscribeAttributeBasicInformationClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BasicInformation.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16066,19 +17542,28 @@ class OtaSoftwareUpdateProviderQueryImage : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster queryImageWithParams:params - completion:^(MTROTASoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + queryImageWithParams:params + completion:^(MTROTASoftwareUpdateProviderClusterQueryImageResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -16122,19 +17607,30 @@ class OtaSoftwareUpdateProviderApplyUpdateRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster applyUpdateRequestWithParams:params - completion:^(MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + applyUpdateRequestWithParams:params + completion:^(MTROTASoftwareUpdateProviderClusterApplyUpdateResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -16182,6 +17678,8 @@ class OtaSoftwareUpdateProviderNotifyUpdateApplied : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -16222,8 +17720,11 @@ class ReadOtaSoftwareUpdateProviderGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16268,6 +17769,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderGeneratedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16302,8 +17808,11 @@ class ReadOtaSoftwareUpdateProviderAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16347,6 +17856,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderAcceptedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16382,8 +17896,11 @@ class ReadOtaSoftwareUpdateProviderEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16427,6 +17944,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderEventList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16462,8 +17984,11 @@ class ReadOtaSoftwareUpdateProviderAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16507,6 +18032,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderAttributeList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16540,8 +18070,11 @@ class ReadOtaSoftwareUpdateProviderFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16585,6 +18118,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderFeatureMap : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16618,8 +18156,11 @@ class ReadOtaSoftwareUpdateProviderClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateProvider ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16663,6 +18204,11 @@ class SubscribeAttributeOtaSoftwareUpdateProviderClusterRevision : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateProvider.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16744,6 +18290,8 @@ class OtaSoftwareUpdateRequestorAnnounceOTAProvider : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -16791,8 +18339,13 @@ class ReadOtaSoftwareUpdateRequestorDefaultOTAProviders : public ReadAttribute { completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.DefaultOTAProviders response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor DefaultOTAProviders read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16849,6 +18402,8 @@ class WriteOtaSoftwareUpdateRequestorDefaultOTAProviders : public WriteAttribute completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("OTASoftwareUpdateRequestor DefaultOTAProviders write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16899,6 +18454,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorDefaultOTAProviders : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.DefaultOTAProviders response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -16932,8 +18492,11 @@ class ReadOtaSoftwareUpdateRequestorUpdatePossible : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUpdatePossibleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdatePossible response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor UpdatePossible read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -16977,6 +18540,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorUpdatePossible : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdatePossible response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17010,8 +18578,11 @@ class ReadOtaSoftwareUpdateRequestorUpdateState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUpdateStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdateState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor UpdateState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17055,6 +18626,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateState : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdateState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17089,8 +18665,11 @@ class ReadOtaSoftwareUpdateRequestorUpdateStateProgress : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUpdateStateProgressWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdateStateProgress response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor UpdateStateProgress read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17135,6 +18714,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorUpdateStateProgress : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.UpdateStateProgress response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17169,8 +18753,11 @@ class ReadOtaSoftwareUpdateRequestorGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17215,6 +18802,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17249,8 +18841,11 @@ class ReadOtaSoftwareUpdateRequestorAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17295,6 +18890,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorAcceptedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17330,8 +18930,11 @@ class ReadOtaSoftwareUpdateRequestorEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17375,6 +18978,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorEventList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17410,8 +19018,11 @@ class ReadOtaSoftwareUpdateRequestorAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17455,6 +19066,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorAttributeList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17488,8 +19104,11 @@ class ReadOtaSoftwareUpdateRequestorFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17533,6 +19152,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorFeatureMap : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17566,8 +19190,11 @@ class ReadOtaSoftwareUpdateRequestorClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OTASoftwareUpdateRequestor ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17611,6 +19238,11 @@ class SubscribeAttributeOtaSoftwareUpdateRequestorClusterRevision : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OTASoftwareUpdateRequestor.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17662,8 +19294,11 @@ class ReadLocalizationConfigurationActiveLocale : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveLocaleWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.ActiveLocale response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration ActiveLocale read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17707,6 +19342,8 @@ class WriteLocalizationConfigurationActiveLocale : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LocalizationConfiguration ActiveLocale write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17753,6 +19390,11 @@ class SubscribeAttributeLocalizationConfigurationActiveLocale : public Subscribe } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.ActiveLocale response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17786,8 +19428,11 @@ class ReadLocalizationConfigurationSupportedLocales : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedLocalesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.SupportedLocales response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration SupportedLocales read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17831,6 +19476,11 @@ class SubscribeAttributeLocalizationConfigurationSupportedLocales : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.SupportedLocales response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17865,8 +19515,11 @@ class ReadLocalizationConfigurationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17911,6 +19564,11 @@ class SubscribeAttributeLocalizationConfigurationGeneratedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -17945,8 +19603,11 @@ class ReadLocalizationConfigurationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -17990,6 +19651,11 @@ class SubscribeAttributeLocalizationConfigurationAcceptedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18025,8 +19691,11 @@ class ReadLocalizationConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18070,6 +19739,11 @@ class SubscribeAttributeLocalizationConfigurationEventList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18105,8 +19779,11 @@ class ReadLocalizationConfigurationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18150,6 +19827,11 @@ class SubscribeAttributeLocalizationConfigurationAttributeList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18183,8 +19865,11 @@ class ReadLocalizationConfigurationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18228,6 +19913,11 @@ class SubscribeAttributeLocalizationConfigurationFeatureMap : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18261,8 +19951,11 @@ class ReadLocalizationConfigurationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LocalizationConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18306,6 +19999,11 @@ class SubscribeAttributeLocalizationConfigurationClusterRevision : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LocalizationConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18358,8 +20056,11 @@ class ReadTimeFormatLocalizationHourFormat : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHourFormatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.HourFormat response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization HourFormat read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18401,6 +20102,8 @@ class WriteTimeFormatLocalizationHourFormat : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("TimeFormatLocalization HourFormat write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18447,6 +20150,11 @@ class SubscribeAttributeTimeFormatLocalizationHourFormat : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.HourFormat response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18480,8 +20188,11 @@ class ReadTimeFormatLocalizationActiveCalendarType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveCalendarTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.ActiveCalendarType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization ActiveCalendarType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18523,6 +20234,8 @@ class WriteTimeFormatLocalizationActiveCalendarType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("TimeFormatLocalization ActiveCalendarType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18569,6 +20282,11 @@ class SubscribeAttributeTimeFormatLocalizationActiveCalendarType : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.ActiveCalendarType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18603,8 +20321,11 @@ class ReadTimeFormatLocalizationSupportedCalendarTypes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedCalendarTypesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.SupportedCalendarTypes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization SupportedCalendarTypes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18648,6 +20369,11 @@ class SubscribeAttributeTimeFormatLocalizationSupportedCalendarTypes : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.SupportedCalendarTypes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18681,8 +20407,11 @@ class ReadTimeFormatLocalizationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18726,6 +20455,11 @@ class SubscribeAttributeTimeFormatLocalizationGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18759,8 +20493,11 @@ class ReadTimeFormatLocalizationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18804,6 +20541,11 @@ class SubscribeAttributeTimeFormatLocalizationAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18839,8 +20581,11 @@ class ReadTimeFormatLocalizationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18884,6 +20629,11 @@ class SubscribeAttributeTimeFormatLocalizationEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18919,8 +20669,11 @@ class ReadTimeFormatLocalizationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -18964,6 +20717,11 @@ class SubscribeAttributeTimeFormatLocalizationAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -18997,8 +20755,11 @@ class ReadTimeFormatLocalizationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19042,6 +20803,11 @@ class SubscribeAttributeTimeFormatLocalizationFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19075,8 +20841,11 @@ class ReadTimeFormatLocalizationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeFormatLocalization ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19120,6 +20889,11 @@ class SubscribeAttributeTimeFormatLocalizationClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeFormatLocalization.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19170,8 +20944,11 @@ class ReadUnitLocalizationTemperatureUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTemperatureUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.TemperatureUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization TemperatureUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19213,6 +20990,8 @@ class WriteUnitLocalizationTemperatureUnit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitLocalization TemperatureUnit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19259,6 +21038,11 @@ class SubscribeAttributeUnitLocalizationTemperatureUnit : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.TemperatureUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19292,8 +21076,11 @@ class ReadUnitLocalizationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19337,6 +21124,11 @@ class SubscribeAttributeUnitLocalizationGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19370,8 +21162,11 @@ class ReadUnitLocalizationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19415,6 +21210,11 @@ class SubscribeAttributeUnitLocalizationAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19450,8 +21250,11 @@ class ReadUnitLocalizationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19495,6 +21298,11 @@ class SubscribeAttributeUnitLocalizationEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19530,8 +21338,11 @@ class ReadUnitLocalizationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19575,6 +21386,11 @@ class SubscribeAttributeUnitLocalizationAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19608,8 +21424,11 @@ class ReadUnitLocalizationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19653,6 +21472,11 @@ class SubscribeAttributeUnitLocalizationFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19686,8 +21510,11 @@ class ReadUnitLocalizationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitLocalization ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19731,6 +21558,11 @@ class SubscribeAttributeUnitLocalizationClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitLocalization.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19781,8 +21613,11 @@ class ReadPowerSourceConfigurationSources : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSourcesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.Sources response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration Sources read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19826,6 +21661,11 @@ class SubscribeAttributePowerSourceConfigurationSources : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.Sources response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19860,8 +21700,11 @@ class ReadPowerSourceConfigurationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19905,6 +21748,11 @@ class SubscribeAttributePowerSourceConfigurationGeneratedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -19939,8 +21787,11 @@ class ReadPowerSourceConfigurationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -19984,6 +21835,11 @@ class SubscribeAttributePowerSourceConfigurationAcceptedCommandList : public Sub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20019,8 +21875,11 @@ class ReadPowerSourceConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20064,6 +21923,11 @@ class SubscribeAttributePowerSourceConfigurationEventList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20099,8 +21963,11 @@ class ReadPowerSourceConfigurationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20144,6 +22011,11 @@ class SubscribeAttributePowerSourceConfigurationAttributeList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20177,8 +22049,11 @@ class ReadPowerSourceConfigurationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20222,6 +22097,11 @@ class SubscribeAttributePowerSourceConfigurationFeatureMap : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20255,8 +22135,11 @@ class ReadPowerSourceConfigurationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSourceConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20300,6 +22183,11 @@ class SubscribeAttributePowerSourceConfigurationClusterRevision : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSourceConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20384,8 +22272,11 @@ class ReadPowerSourceStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Status response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource Status read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20429,6 +22320,11 @@ class SubscribeAttributePowerSourceStatus : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Status response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20462,8 +22358,11 @@ class ReadPowerSourceOrder : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOrderWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Order response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource Order read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20507,6 +22406,11 @@ class SubscribeAttributePowerSourceOrder : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Order response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20540,8 +22444,11 @@ class ReadPowerSourceDescription : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDescriptionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Description response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource Description read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20585,6 +22492,11 @@ class SubscribeAttributePowerSourceDescription : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.Description response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20618,8 +22530,11 @@ class ReadPowerSourceWiredAssessedInputVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredAssessedInputVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredAssessedInputVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20663,6 +22578,11 @@ class SubscribeAttributePowerSourceWiredAssessedInputVoltage : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedInputVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20696,8 +22616,11 @@ class ReadPowerSourceWiredAssessedInputFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredAssessedInputFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredAssessedInputFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20741,6 +22664,11 @@ class SubscribeAttributePowerSourceWiredAssessedInputFrequency : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedInputFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20774,8 +22702,11 @@ class ReadPowerSourceWiredCurrentType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredCurrentTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredCurrentType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20819,6 +22750,11 @@ class SubscribeAttributePowerSourceWiredCurrentType : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredCurrentType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20852,8 +22788,11 @@ class ReadPowerSourceWiredAssessedCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredAssessedCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredAssessedCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20897,6 +22836,11 @@ class SubscribeAttributePowerSourceWiredAssessedCurrent : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredAssessedCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -20930,8 +22874,11 @@ class ReadPowerSourceWiredNominalVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredNominalVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredNominalVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -20975,6 +22922,11 @@ class SubscribeAttributePowerSourceWiredNominalVoltage : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredNominalVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21008,8 +22960,11 @@ class ReadPowerSourceWiredMaximumCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredMaximumCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredMaximumCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21053,6 +23008,11 @@ class SubscribeAttributePowerSourceWiredMaximumCurrent : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredMaximumCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21086,8 +23046,11 @@ class ReadPowerSourceWiredPresent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiredPresentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredPresent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource WiredPresent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21131,6 +23094,11 @@ class SubscribeAttributePowerSourceWiredPresent : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.WiredPresent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21164,8 +23132,11 @@ class ReadPowerSourceActiveWiredFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveWiredFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource ActiveWiredFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21209,6 +23180,11 @@ class SubscribeAttributePowerSourceActiveWiredFaults : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveWiredFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21242,8 +23218,11 @@ class ReadPowerSourceBatVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21287,6 +23266,11 @@ class SubscribeAttributePowerSourceBatVoltage : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21320,8 +23304,11 @@ class ReadPowerSourceBatPercentRemaining : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatPercentRemainingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatPercentRemaining response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatPercentRemaining read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21365,6 +23352,11 @@ class SubscribeAttributePowerSourceBatPercentRemaining : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatPercentRemaining response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21398,8 +23390,11 @@ class ReadPowerSourceBatTimeRemaining : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatTimeRemainingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatTimeRemaining response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatTimeRemaining read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21443,6 +23438,11 @@ class SubscribeAttributePowerSourceBatTimeRemaining : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatTimeRemaining response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21476,8 +23476,11 @@ class ReadPowerSourceBatChargeLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatChargeLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargeLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatChargeLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21521,6 +23524,11 @@ class SubscribeAttributePowerSourceBatChargeLevel : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargeLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21554,8 +23562,11 @@ class ReadPowerSourceBatReplacementNeeded : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatReplacementNeededWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplacementNeeded response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatReplacementNeeded read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21599,6 +23610,11 @@ class SubscribeAttributePowerSourceBatReplacementNeeded : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplacementNeeded response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21632,8 +23648,11 @@ class ReadPowerSourceBatReplaceability : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatReplaceabilityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplaceability response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatReplaceability read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21677,6 +23696,11 @@ class SubscribeAttributePowerSourceBatReplaceability : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplaceability response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21710,8 +23734,11 @@ class ReadPowerSourceBatPresent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatPresentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatPresent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatPresent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21755,6 +23782,11 @@ class SubscribeAttributePowerSourceBatPresent : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatPresent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21788,8 +23820,11 @@ class ReadPowerSourceActiveBatFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveBatFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveBatFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource ActiveBatFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21833,6 +23868,11 @@ class SubscribeAttributePowerSourceActiveBatFaults : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveBatFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21866,8 +23906,11 @@ class ReadPowerSourceBatReplacementDescription : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatReplacementDescriptionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplacementDescription response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatReplacementDescription read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21911,6 +23954,11 @@ class SubscribeAttributePowerSourceBatReplacementDescription : public SubscribeA } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatReplacementDescription response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -21944,8 +23992,11 @@ class ReadPowerSourceBatCommonDesignation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatCommonDesignationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatCommonDesignation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatCommonDesignation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -21989,6 +24040,11 @@ class SubscribeAttributePowerSourceBatCommonDesignation : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatCommonDesignation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22022,8 +24078,11 @@ class ReadPowerSourceBatANSIDesignation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatANSIDesignationWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatANSIDesignation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatANSIDesignation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22067,6 +24126,11 @@ class SubscribeAttributePowerSourceBatANSIDesignation : public SubscribeAttribut } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatANSIDesignation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22100,8 +24164,11 @@ class ReadPowerSourceBatIECDesignation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatIECDesignationWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatIECDesignation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatIECDesignation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22145,6 +24212,11 @@ class SubscribeAttributePowerSourceBatIECDesignation : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatIECDesignation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22178,8 +24250,11 @@ class ReadPowerSourceBatApprovedChemistry : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatApprovedChemistryWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatApprovedChemistry response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatApprovedChemistry read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22223,6 +24298,11 @@ class SubscribeAttributePowerSourceBatApprovedChemistry : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatApprovedChemistry response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22256,8 +24336,11 @@ class ReadPowerSourceBatCapacity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatCapacity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatCapacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22301,6 +24384,11 @@ class SubscribeAttributePowerSourceBatCapacity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatCapacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22334,8 +24422,11 @@ class ReadPowerSourceBatQuantity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatQuantityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatQuantity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatQuantity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22379,6 +24470,11 @@ class SubscribeAttributePowerSourceBatQuantity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatQuantity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22412,8 +24508,11 @@ class ReadPowerSourceBatChargeState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatChargeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargeState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatChargeState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22457,6 +24556,11 @@ class SubscribeAttributePowerSourceBatChargeState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargeState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22490,8 +24594,11 @@ class ReadPowerSourceBatTimeToFullCharge : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatTimeToFullChargeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatTimeToFullCharge response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatTimeToFullCharge read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22535,6 +24642,11 @@ class SubscribeAttributePowerSourceBatTimeToFullCharge : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatTimeToFullCharge response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22568,8 +24680,11 @@ class ReadPowerSourceBatFunctionalWhileCharging : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatFunctionalWhileChargingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatFunctionalWhileCharging response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatFunctionalWhileCharging read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22613,6 +24728,11 @@ class SubscribeAttributePowerSourceBatFunctionalWhileCharging : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatFunctionalWhileCharging response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22646,8 +24766,11 @@ class ReadPowerSourceBatChargingCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatChargingCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargingCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource BatChargingCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22691,6 +24814,11 @@ class SubscribeAttributePowerSourceBatChargingCurrent : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.BatChargingCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22724,8 +24852,11 @@ class ReadPowerSourceActiveBatChargeFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveBatChargeFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveBatChargeFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource ActiveBatChargeFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22769,6 +24900,11 @@ class SubscribeAttributePowerSourceActiveBatChargeFaults : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ActiveBatChargeFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22804,8 +24940,11 @@ class ReadPowerSourceEndpointList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEndpointListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.EndpointList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource EndpointList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22849,6 +24988,11 @@ class SubscribeAttributePowerSourceEndpointList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.EndpointList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22884,8 +25028,11 @@ class ReadPowerSourceGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -22929,6 +25076,11 @@ class SubscribeAttributePowerSourceGeneratedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -22962,8 +25114,11 @@ class ReadPowerSourceAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23007,6 +25162,11 @@ class SubscribeAttributePowerSourceAcceptedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23042,8 +25202,11 @@ class ReadPowerSourceEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23087,6 +25250,11 @@ class SubscribeAttributePowerSourceEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23122,8 +25290,11 @@ class ReadPowerSourceAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23167,6 +25338,11 @@ class SubscribeAttributePowerSourceAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23200,8 +25376,11 @@ class ReadPowerSourceFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23245,6 +25424,11 @@ class SubscribeAttributePowerSourceFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23278,8 +25462,11 @@ class ReadPowerSourceClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PowerSource ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23323,6 +25510,11 @@ class SubscribeAttributePowerSourceClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PowerSource.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23387,19 +25579,28 @@ class GeneralCommissioningArmFailSafe : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster armFailSafeWithParams:params - completion:^(MTRGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + armFailSafeWithParams:params + completion:^(MTRGeneralCommissioningClusterArmFailSafeResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::GeneralCommissioning::Commands::ArmFailSafeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -23450,10 +25651,20 @@ class GeneralCommissioningSetRegulatoryConfig : public ClusterCommand { completion:^(MTRGeneralCommissioningClusterSetRegulatoryConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralCommissioning:: + Commands::SetRegulatoryConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralCommissioning:: + Commands::SetRegulatoryConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -23501,10 +25712,20 @@ class GeneralCommissioningCommissioningComplete : public ClusterCommand { MTRGeneralCommissioningClusterCommissioningCompleteResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralCommissioning:: + Commands::CommissioningCompleteResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::GeneralCommissioning:: + Commands::CommissioningCompleteResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -23543,8 +25764,11 @@ class ReadGeneralCommissioningBreadcrumb : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBreadcrumbWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.Breadcrumb response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning Breadcrumb read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23586,6 +25810,8 @@ class WriteGeneralCommissioningBreadcrumb : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("GeneralCommissioning Breadcrumb write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23632,6 +25858,11 @@ class SubscribeAttributeGeneralCommissioningBreadcrumb : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.Breadcrumb response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23666,8 +25897,11 @@ class ReadGeneralCommissioningBasicCommissioningInfo : public ReadAttribute { [cluster readAttributeBasicCommissioningInfoWithCompletion:^( MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.BasicCommissioningInfo response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning BasicCommissioningInfo read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23711,6 +25945,11 @@ class SubscribeAttributeGeneralCommissioningBasicCommissioningInfo : public Subs } reportHandler:^(MTRGeneralCommissioningClusterBasicCommissioningInfo * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.BasicCommissioningInfo response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23744,8 +25983,11 @@ class ReadGeneralCommissioningRegulatoryConfig : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRegulatoryConfigWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.RegulatoryConfig response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning RegulatoryConfig read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23789,6 +26031,11 @@ class SubscribeAttributeGeneralCommissioningRegulatoryConfig : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.RegulatoryConfig response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23822,8 +26069,11 @@ class ReadGeneralCommissioningLocationCapability : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocationCapabilityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.LocationCapability response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning LocationCapability read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23867,6 +26117,11 @@ class SubscribeAttributeGeneralCommissioningLocationCapability : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.LocationCapability response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23901,8 +26156,11 @@ class ReadGeneralCommissioningSupportsConcurrentConnection : public ReadAttribut queue:callbackQueue]; [cluster readAttributeSupportsConcurrentConnectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.SupportsConcurrentConnection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning SupportsConcurrentConnection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -23947,6 +26205,11 @@ class SubscribeAttributeGeneralCommissioningSupportsConcurrentConnection : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.SupportsConcurrentConnection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -23980,8 +26243,11 @@ class ReadGeneralCommissioningGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24025,6 +26291,11 @@ class SubscribeAttributeGeneralCommissioningGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24058,8 +26329,11 @@ class ReadGeneralCommissioningAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24103,6 +26377,11 @@ class SubscribeAttributeGeneralCommissioningAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24138,8 +26417,11 @@ class ReadGeneralCommissioningEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24183,6 +26465,11 @@ class SubscribeAttributeGeneralCommissioningEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24218,8 +26505,11 @@ class ReadGeneralCommissioningAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24263,6 +26553,11 @@ class SubscribeAttributeGeneralCommissioningAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24296,8 +26591,11 @@ class ReadGeneralCommissioningFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24341,6 +26639,11 @@ class SubscribeAttributeGeneralCommissioningFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24374,8 +26677,11 @@ class ReadGeneralCommissioningClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralCommissioning ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24419,6 +26725,11 @@ class SubscribeAttributeGeneralCommissioningClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralCommissioning.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24502,19 +26813,28 @@ class NetworkCommissioningScanNetworks : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster scanNetworksWithParams:params - completion:^(MTRNetworkCommissioningClusterScanNetworksResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + scanNetworksWithParams:params + completion:^(MTRNetworkCommissioningClusterScanNetworksResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::ScanNetworksResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -24567,10 +26887,20 @@ class NetworkCommissioningAddOrUpdateWiFiNetwork : public ClusterCommand { completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -24627,10 +26957,20 @@ class NetworkCommissioningAddOrUpdateThreadNetwork : public ClusterCommand { completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::NetworkCommissioning:: + Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::NetworkCommissioning:: + Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -24681,19 +27021,29 @@ class NetworkCommissioningRemoveNetwork : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster removeNetworkWithParams:params - completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + removeNetworkWithParams:params + completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -24739,19 +27089,29 @@ class NetworkCommissioningConnectNetwork : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster connectNetworkWithParams:params - completion:^(MTRNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + connectNetworkWithParams:params + completion:^(MTRNetworkCommissioningClusterConnectNetworkResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::ConnectNetworkResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -24799,19 +27159,29 @@ class NetworkCommissioningReorderNetwork : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster reorderNetworkWithParams:params - completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + reorderNetworkWithParams:params + completion:^(MTRNetworkCommissioningClusterNetworkConfigResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::NetworkCommissioning::Commands::NetworkConfigResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -24846,8 +27216,11 @@ class ReadNetworkCommissioningMaxNetworks : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxNetworksWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.MaxNetworks response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning MaxNetworks read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24891,6 +27264,11 @@ class SubscribeAttributeNetworkCommissioningMaxNetworks : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.MaxNetworks response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -24924,8 +27302,11 @@ class ReadNetworkCommissioningNetworks : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNetworksWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.Networks response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning Networks read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -24969,6 +27350,11 @@ class SubscribeAttributeNetworkCommissioningNetworks : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.Networks response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25002,8 +27388,11 @@ class ReadNetworkCommissioningScanMaxTimeSeconds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeScanMaxTimeSecondsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ScanMaxTimeSeconds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning ScanMaxTimeSeconds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25047,6 +27436,11 @@ class SubscribeAttributeNetworkCommissioningScanMaxTimeSeconds : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ScanMaxTimeSeconds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25080,8 +27474,11 @@ class ReadNetworkCommissioningConnectMaxTimeSeconds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeConnectMaxTimeSecondsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ConnectMaxTimeSeconds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning ConnectMaxTimeSeconds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25125,6 +27522,11 @@ class SubscribeAttributeNetworkCommissioningConnectMaxTimeSeconds : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ConnectMaxTimeSeconds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25158,8 +27560,11 @@ class ReadNetworkCommissioningInterfaceEnabled : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInterfaceEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.InterfaceEnabled response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning InterfaceEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25201,6 +27606,8 @@ class WriteNetworkCommissioningInterfaceEnabled : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("NetworkCommissioning InterfaceEnabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25247,6 +27654,11 @@ class SubscribeAttributeNetworkCommissioningInterfaceEnabled : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.InterfaceEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25280,8 +27692,11 @@ class ReadNetworkCommissioningLastNetworkingStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLastNetworkingStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastNetworkingStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning LastNetworkingStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25325,6 +27740,11 @@ class SubscribeAttributeNetworkCommissioningLastNetworkingStatus : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastNetworkingStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25358,8 +27778,11 @@ class ReadNetworkCommissioningLastNetworkID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLastNetworkIDWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastNetworkID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning LastNetworkID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25403,6 +27826,11 @@ class SubscribeAttributeNetworkCommissioningLastNetworkID : public SubscribeAttr } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastNetworkID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25436,8 +27864,11 @@ class ReadNetworkCommissioningLastConnectErrorValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLastConnectErrorValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastConnectErrorValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning LastConnectErrorValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25481,6 +27912,11 @@ class SubscribeAttributeNetworkCommissioningLastConnectErrorValue : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.LastConnectErrorValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25514,8 +27950,11 @@ class ReadNetworkCommissioningGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25559,6 +27998,11 @@ class SubscribeAttributeNetworkCommissioningGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25592,8 +28036,11 @@ class ReadNetworkCommissioningAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25637,6 +28084,11 @@ class SubscribeAttributeNetworkCommissioningAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25672,8 +28124,11 @@ class ReadNetworkCommissioningEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25717,6 +28172,11 @@ class SubscribeAttributeNetworkCommissioningEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25752,8 +28212,11 @@ class ReadNetworkCommissioningAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25797,6 +28260,11 @@ class SubscribeAttributeNetworkCommissioningAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25830,8 +28298,11 @@ class ReadNetworkCommissioningFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25875,6 +28346,11 @@ class SubscribeAttributeNetworkCommissioningFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -25908,8 +28384,11 @@ class ReadNetworkCommissioningClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NetworkCommissioning ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -25953,6 +28432,11 @@ class SubscribeAttributeNetworkCommissioningClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NetworkCommissioning.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26022,10 +28506,20 @@ class DiagnosticLogsRetrieveLogsRequest : public ClusterCommand { completion:^(MTRDiagnosticLogsClusterRetrieveLogsResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DiagnosticLogs::Commands::RetrieveLogsResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -26065,8 +28559,11 @@ class ReadDiagnosticLogsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26110,6 +28607,11 @@ class SubscribeAttributeDiagnosticLogsGeneratedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26143,8 +28645,11 @@ class ReadDiagnosticLogsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26188,6 +28693,11 @@ class SubscribeAttributeDiagnosticLogsAcceptedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26223,8 +28733,11 @@ class ReadDiagnosticLogsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26268,6 +28781,11 @@ class SubscribeAttributeDiagnosticLogsEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26303,8 +28821,11 @@ class ReadDiagnosticLogsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26348,6 +28869,11 @@ class SubscribeAttributeDiagnosticLogsAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26381,8 +28907,11 @@ class ReadDiagnosticLogsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26426,6 +28955,11 @@ class SubscribeAttributeDiagnosticLogsFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26459,8 +28993,11 @@ class ReadDiagnosticLogsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DiagnosticLogs ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26504,6 +29041,11 @@ class SubscribeAttributeDiagnosticLogsClusterRevision : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DiagnosticLogs.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26580,6 +29122,8 @@ class GeneralDiagnosticsTestEventTrigger : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -26619,8 +29163,11 @@ class ReadGeneralDiagnosticsNetworkInterfaces : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNetworkInterfacesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.NetworkInterfaces response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics NetworkInterfaces read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26664,6 +29211,11 @@ class SubscribeAttributeGeneralDiagnosticsNetworkInterfaces : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.NetworkInterfaces response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26697,8 +29249,11 @@ class ReadGeneralDiagnosticsRebootCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRebootCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.RebootCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics RebootCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26742,6 +29297,11 @@ class SubscribeAttributeGeneralDiagnosticsRebootCount : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.RebootCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26775,8 +29335,11 @@ class ReadGeneralDiagnosticsUpTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUpTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.UpTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics UpTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26820,6 +29383,11 @@ class SubscribeAttributeGeneralDiagnosticsUpTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.UpTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26853,8 +29421,11 @@ class ReadGeneralDiagnosticsTotalOperationalHours : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTotalOperationalHoursWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.TotalOperationalHours response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics TotalOperationalHours read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26898,6 +29469,11 @@ class SubscribeAttributeGeneralDiagnosticsTotalOperationalHours : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.TotalOperationalHours response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -26931,8 +29507,11 @@ class ReadGeneralDiagnosticsBootReason : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBootReasonWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.BootReason response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics BootReason read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -26976,6 +29555,11 @@ class SubscribeAttributeGeneralDiagnosticsBootReason : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.BootReason response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27009,8 +29593,11 @@ class ReadGeneralDiagnosticsActiveHardwareFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveHardwareFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveHardwareFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics ActiveHardwareFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27054,6 +29641,11 @@ class SubscribeAttributeGeneralDiagnosticsActiveHardwareFaults : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveHardwareFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27087,8 +29679,11 @@ class ReadGeneralDiagnosticsActiveRadioFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveRadioFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveRadioFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics ActiveRadioFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27132,6 +29727,11 @@ class SubscribeAttributeGeneralDiagnosticsActiveRadioFaults : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveRadioFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27165,8 +29765,11 @@ class ReadGeneralDiagnosticsActiveNetworkFaults : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveNetworkFaultsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveNetworkFaults response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics ActiveNetworkFaults read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27210,6 +29813,11 @@ class SubscribeAttributeGeneralDiagnosticsActiveNetworkFaults : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ActiveNetworkFaults response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27243,8 +29851,11 @@ class ReadGeneralDiagnosticsTestEventTriggersEnabled : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTestEventTriggersEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.TestEventTriggersEnabled response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics TestEventTriggersEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27288,6 +29899,11 @@ class SubscribeAttributeGeneralDiagnosticsTestEventTriggersEnabled : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.TestEventTriggersEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27321,8 +29937,11 @@ class ReadGeneralDiagnosticsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27366,6 +29985,11 @@ class SubscribeAttributeGeneralDiagnosticsGeneratedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27399,8 +30023,11 @@ class ReadGeneralDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27444,6 +30071,11 @@ class SubscribeAttributeGeneralDiagnosticsAcceptedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27479,8 +30111,11 @@ class ReadGeneralDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27524,6 +30159,11 @@ class SubscribeAttributeGeneralDiagnosticsEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27559,8 +30199,11 @@ class ReadGeneralDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27604,6 +30247,11 @@ class SubscribeAttributeGeneralDiagnosticsAttributeList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27637,8 +30285,11 @@ class ReadGeneralDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27682,6 +30333,11 @@ class SubscribeAttributeGeneralDiagnosticsFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27715,8 +30371,11 @@ class ReadGeneralDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GeneralDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27760,6 +30419,11 @@ class SubscribeAttributeGeneralDiagnosticsClusterRevision : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GeneralDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27824,6 +30488,8 @@ class SoftwareDiagnosticsResetWatermarks : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -27862,8 +30528,11 @@ class ReadSoftwareDiagnosticsThreadMetrics : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeThreadMetricsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.ThreadMetrics response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics ThreadMetrics read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27907,6 +30576,11 @@ class SubscribeAttributeSoftwareDiagnosticsThreadMetrics : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.ThreadMetrics response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -27940,8 +30614,11 @@ class ReadSoftwareDiagnosticsCurrentHeapFree : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentHeapFreeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapFree response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics CurrentHeapFree read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -27985,6 +30662,11 @@ class SubscribeAttributeSoftwareDiagnosticsCurrentHeapFree : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapFree response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28018,8 +30700,11 @@ class ReadSoftwareDiagnosticsCurrentHeapUsed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentHeapUsedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapUsed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics CurrentHeapUsed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28063,6 +30748,11 @@ class SubscribeAttributeSoftwareDiagnosticsCurrentHeapUsed : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapUsed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28097,8 +30787,11 @@ class ReadSoftwareDiagnosticsCurrentHeapHighWatermark : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentHeapHighWatermarkWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapHighWatermark response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics CurrentHeapHighWatermark read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28142,6 +30835,11 @@ class SubscribeAttributeSoftwareDiagnosticsCurrentHeapHighWatermark : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.CurrentHeapHighWatermark response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28175,8 +30873,11 @@ class ReadSoftwareDiagnosticsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28220,6 +30921,11 @@ class SubscribeAttributeSoftwareDiagnosticsGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28253,8 +30959,11 @@ class ReadSoftwareDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28298,6 +31007,11 @@ class SubscribeAttributeSoftwareDiagnosticsAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28333,8 +31047,11 @@ class ReadSoftwareDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28378,6 +31095,11 @@ class SubscribeAttributeSoftwareDiagnosticsEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28413,8 +31135,11 @@ class ReadSoftwareDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28458,6 +31183,11 @@ class SubscribeAttributeSoftwareDiagnosticsAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28491,8 +31221,11 @@ class ReadSoftwareDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28536,6 +31269,11 @@ class SubscribeAttributeSoftwareDiagnosticsFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28569,8 +31307,11 @@ class ReadSoftwareDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SoftwareDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28614,6 +31355,11 @@ class SubscribeAttributeSoftwareDiagnosticsClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SoftwareDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28732,17 +31478,19 @@ class ThreadNetworkDiagnosticsResetCounts : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster resetCountsWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + resetCountsWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -28776,8 +31524,11 @@ class ReadThreadNetworkDiagnosticsChannel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChannelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Channel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics Channel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28821,6 +31572,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsChannel : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Channel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28854,8 +31610,11 @@ class ReadThreadNetworkDiagnosticsRoutingRole : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRoutingRoleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RoutingRole response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RoutingRole read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28899,6 +31658,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRoutingRole : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RoutingRole response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -28932,8 +31696,11 @@ class ReadThreadNetworkDiagnosticsNetworkName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNetworkNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.NetworkName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics NetworkName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -28977,6 +31744,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsNetworkName : public SubscribeAt } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.NetworkName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29010,8 +31782,11 @@ class ReadThreadNetworkDiagnosticsPanId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePanIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PanId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics PanId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29055,6 +31830,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsPanId : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PanId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29088,8 +31868,11 @@ class ReadThreadNetworkDiagnosticsExtendedPanId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeExtendedPanIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ExtendedPanId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ExtendedPanId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29133,6 +31916,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsExtendedPanId : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ExtendedPanId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29166,8 +31954,11 @@ class ReadThreadNetworkDiagnosticsMeshLocalPrefix : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeshLocalPrefixWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.MeshLocalPrefix response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics MeshLocalPrefix read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29211,6 +32002,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsMeshLocalPrefix : public Subscri } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.MeshLocalPrefix response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29244,8 +32040,11 @@ class ReadThreadNetworkDiagnosticsOverrunCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOverrunCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.OverrunCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics OverrunCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29289,6 +32088,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsOverrunCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.OverrunCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29322,8 +32126,11 @@ class ReadThreadNetworkDiagnosticsNeighborTable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNeighborTableWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.NeighborTable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics NeighborTable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29367,6 +32174,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsNeighborTable : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.NeighborTable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29400,8 +32212,11 @@ class ReadThreadNetworkDiagnosticsRouteTable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRouteTableWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RouteTable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RouteTable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29445,6 +32260,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRouteTable : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RouteTable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29478,8 +32298,11 @@ class ReadThreadNetworkDiagnosticsPartitionId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePartitionIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PartitionId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics PartitionId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29523,6 +32346,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsPartitionId : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PartitionId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29556,8 +32384,11 @@ class ReadThreadNetworkDiagnosticsWeighting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWeightingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Weighting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics Weighting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29601,6 +32432,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsWeighting : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Weighting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29634,8 +32470,11 @@ class ReadThreadNetworkDiagnosticsDataVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDataVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.DataVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics DataVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29679,6 +32518,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsDataVersion : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.DataVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29712,8 +32556,11 @@ class ReadThreadNetworkDiagnosticsStableDataVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStableDataVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.StableDataVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics StableDataVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29757,6 +32604,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsStableDataVersion : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.StableDataVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29790,8 +32642,11 @@ class ReadThreadNetworkDiagnosticsLeaderRouterId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLeaderRouterIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.LeaderRouterId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics LeaderRouterId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29835,6 +32690,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsLeaderRouterId : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.LeaderRouterId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29868,8 +32728,11 @@ class ReadThreadNetworkDiagnosticsDetachedRoleCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDetachedRoleCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.DetachedRoleCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics DetachedRoleCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29913,6 +32776,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsDetachedRoleCount : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.DetachedRoleCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -29946,8 +32814,11 @@ class ReadThreadNetworkDiagnosticsChildRoleCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChildRoleCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ChildRoleCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ChildRoleCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -29991,6 +32862,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsChildRoleCount : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ChildRoleCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30024,8 +32900,11 @@ class ReadThreadNetworkDiagnosticsRouterRoleCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRouterRoleCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RouterRoleCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RouterRoleCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30069,6 +32948,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRouterRoleCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RouterRoleCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30102,8 +32986,11 @@ class ReadThreadNetworkDiagnosticsLeaderRoleCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLeaderRoleCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.LeaderRoleCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics LeaderRoleCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30147,6 +33034,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsLeaderRoleCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.LeaderRoleCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30180,8 +33072,11 @@ class ReadThreadNetworkDiagnosticsAttachAttemptCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttachAttemptCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AttachAttemptCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics AttachAttemptCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30225,6 +33120,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsAttachAttemptCount : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AttachAttemptCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30259,8 +33159,11 @@ class ReadThreadNetworkDiagnosticsPartitionIdChangeCount : public ReadAttribute queue:callbackQueue]; [cluster readAttributePartitionIdChangeCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PartitionIdChangeCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics PartitionIdChangeCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30305,6 +33208,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsPartitionIdChangeCount : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PartitionIdChangeCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30340,8 +33248,11 @@ class ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount : public Rea [cluster readAttributeBetterPartitionAttachAttemptCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.BetterPartitionAttachAttemptCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics BetterPartitionAttachAttemptCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30386,6 +33297,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsBetterPartitionAttachAttemptCoun } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.BetterPartitionAttachAttemptCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30419,8 +33335,11 @@ class ReadThreadNetworkDiagnosticsParentChangeCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeParentChangeCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ParentChangeCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ParentChangeCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30464,6 +33383,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsParentChangeCount : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ParentChangeCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30497,8 +33421,11 @@ class ReadThreadNetworkDiagnosticsTxTotalCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxTotalCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxTotalCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxTotalCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30542,6 +33469,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxTotalCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxTotalCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30575,8 +33507,11 @@ class ReadThreadNetworkDiagnosticsTxUnicastCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxUnicastCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxUnicastCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxUnicastCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30620,6 +33555,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxUnicastCount : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxUnicastCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30653,8 +33593,11 @@ class ReadThreadNetworkDiagnosticsTxBroadcastCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxBroadcastCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBroadcastCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxBroadcastCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30698,6 +33641,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxBroadcastCount : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBroadcastCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30732,8 +33680,11 @@ class ReadThreadNetworkDiagnosticsTxAckRequestedCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxAckRequestedCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxAckRequestedCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxAckRequestedCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30777,6 +33728,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxAckRequestedCount : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxAckRequestedCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30810,8 +33766,11 @@ class ReadThreadNetworkDiagnosticsTxAckedCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxAckedCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxAckedCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxAckedCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30855,6 +33814,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxAckedCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxAckedCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30889,8 +33853,11 @@ class ReadThreadNetworkDiagnosticsTxNoAckRequestedCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxNoAckRequestedCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxNoAckRequestedCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxNoAckRequestedCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -30935,6 +33902,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxNoAckRequestedCount : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxNoAckRequestedCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -30968,8 +33940,11 @@ class ReadThreadNetworkDiagnosticsTxDataCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxDataCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDataCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxDataCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31013,6 +33988,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxDataCount : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDataCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31046,8 +34026,11 @@ class ReadThreadNetworkDiagnosticsTxDataPollCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxDataPollCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDataPollCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxDataPollCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31091,6 +34074,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxDataPollCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDataPollCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31124,8 +34112,11 @@ class ReadThreadNetworkDiagnosticsTxBeaconCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxBeaconCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBeaconCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxBeaconCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31169,6 +34160,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxBeaconCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBeaconCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31203,8 +34199,11 @@ class ReadThreadNetworkDiagnosticsTxBeaconRequestCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxBeaconRequestCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBeaconRequestCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxBeaconRequestCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31248,6 +34247,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxBeaconRequestCount : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxBeaconRequestCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31281,8 +34285,11 @@ class ReadThreadNetworkDiagnosticsTxOtherCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxOtherCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxOtherCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxOtherCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31326,6 +34333,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxOtherCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxOtherCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31359,8 +34371,11 @@ class ReadThreadNetworkDiagnosticsTxRetryCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxRetryCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxRetryCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxRetryCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31404,6 +34419,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxRetryCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxRetryCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31438,8 +34458,11 @@ class ReadThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount : public ReadAttri queue:callbackQueue]; [cluster readAttributeTxDirectMaxRetryExpiryCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDirectMaxRetryExpiryCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxDirectMaxRetryExpiryCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31484,6 +34507,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxDirectMaxRetryExpiryCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31518,8 +34546,11 @@ class ReadThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount : public ReadAtt queue:callbackQueue]; [cluster readAttributeTxIndirectMaxRetryExpiryCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxIndirectMaxRetryExpiryCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxIndirectMaxRetryExpiryCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31564,6 +34595,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxIndirectMaxRetryExpiryCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31597,8 +34633,11 @@ class ReadThreadNetworkDiagnosticsTxErrCcaCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxErrCcaCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrCcaCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxErrCcaCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31642,6 +34681,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxErrCcaCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrCcaCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31675,8 +34719,11 @@ class ReadThreadNetworkDiagnosticsTxErrAbortCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxErrAbortCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrAbortCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxErrAbortCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31720,6 +34767,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxErrAbortCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrAbortCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31754,8 +34806,11 @@ class ReadThreadNetworkDiagnosticsTxErrBusyChannelCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxErrBusyChannelCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrBusyChannelCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics TxErrBusyChannelCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31800,6 +34855,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsTxErrBusyChannelCount : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.TxErrBusyChannelCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31833,8 +34893,11 @@ class ReadThreadNetworkDiagnosticsRxTotalCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxTotalCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxTotalCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxTotalCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31878,6 +34941,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxTotalCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxTotalCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31911,8 +34979,11 @@ class ReadThreadNetworkDiagnosticsRxUnicastCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxUnicastCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxUnicastCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxUnicastCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -31956,6 +35027,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxUnicastCount : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxUnicastCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -31989,8 +35065,11 @@ class ReadThreadNetworkDiagnosticsRxBroadcastCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxBroadcastCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBroadcastCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxBroadcastCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32034,6 +35113,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxBroadcastCount : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBroadcastCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32067,8 +35151,11 @@ class ReadThreadNetworkDiagnosticsRxDataCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxDataCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDataCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxDataCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32112,6 +35199,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxDataCount : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDataCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32145,8 +35237,11 @@ class ReadThreadNetworkDiagnosticsRxDataPollCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxDataPollCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDataPollCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxDataPollCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32190,6 +35285,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxDataPollCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDataPollCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32223,8 +35323,11 @@ class ReadThreadNetworkDiagnosticsRxBeaconCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxBeaconCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBeaconCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxBeaconCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32268,6 +35371,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxBeaconCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBeaconCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32302,8 +35410,11 @@ class ReadThreadNetworkDiagnosticsRxBeaconRequestCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxBeaconRequestCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBeaconRequestCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxBeaconRequestCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32347,6 +35458,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxBeaconRequestCount : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxBeaconRequestCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32380,8 +35496,11 @@ class ReadThreadNetworkDiagnosticsRxOtherCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxOtherCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxOtherCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxOtherCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32425,6 +35544,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxOtherCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxOtherCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32459,8 +35583,11 @@ class ReadThreadNetworkDiagnosticsRxAddressFilteredCount : public ReadAttribute queue:callbackQueue]; [cluster readAttributeRxAddressFilteredCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxAddressFilteredCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxAddressFilteredCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32505,6 +35632,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxAddressFilteredCount : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxAddressFilteredCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32539,8 +35671,11 @@ class ReadThreadNetworkDiagnosticsRxDestAddrFilteredCount : public ReadAttribute queue:callbackQueue]; [cluster readAttributeRxDestAddrFilteredCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDestAddrFilteredCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxDestAddrFilteredCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32585,6 +35720,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxDestAddrFilteredCount : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDestAddrFilteredCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32618,8 +35758,11 @@ class ReadThreadNetworkDiagnosticsRxDuplicatedCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxDuplicatedCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDuplicatedCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxDuplicatedCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32663,6 +35806,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxDuplicatedCount : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxDuplicatedCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32696,8 +35844,11 @@ class ReadThreadNetworkDiagnosticsRxErrNoFrameCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxErrNoFrameCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrNoFrameCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrNoFrameCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32741,6 +35892,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrNoFrameCount : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrNoFrameCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32775,8 +35931,11 @@ class ReadThreadNetworkDiagnosticsRxErrUnknownNeighborCount : public ReadAttribu queue:callbackQueue]; [cluster readAttributeRxErrUnknownNeighborCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrUnknownNeighborCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrUnknownNeighborCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32821,6 +35980,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrUnknownNeighborCount : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrUnknownNeighborCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32855,8 +36019,11 @@ class ReadThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount : public ReadAttribut queue:callbackQueue]; [cluster readAttributeRxErrInvalidSrcAddrCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrInvalidSrcAddrCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrInvalidSrcAddrCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32901,6 +36068,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrInvalidSrcAddrCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -32934,8 +36106,11 @@ class ReadThreadNetworkDiagnosticsRxErrSecCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxErrSecCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrSecCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrSecCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -32979,6 +36154,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrSecCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrSecCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33012,8 +36192,11 @@ class ReadThreadNetworkDiagnosticsRxErrFcsCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxErrFcsCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrFcsCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrFcsCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33057,6 +36240,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrFcsCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrFcsCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33090,8 +36278,11 @@ class ReadThreadNetworkDiagnosticsRxErrOtherCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRxErrOtherCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrOtherCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics RxErrOtherCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33135,6 +36326,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsRxErrOtherCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.RxErrOtherCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33168,8 +36364,11 @@ class ReadThreadNetworkDiagnosticsActiveTimestamp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveTimestampWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ActiveTimestamp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ActiveTimestamp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33213,6 +36412,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsActiveTimestamp : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ActiveTimestamp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33246,8 +36450,11 @@ class ReadThreadNetworkDiagnosticsPendingTimestamp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePendingTimestampWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PendingTimestamp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics PendingTimestamp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33291,6 +36498,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsPendingTimestamp : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.PendingTimestamp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33324,8 +36536,11 @@ class ReadThreadNetworkDiagnosticsDelay : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDelayWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Delay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics Delay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33369,6 +36584,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsDelay : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.Delay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33403,8 +36623,11 @@ class ReadThreadNetworkDiagnosticsSecurityPolicy : public ReadAttribute { [cluster readAttributeSecurityPolicyWithCompletion:^( MTRThreadNetworkDiagnosticsClusterSecurityPolicy * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.SecurityPolicy response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics SecurityPolicy read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33448,6 +36671,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsSecurityPolicy : public Subscrib } reportHandler:^(MTRThreadNetworkDiagnosticsClusterSecurityPolicy * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.SecurityPolicy response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33481,8 +36709,11 @@ class ReadThreadNetworkDiagnosticsChannelPage0Mask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChannelPage0MaskWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ChannelPage0Mask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ChannelPage0Mask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33526,6 +36757,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsChannelPage0Mask : public Subscr } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ChannelPage0Mask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33561,8 +36797,11 @@ class ReadThreadNetworkDiagnosticsOperationalDatasetComponents : public ReadAttr [cluster readAttributeOperationalDatasetComponentsWithCompletion:^( MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.OperationalDatasetComponents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics OperationalDatasetComponents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33608,6 +36847,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsOperationalDatasetComponents : p reportHandler:^( MTRThreadNetworkDiagnosticsClusterOperationalDatasetComponents * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.OperationalDatasetComponents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33642,8 +36886,11 @@ class ReadThreadNetworkDiagnosticsActiveNetworkFaultsList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeActiveNetworkFaultsListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ActiveNetworkFaultsList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ActiveNetworkFaultsList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33688,6 +36935,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsActiveNetworkFaultsList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ActiveNetworkFaultsList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33722,8 +36974,11 @@ class ReadThreadNetworkDiagnosticsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33767,6 +37022,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsGeneratedCommandList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33801,8 +37061,11 @@ class ReadThreadNetworkDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33846,6 +37109,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsAcceptedCommandList : public Sub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33881,8 +37149,11 @@ class ReadThreadNetworkDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -33926,6 +37197,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsEventList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -33961,8 +37237,11 @@ class ReadThreadNetworkDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34006,6 +37285,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsAttributeList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34039,8 +37323,11 @@ class ReadThreadNetworkDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34084,6 +37371,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsFeatureMap : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34117,8 +37409,11 @@ class ReadThreadNetworkDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThreadNetworkDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34162,6 +37457,11 @@ class SubscribeAttributeThreadNetworkDiagnosticsClusterRevision : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThreadNetworkDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34231,17 +37531,19 @@ class WiFiNetworkDiagnosticsResetCounts : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster resetCountsWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + resetCountsWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -34275,8 +37577,11 @@ class ReadWiFiNetworkDiagnosticsBssid : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBSSIDWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BSSID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics BSSID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34320,6 +37625,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsBssid : public SubscribeAttribute } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BSSID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34353,8 +37663,11 @@ class ReadWiFiNetworkDiagnosticsSecurityType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSecurityTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.SecurityType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics SecurityType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34398,6 +37711,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsSecurityType : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.SecurityType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34431,8 +37749,11 @@ class ReadWiFiNetworkDiagnosticsWiFiVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWiFiVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.WiFiVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics WiFiVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34476,6 +37797,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsWiFiVersion : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.WiFiVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34509,8 +37835,11 @@ class ReadWiFiNetworkDiagnosticsChannelNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChannelNumberWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.ChannelNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics ChannelNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34554,6 +37883,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsChannelNumber : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.ChannelNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34587,8 +37921,11 @@ class ReadWiFiNetworkDiagnosticsRssi : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRSSIWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.RSSI response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics RSSI read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34632,6 +37969,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsRssi : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.RSSI response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34665,8 +38007,11 @@ class ReadWiFiNetworkDiagnosticsBeaconLostCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBeaconLostCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BeaconLostCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics BeaconLostCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34710,6 +38055,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsBeaconLostCount : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BeaconLostCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34743,8 +38093,11 @@ class ReadWiFiNetworkDiagnosticsBeaconRxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBeaconRxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BeaconRxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics BeaconRxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34788,6 +38141,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsBeaconRxCount : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.BeaconRxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34822,8 +38180,11 @@ class ReadWiFiNetworkDiagnosticsPacketMulticastRxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketMulticastRxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketMulticastRxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics PacketMulticastRxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34867,6 +38228,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsPacketMulticastRxCount : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketMulticastRxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34901,8 +38267,11 @@ class ReadWiFiNetworkDiagnosticsPacketMulticastTxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketMulticastTxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketMulticastTxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics PacketMulticastTxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -34946,6 +38315,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsPacketMulticastTxCount : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketMulticastTxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -34979,8 +38353,11 @@ class ReadWiFiNetworkDiagnosticsPacketUnicastRxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketUnicastRxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketUnicastRxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics PacketUnicastRxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35024,6 +38401,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsPacketUnicastRxCount : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketUnicastRxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35057,8 +38439,11 @@ class ReadWiFiNetworkDiagnosticsPacketUnicastTxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketUnicastTxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketUnicastTxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics PacketUnicastTxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35102,6 +38487,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsPacketUnicastTxCount : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.PacketUnicastTxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35135,8 +38525,11 @@ class ReadWiFiNetworkDiagnosticsCurrentMaxRate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentMaxRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.CurrentMaxRate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics CurrentMaxRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35180,6 +38573,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsCurrentMaxRate : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.CurrentMaxRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35213,8 +38611,11 @@ class ReadWiFiNetworkDiagnosticsOverrunCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOverrunCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.OverrunCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics OverrunCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35258,6 +38659,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsOverrunCount : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.OverrunCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35291,8 +38697,11 @@ class ReadWiFiNetworkDiagnosticsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35336,6 +38745,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35369,8 +38783,11 @@ class ReadWiFiNetworkDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35414,6 +38831,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35449,8 +38871,11 @@ class ReadWiFiNetworkDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35494,6 +38919,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35529,8 +38959,11 @@ class ReadWiFiNetworkDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35574,6 +39007,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35607,8 +39045,11 @@ class ReadWiFiNetworkDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35652,6 +39093,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35685,8 +39131,11 @@ class ReadWiFiNetworkDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WiFiNetworkDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35730,6 +39179,11 @@ class SubscribeAttributeWiFiNetworkDiagnosticsClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WiFiNetworkDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35792,17 +39246,19 @@ class EthernetNetworkDiagnosticsResetCounts : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster resetCountsWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + resetCountsWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -35836,8 +39292,11 @@ class ReadEthernetNetworkDiagnosticsPHYRate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePHYRateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PHYRate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics PHYRate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35881,6 +39340,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsPHYRate : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PHYRate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35914,8 +39378,11 @@ class ReadEthernetNetworkDiagnosticsFullDuplex : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFullDuplexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.FullDuplex response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics FullDuplex read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -35959,6 +39426,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsFullDuplex : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.FullDuplex response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -35992,8 +39464,11 @@ class ReadEthernetNetworkDiagnosticsPacketRxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketRxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PacketRxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics PacketRxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36037,6 +39512,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsPacketRxCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PacketRxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36070,8 +39550,11 @@ class ReadEthernetNetworkDiagnosticsPacketTxCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePacketTxCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PacketTxCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics PacketTxCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36115,6 +39598,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsPacketTxCount : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.PacketTxCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36148,8 +39636,11 @@ class ReadEthernetNetworkDiagnosticsTxErrCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTxErrCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.TxErrCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics TxErrCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36193,6 +39684,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsTxErrCount : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.TxErrCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36226,8 +39722,11 @@ class ReadEthernetNetworkDiagnosticsCollisionCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCollisionCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.CollisionCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics CollisionCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36271,6 +39770,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsCollisionCount : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.CollisionCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36304,8 +39808,11 @@ class ReadEthernetNetworkDiagnosticsOverrunCount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOverrunCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.OverrunCount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics OverrunCount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36349,6 +39856,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsOverrunCount : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.OverrunCount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36382,8 +39894,11 @@ class ReadEthernetNetworkDiagnosticsCarrierDetect : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCarrierDetectWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.CarrierDetect response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics CarrierDetect read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36427,6 +39942,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsCarrierDetect : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.CarrierDetect response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36460,8 +39980,11 @@ class ReadEthernetNetworkDiagnosticsTimeSinceReset : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeSinceResetWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.TimeSinceReset response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics TimeSinceReset read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36505,6 +40028,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsTimeSinceReset : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.TimeSinceReset response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36539,8 +40067,11 @@ class ReadEthernetNetworkDiagnosticsGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36585,6 +40116,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36619,8 +40155,11 @@ class ReadEthernetNetworkDiagnosticsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36665,6 +40204,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsAcceptedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36700,8 +40244,11 @@ class ReadEthernetNetworkDiagnosticsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36745,6 +40292,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsEventList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36780,8 +40332,11 @@ class ReadEthernetNetworkDiagnosticsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36825,6 +40380,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsAttributeList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36858,8 +40418,11 @@ class ReadEthernetNetworkDiagnosticsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36903,6 +40466,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsFeatureMap : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -36936,8 +40504,11 @@ class ReadEthernetNetworkDiagnosticsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("EthernetNetworkDiagnostics ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -36981,6 +40552,11 @@ class SubscribeAttributeEthernetNetworkDiagnosticsClusterRevision : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"EthernetNetworkDiagnostics.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37068,17 +40644,19 @@ class TimeSynchronizationSetUTCTime : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setUTCTimeWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setUTCTimeWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -37133,6 +40711,8 @@ class TimeSynchronizationSetTrustedTimeSource : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -37200,19 +40780,28 @@ class TimeSynchronizationSetTimeZone : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setTimeZoneWithParams:params - completion:^(MTRTimeSynchronizationClusterSetTimeZoneResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setTimeZoneWithParams:params + completion:^(MTRTimeSynchronizationClusterSetTimeZoneResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::TimeSynchronization::Commands::SetTimeZoneResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -37272,17 +40861,19 @@ class TimeSynchronizationSetDSTOffset : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setDSTOffsetWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setDSTOffsetWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -37332,17 +40923,19 @@ class TimeSynchronizationSetDefaultNTP : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setDefaultNTPWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setDefaultNTPWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -37381,8 +40974,11 @@ class ReadTimeSynchronizationUTCTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUTCTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.UTCTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization UTCTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37426,6 +41022,11 @@ class SubscribeAttributeTimeSynchronizationUTCTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.UTCTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37462,8 +41063,11 @@ class ReadTimeSynchronizationGranularity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGranularityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.Granularity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization Granularity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37507,6 +41111,11 @@ class SubscribeAttributeTimeSynchronizationGranularity : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.Granularity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37543,8 +41152,11 @@ class ReadTimeSynchronizationTimeSource : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeSourceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeSource response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TimeSource read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37588,6 +41200,11 @@ class SubscribeAttributeTimeSynchronizationTimeSource : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeSource response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37625,8 +41242,11 @@ class ReadTimeSynchronizationTrustedTimeSource : public ReadAttribute { [cluster readAttributeTrustedTimeSourceWithCompletion:^( MTRTimeSynchronizationClusterTrustedTimeSourceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TrustedTimeSource response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TrustedTimeSource read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37670,6 +41290,11 @@ class SubscribeAttributeTimeSynchronizationTrustedTimeSource : public SubscribeA } reportHandler:^(MTRTimeSynchronizationClusterTrustedTimeSourceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TrustedTimeSource response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37706,8 +41331,11 @@ class ReadTimeSynchronizationDefaultNTP : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDefaultNTPWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DefaultNTP response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization DefaultNTP read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37751,6 +41379,11 @@ class SubscribeAttributeTimeSynchronizationDefaultNTP : public SubscribeAttribut } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DefaultNTP response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37787,8 +41420,11 @@ class ReadTimeSynchronizationTimeZone : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeZoneWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZone response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TimeZone read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37832,6 +41468,11 @@ class SubscribeAttributeTimeSynchronizationTimeZone : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZone response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37868,8 +41509,11 @@ class ReadTimeSynchronizationDSTOffset : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDSTOffsetWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DSTOffset response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization DSTOffset read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37913,6 +41557,11 @@ class SubscribeAttributeTimeSynchronizationDSTOffset : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DSTOffset response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -37949,8 +41598,11 @@ class ReadTimeSynchronizationLocalTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocalTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.LocalTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization LocalTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -37994,6 +41646,11 @@ class SubscribeAttributeTimeSynchronizationLocalTime : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.LocalTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38030,8 +41687,11 @@ class ReadTimeSynchronizationTimeZoneDatabase : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeZoneDatabaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZoneDatabase response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TimeZoneDatabase read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38075,6 +41735,11 @@ class SubscribeAttributeTimeSynchronizationTimeZoneDatabase : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZoneDatabase response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38111,8 +41776,11 @@ class ReadTimeSynchronizationNTPServerAvailable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNTPServerAvailableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.NTPServerAvailable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization NTPServerAvailable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38156,6 +41824,11 @@ class SubscribeAttributeTimeSynchronizationNTPServerAvailable : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.NTPServerAvailable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38192,8 +41865,11 @@ class ReadTimeSynchronizationTimeZoneListMaxSize : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimeZoneListMaxSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZoneListMaxSize response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization TimeZoneListMaxSize read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38237,6 +41913,11 @@ class SubscribeAttributeTimeSynchronizationTimeZoneListMaxSize : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.TimeZoneListMaxSize response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38273,8 +41954,11 @@ class ReadTimeSynchronizationDSTOffsetListMaxSize : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDSTOffsetListMaxSizeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DSTOffsetListMaxSize response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization DSTOffsetListMaxSize read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38318,6 +42002,11 @@ class SubscribeAttributeTimeSynchronizationDSTOffsetListMaxSize : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.DSTOffsetListMaxSize response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38354,8 +42043,11 @@ class ReadTimeSynchronizationSupportsDNSResolve : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportsDNSResolveWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.SupportsDNSResolve response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization SupportsDNSResolve read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38399,6 +42091,11 @@ class SubscribeAttributeTimeSynchronizationSupportsDNSResolve : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.SupportsDNSResolve response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38435,8 +42132,11 @@ class ReadTimeSynchronizationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38480,6 +42180,11 @@ class SubscribeAttributeTimeSynchronizationGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38516,8 +42221,11 @@ class ReadTimeSynchronizationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38561,6 +42269,11 @@ class SubscribeAttributeTimeSynchronizationAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38597,8 +42310,11 @@ class ReadTimeSynchronizationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38642,6 +42358,11 @@ class SubscribeAttributeTimeSynchronizationEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38678,8 +42399,11 @@ class ReadTimeSynchronizationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38723,6 +42447,11 @@ class SubscribeAttributeTimeSynchronizationAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38759,8 +42488,11 @@ class ReadTimeSynchronizationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38804,6 +42536,11 @@ class SubscribeAttributeTimeSynchronizationFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38840,8 +42577,11 @@ class ReadTimeSynchronizationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TimeSynchronization ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -38885,6 +42625,11 @@ class SubscribeAttributeTimeSynchronizationClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TimeSynchronization.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -38956,8 +42701,11 @@ class ReadBridgedDeviceBasicInformationVendorName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.VendorName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation VendorName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39001,6 +42749,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationVendorName : public Subscri } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.VendorName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39034,8 +42787,11 @@ class ReadBridgedDeviceBasicInformationVendorID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.VendorID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation VendorID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39079,6 +42835,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationVendorID : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.VendorID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39112,8 +42873,11 @@ class ReadBridgedDeviceBasicInformationProductName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ProductName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39157,6 +42921,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationProductName : public Subscr } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39190,8 +42959,11 @@ class ReadBridgedDeviceBasicInformationNodeLabel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNodeLabelWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.NodeLabel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation NodeLabel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39235,6 +43007,8 @@ class WriteBridgedDeviceBasicInformationNodeLabel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BridgedDeviceBasicInformation NodeLabel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39281,6 +43055,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationNodeLabel : public Subscrib } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.NodeLabel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39315,8 +43094,11 @@ class ReadBridgedDeviceBasicInformationHardwareVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHardwareVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.HardwareVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation HardwareVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39360,6 +43142,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationHardwareVersion : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.HardwareVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39394,8 +43181,11 @@ class ReadBridgedDeviceBasicInformationHardwareVersionString : public ReadAttrib queue:callbackQueue]; [cluster readAttributeHardwareVersionStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.HardwareVersionString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation HardwareVersionString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39440,6 +43230,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationHardwareVersionString : pub } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.HardwareVersionString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39474,8 +43269,11 @@ class ReadBridgedDeviceBasicInformationSoftwareVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSoftwareVersionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SoftwareVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation SoftwareVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39519,6 +43317,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationSoftwareVersion : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SoftwareVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39553,8 +43356,11 @@ class ReadBridgedDeviceBasicInformationSoftwareVersionString : public ReadAttrib queue:callbackQueue]; [cluster readAttributeSoftwareVersionStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SoftwareVersionString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation SoftwareVersionString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39599,6 +43405,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationSoftwareVersionString : pub } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SoftwareVersionString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39633,8 +43444,11 @@ class ReadBridgedDeviceBasicInformationManufacturingDate : public ReadAttribute queue:callbackQueue]; [cluster readAttributeManufacturingDateWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ManufacturingDate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ManufacturingDate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39679,6 +43493,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationManufacturingDate : public } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ManufacturingDate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39712,8 +43531,11 @@ class ReadBridgedDeviceBasicInformationPartNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePartNumberWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.PartNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation PartNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39757,6 +43579,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationPartNumber : public Subscri } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.PartNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39790,8 +43617,11 @@ class ReadBridgedDeviceBasicInformationProductURL : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductURLWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductURL response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ProductURL read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39835,6 +43665,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationProductURL : public Subscri } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductURL response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39868,8 +43703,11 @@ class ReadBridgedDeviceBasicInformationProductLabel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductLabelWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductLabel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ProductLabel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39913,6 +43751,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationProductLabel : public Subsc } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductLabel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -39946,8 +43789,11 @@ class ReadBridgedDeviceBasicInformationSerialNumber : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSerialNumberWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SerialNumber response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation SerialNumber read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -39991,6 +43837,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationSerialNumber : public Subsc } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.SerialNumber response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40024,8 +43875,11 @@ class ReadBridgedDeviceBasicInformationReachable : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReachableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.Reachable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation Reachable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40069,6 +43923,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationReachable : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.Reachable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40102,8 +43961,11 @@ class ReadBridgedDeviceBasicInformationUniqueID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUniqueIDWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.UniqueID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation UniqueID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40147,6 +44009,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationUniqueID : public Subscribe } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.UniqueID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40182,8 +44049,11 @@ class ReadBridgedDeviceBasicInformationProductAppearance : public ReadAttribute [cluster readAttributeProductAppearanceWithCompletion:^( MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductAppearance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ProductAppearance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40229,6 +44099,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationProductAppearance : public reportHandler:^( MTRBridgedDeviceBasicInformationClusterProductAppearanceStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ProductAppearance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40263,8 +44138,11 @@ class ReadBridgedDeviceBasicInformationGeneratedCommandList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40309,6 +44187,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationGeneratedCommandList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40343,8 +44226,11 @@ class ReadBridgedDeviceBasicInformationAcceptedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40389,6 +44275,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationAcceptedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40424,8 +44315,11 @@ class ReadBridgedDeviceBasicInformationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40469,6 +44363,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationEventList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40504,8 +44403,11 @@ class ReadBridgedDeviceBasicInformationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40549,6 +44451,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationAttributeList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40582,8 +44489,11 @@ class ReadBridgedDeviceBasicInformationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40627,6 +44537,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationFeatureMap : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40661,8 +44576,11 @@ class ReadBridgedDeviceBasicInformationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BridgedDeviceBasicInformation ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40706,6 +44624,11 @@ class SubscribeAttributeBridgedDeviceBasicInformationClusterRevision : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BridgedDeviceBasicInformation.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40763,8 +44686,11 @@ class ReadSwitchNumberOfPositions : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNumberOfPositionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.NumberOfPositions response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch NumberOfPositions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40806,6 +44732,11 @@ class SubscribeAttributeSwitchNumberOfPositions : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.NumberOfPositions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40837,8 +44768,11 @@ class ReadSwitchCurrentPosition : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCurrentPositionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.CurrentPosition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch CurrentPosition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40880,6 +44814,11 @@ class SubscribeAttributeSwitchCurrentPosition : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.CurrentPosition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40911,8 +44850,11 @@ class ReadSwitchMultiPressMax : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMultiPressMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.MultiPressMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch MultiPressMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -40954,6 +44896,11 @@ class SubscribeAttributeSwitchMultiPressMax : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.MultiPressMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -40985,8 +44932,11 @@ class ReadSwitchGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41028,6 +44978,11 @@ class SubscribeAttributeSwitchGeneratedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41059,8 +45014,11 @@ class ReadSwitchAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41102,6 +45060,11 @@ class SubscribeAttributeSwitchAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41135,8 +45098,11 @@ class ReadSwitchEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41178,6 +45144,11 @@ class SubscribeAttributeSwitchEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41211,8 +45182,11 @@ class ReadSwitchAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41254,6 +45228,11 @@ class SubscribeAttributeSwitchAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41285,8 +45264,11 @@ class ReadSwitchFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41328,6 +45310,11 @@ class SubscribeAttributeSwitchFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41359,8 +45346,11 @@ class ReadSwitchClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterSwitch alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Switch ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41402,6 +45392,11 @@ class SubscribeAttributeSwitchClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Switch.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41478,6 +45473,8 @@ class AdministratorCommissioningOpenCommissioningWindow : public ClusterCommand if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -41529,6 +45526,8 @@ class AdministratorCommissioningOpenBasicCommissioningWindow : public ClusterCom if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -41577,6 +45576,8 @@ class AdministratorCommissioningRevokeCommissioning : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -41615,8 +45616,11 @@ class ReadAdministratorCommissioningWindowStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWindowStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.WindowStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning WindowStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41660,6 +45664,11 @@ class SubscribeAttributeAdministratorCommissioningWindowStatus : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.WindowStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41693,8 +45702,11 @@ class ReadAdministratorCommissioningAdminFabricIndex : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAdminFabricIndexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AdminFabricIndex response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning AdminFabricIndex read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41738,6 +45750,11 @@ class SubscribeAttributeAdministratorCommissioningAdminFabricIndex : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AdminFabricIndex response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41771,8 +45788,11 @@ class ReadAdministratorCommissioningAdminVendorId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAdminVendorIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AdminVendorId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning AdminVendorId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41816,6 +45836,11 @@ class SubscribeAttributeAdministratorCommissioningAdminVendorId : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AdminVendorId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41850,8 +45875,11 @@ class ReadAdministratorCommissioningGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41896,6 +45924,11 @@ class SubscribeAttributeAdministratorCommissioningGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -41930,8 +45963,11 @@ class ReadAdministratorCommissioningAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -41976,6 +46012,11 @@ class SubscribeAttributeAdministratorCommissioningAcceptedCommandList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42011,8 +46052,11 @@ class ReadAdministratorCommissioningEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42056,6 +46100,11 @@ class SubscribeAttributeAdministratorCommissioningEventList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42091,8 +46140,11 @@ class ReadAdministratorCommissioningAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42136,6 +46188,11 @@ class SubscribeAttributeAdministratorCommissioningAttributeList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42169,8 +46226,11 @@ class ReadAdministratorCommissioningFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42214,6 +46274,11 @@ class SubscribeAttributeAdministratorCommissioningFeatureMap : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42247,8 +46312,11 @@ class ReadAdministratorCommissioningClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AdministratorCommissioning ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42292,6 +46360,11 @@ class SubscribeAttributeAdministratorCommissioningClusterRevision : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AdministratorCommissioning.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42364,10 +46437,20 @@ class OperationalCredentialsAttestationRequest : public ClusterCommand { completion:^(MTROperationalCredentialsClusterAttestationResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::AttestationResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42417,10 +46500,20 @@ class OperationalCredentialsCertificateChainRequest : public ClusterCommand { MTROperationalCredentialsClusterCertificateChainResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters:: + OperationalCredentials::Commands::CertificateChainResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters:: + OperationalCredentials::Commands::CertificateChainResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42471,19 +46564,28 @@ class OperationalCredentialsCSRRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster CSRRequestWithParams:params - completion:^(MTROperationalCredentialsClusterCSRResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + CSRRequestWithParams:params + completion:^( + MTROperationalCredentialsClusterCSRResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::CSRResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -42539,10 +46641,18 @@ class OperationalCredentialsAddNOC : public ClusterCommand { completion:^( MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42593,19 +46703,28 @@ class OperationalCredentialsUpdateNOC : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster updateNOCWithParams:params - completion:^( - MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + updateNOCWithParams:params + completion:^( + MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -42651,10 +46770,20 @@ class OperationalCredentialsUpdateFabricLabel : public ClusterCommand { completion:^(MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42699,19 +46828,28 @@ class OperationalCredentialsRemoveFabric : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster removeFabricWithParams:params - completion:^(MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + removeFabricWithParams:params + completion:^( + MTROperationalCredentialsClusterNOCResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalCredentials::Commands::NOCResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -42758,6 +46896,8 @@ class OperationalCredentialsAddTrustedRootCertificate : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -42799,14 +46939,19 @@ class ReadOperationalCredentialsNOCs : public ReadAttribute { if (mFabricFiltered.HasValue()) { params.filterByFabric = mFabricFiltered.Value(); } - [cluster readAttributeNOCsWithParams:params - completion:^(NSArray * _Nullable value, NSError * _Nullable error) { - NSLog(@"OperationalCredentials.NOCs response %@", [value description]); - if (error != nil) { - LogNSError("OperationalCredentials NOCs read Error", error); - } - SetCommandExitStatus(error); - }]; + [cluster + readAttributeNOCsWithParams:params + completion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"OperationalCredentials.NOCs response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("OperationalCredentials NOCs read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; return CHIP_NO_ERROR; } }; @@ -42847,6 +46992,11 @@ class SubscribeAttributeOperationalCredentialsNOCs : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.NOCs response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42885,8 +47035,13 @@ class ReadOperationalCredentialsFabrics : public ReadAttribute { [cluster readAttributeFabricsWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.Fabrics response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials Fabrics read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -42930,6 +47085,11 @@ class SubscribeAttributeOperationalCredentialsFabrics : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.Fabrics response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -42963,8 +47123,11 @@ class ReadOperationalCredentialsSupportedFabrics : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedFabricsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.SupportedFabrics response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials SupportedFabrics read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43008,6 +47171,11 @@ class SubscribeAttributeOperationalCredentialsSupportedFabrics : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.SupportedFabrics response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43041,8 +47209,11 @@ class ReadOperationalCredentialsCommissionedFabrics : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCommissionedFabricsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.CommissionedFabrics response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials CommissionedFabrics read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43086,6 +47257,11 @@ class SubscribeAttributeOperationalCredentialsCommissionedFabrics : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.CommissionedFabrics response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43120,8 +47296,11 @@ class ReadOperationalCredentialsTrustedRootCertificates : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTrustedRootCertificatesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.TrustedRootCertificates response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials TrustedRootCertificates read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43166,6 +47345,11 @@ class SubscribeAttributeOperationalCredentialsTrustedRootCertificates : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.TrustedRootCertificates response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43199,8 +47383,11 @@ class ReadOperationalCredentialsCurrentFabricIndex : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentFabricIndexWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.CurrentFabricIndex response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials CurrentFabricIndex read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43244,6 +47431,11 @@ class SubscribeAttributeOperationalCredentialsCurrentFabricIndex : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.CurrentFabricIndex response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43277,8 +47469,11 @@ class ReadOperationalCredentialsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43322,6 +47517,11 @@ class SubscribeAttributeOperationalCredentialsGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43355,8 +47555,11 @@ class ReadOperationalCredentialsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43400,6 +47603,11 @@ class SubscribeAttributeOperationalCredentialsAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43435,8 +47643,11 @@ class ReadOperationalCredentialsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43480,6 +47691,11 @@ class SubscribeAttributeOperationalCredentialsEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43515,8 +47731,11 @@ class ReadOperationalCredentialsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43560,6 +47779,11 @@ class SubscribeAttributeOperationalCredentialsAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43593,8 +47817,11 @@ class ReadOperationalCredentialsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43638,6 +47865,11 @@ class SubscribeAttributeOperationalCredentialsFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43671,8 +47903,11 @@ class ReadOperationalCredentialsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalCredentials ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -43716,6 +47951,11 @@ class SubscribeAttributeOperationalCredentialsClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalCredentials.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -43815,17 +48055,19 @@ class GroupKeyManagementKeySetWrite : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster keySetWriteWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + keySetWriteWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -43866,19 +48108,28 @@ class GroupKeyManagementKeySetRead : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster keySetReadWithParams:params - completion:^(MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + keySetReadWithParams:params + completion:^( + MTRGroupKeyManagementClusterKeySetReadResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::GroupKeyManagement::Commands::KeySetReadResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -43918,17 +48169,19 @@ class GroupKeyManagementKeySetRemove : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster keySetRemoveWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + keySetRemoveWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -43971,10 +48224,20 @@ class GroupKeyManagementKeySetReadAllIndices : public ClusterCommand { completion:^(MTRGroupKeyManagementClusterKeySetReadAllIndicesResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::GroupKeyManagement:: + Commands::KeySetReadAllIndicesResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::GroupKeyManagement:: + Commands::KeySetReadAllIndicesResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -44018,8 +48281,13 @@ class ReadGroupKeyManagementGroupKeyMap : public ReadAttribute { [cluster readAttributeGroupKeyMapWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GroupKeyMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement GroupKeyMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44074,6 +48342,8 @@ class WriteGroupKeyManagementGroupKeyMap : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("GroupKeyManagement GroupKeyMap write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44123,6 +48393,11 @@ class SubscribeAttributeGroupKeyManagementGroupKeyMap : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GroupKeyMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44161,8 +48436,13 @@ class ReadGroupKeyManagementGroupTable : public ReadAttribute { [cluster readAttributeGroupTableWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GroupTable response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement GroupTable read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44206,6 +48486,11 @@ class SubscribeAttributeGroupKeyManagementGroupTable : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GroupTable response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44239,8 +48524,11 @@ class ReadGroupKeyManagementMaxGroupsPerFabric : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxGroupsPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.MaxGroupsPerFabric response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement MaxGroupsPerFabric read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44284,6 +48572,11 @@ class SubscribeAttributeGroupKeyManagementMaxGroupsPerFabric : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.MaxGroupsPerFabric response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44317,8 +48610,11 @@ class ReadGroupKeyManagementMaxGroupKeysPerFabric : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxGroupKeysPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.MaxGroupKeysPerFabric response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement MaxGroupKeysPerFabric read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44362,6 +48658,11 @@ class SubscribeAttributeGroupKeyManagementMaxGroupKeysPerFabric : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.MaxGroupKeysPerFabric response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44395,8 +48696,11 @@ class ReadGroupKeyManagementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44440,6 +48744,11 @@ class SubscribeAttributeGroupKeyManagementGeneratedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44473,8 +48782,11 @@ class ReadGroupKeyManagementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44518,6 +48830,11 @@ class SubscribeAttributeGroupKeyManagementAcceptedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44553,8 +48870,11 @@ class ReadGroupKeyManagementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44598,6 +48918,11 @@ class SubscribeAttributeGroupKeyManagementEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44633,8 +48958,11 @@ class ReadGroupKeyManagementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44678,6 +49006,11 @@ class SubscribeAttributeGroupKeyManagementAttributeList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44711,8 +49044,11 @@ class ReadGroupKeyManagementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44756,6 +49092,11 @@ class SubscribeAttributeGroupKeyManagementFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44789,8 +49130,11 @@ class ReadGroupKeyManagementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("GroupKeyManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44834,6 +49178,11 @@ class SubscribeAttributeGroupKeyManagementClusterRevision : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"GroupKeyManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44884,8 +49233,11 @@ class ReadFixedLabelLabelList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLabelListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.LabelList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel LabelList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -44929,6 +49281,11 @@ class SubscribeAttributeFixedLabelLabelList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.LabelList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -44962,8 +49319,11 @@ class ReadFixedLabelGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45007,6 +49367,11 @@ class SubscribeAttributeFixedLabelGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45040,8 +49405,11 @@ class ReadFixedLabelAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45085,6 +49453,11 @@ class SubscribeAttributeFixedLabelAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45120,8 +49493,11 @@ class ReadFixedLabelEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45165,6 +49541,11 @@ class SubscribeAttributeFixedLabelEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45200,8 +49581,11 @@ class ReadFixedLabelAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45245,6 +49629,11 @@ class SubscribeAttributeFixedLabelAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45278,8 +49667,11 @@ class ReadFixedLabelFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45323,6 +49715,11 @@ class SubscribeAttributeFixedLabelFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45356,8 +49753,11 @@ class ReadFixedLabelClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FixedLabel ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45401,6 +49801,11 @@ class SubscribeAttributeFixedLabelClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FixedLabel.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45451,8 +49856,11 @@ class ReadUserLabelLabelList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLabelListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.LabelList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel LabelList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45510,6 +49918,8 @@ class WriteUserLabelLabelList : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UserLabel LabelList write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45557,6 +49967,11 @@ class SubscribeAttributeUserLabelLabelList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.LabelList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45590,8 +50005,11 @@ class ReadUserLabelGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45635,6 +50053,11 @@ class SubscribeAttributeUserLabelGeneratedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45668,8 +50091,11 @@ class ReadUserLabelAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45713,6 +50139,11 @@ class SubscribeAttributeUserLabelAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45748,8 +50179,11 @@ class ReadUserLabelEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45793,6 +50227,11 @@ class SubscribeAttributeUserLabelEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45828,8 +50267,11 @@ class ReadUserLabelAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45873,6 +50315,11 @@ class SubscribeAttributeUserLabelAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45906,8 +50353,11 @@ class ReadUserLabelFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -45951,6 +50401,11 @@ class SubscribeAttributeUserLabelFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -45984,8 +50439,11 @@ class ReadUserLabelClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UserLabel ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46029,6 +50487,11 @@ class SubscribeAttributeUserLabelClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UserLabel.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46080,8 +50543,11 @@ class ReadBooleanStateStateValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStateValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.StateValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState StateValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46125,6 +50591,11 @@ class SubscribeAttributeBooleanStateStateValue : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.StateValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46158,8 +50629,11 @@ class ReadBooleanStateGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46203,6 +50677,11 @@ class SubscribeAttributeBooleanStateGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46236,8 +50715,11 @@ class ReadBooleanStateAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46281,6 +50763,11 @@ class SubscribeAttributeBooleanStateAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46316,8 +50803,11 @@ class ReadBooleanStateEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46361,6 +50851,11 @@ class SubscribeAttributeBooleanStateEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46396,8 +50891,11 @@ class ReadBooleanStateAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46441,6 +50939,11 @@ class SubscribeAttributeBooleanStateAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46474,8 +50977,11 @@ class ReadBooleanStateFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46519,6 +51025,11 @@ class SubscribeAttributeBooleanStateFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46552,8 +51063,11 @@ class ReadBooleanStateClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BooleanState ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46597,6 +51111,11 @@ class SubscribeAttributeBooleanStateClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BooleanState.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46673,19 +51192,29 @@ class IcdManagementRegisterClient : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster registerClientWithParams:params - completion:^(MTRICDManagementClusterRegisterClientResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + registerClientWithParams:params + completion:^(MTRICDManagementClusterRegisterClientResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::IcdManagement::Commands::RegisterClientResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -46740,6 +51269,8 @@ class IcdManagementUnregisterClient : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -46790,6 +51321,8 @@ class IcdManagementStayActiveRequest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -46832,8 +51365,11 @@ class ReadIcdManagementIdleModeInterval : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeIdleModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.IdleModeInterval response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement IdleModeInterval read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46877,6 +51413,11 @@ class SubscribeAttributeIcdManagementIdleModeInterval : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.IdleModeInterval response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46913,8 +51454,11 @@ class ReadIcdManagementActiveModeInterval : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveModeIntervalWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ActiveModeInterval response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ActiveModeInterval read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -46958,6 +51502,11 @@ class SubscribeAttributeIcdManagementActiveModeInterval : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ActiveModeInterval response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -46994,8 +51543,11 @@ class ReadIcdManagementActiveModeThreshold : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveModeThresholdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ActiveModeThreshold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ActiveModeThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47039,6 +51591,11 @@ class SubscribeAttributeIcdManagementActiveModeThreshold : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ActiveModeThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47080,8 +51637,13 @@ class ReadIcdManagementRegisteredClients : public ReadAttribute { [cluster readAttributeRegisteredClientsWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.RegisteredClients response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement RegisteredClients read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47125,6 +51687,11 @@ class SubscribeAttributeIcdManagementRegisteredClients : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.RegisteredClients response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47161,8 +51728,11 @@ class ReadIcdManagementICDCounter : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeICDCounterWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ICDCounter response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ICDCounter read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47206,6 +51776,11 @@ class SubscribeAttributeIcdManagementICDCounter : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ICDCounter response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47242,8 +51817,11 @@ class ReadIcdManagementClientsSupportedPerFabric : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClientsSupportedPerFabricWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ClientsSupportedPerFabric response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ClientsSupportedPerFabric read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47287,6 +51865,11 @@ class SubscribeAttributeIcdManagementClientsSupportedPerFabric : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ClientsSupportedPerFabric response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47323,8 +51906,11 @@ class ReadIcdManagementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47368,6 +51954,11 @@ class SubscribeAttributeIcdManagementGeneratedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47404,8 +51995,11 @@ class ReadIcdManagementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47449,6 +52043,11 @@ class SubscribeAttributeIcdManagementAcceptedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47485,8 +52084,11 @@ class ReadIcdManagementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47530,6 +52132,11 @@ class SubscribeAttributeIcdManagementEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47566,8 +52173,11 @@ class ReadIcdManagementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47611,6 +52221,11 @@ class SubscribeAttributeIcdManagementAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47647,8 +52262,11 @@ class ReadIcdManagementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47692,6 +52310,11 @@ class SubscribeAttributeIcdManagementFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47728,8 +52351,11 @@ class ReadIcdManagementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ICDManagement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47773,6 +52399,11 @@ class SubscribeAttributeIcdManagementClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ICDManagement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47836,17 +52467,19 @@ class ModeSelectChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -47881,8 +52514,11 @@ class ReadModeSelectDescription : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDescriptionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.Description response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect Description read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -47926,6 +52562,11 @@ class SubscribeAttributeModeSelectDescription : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.Description response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -47959,8 +52600,11 @@ class ReadModeSelectStandardNamespace : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStandardNamespaceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect StandardNamespace read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48004,6 +52648,11 @@ class SubscribeAttributeModeSelectStandardNamespace : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.StandardNamespace response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48037,8 +52686,11 @@ class ReadModeSelectSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48082,6 +52734,11 @@ class SubscribeAttributeModeSelectSupportedModes : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48115,8 +52772,11 @@ class ReadModeSelectCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48160,6 +52820,11 @@ class SubscribeAttributeModeSelectCurrentMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48193,8 +52858,11 @@ class ReadModeSelectStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48229,13 +52897,18 @@ class WriteModeSelectStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ModeSelect StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48243,7 +52916,7 @@ class WriteModeSelectStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeModeSelectStartUpMode : public SubscribeAttribute { @@ -48282,6 +52955,11 @@ class SubscribeAttributeModeSelectStartUpMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48315,8 +52993,11 @@ class ReadModeSelectOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48351,13 +53032,18 @@ class WriteModeSelectOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ModeSelect OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48365,7 +53051,7 @@ class WriteModeSelectOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeModeSelectOnMode : public SubscribeAttribute { @@ -48404,6 +53090,11 @@ class SubscribeAttributeModeSelectOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48437,8 +53128,11 @@ class ReadModeSelectGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48482,6 +53176,11 @@ class SubscribeAttributeModeSelectGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48515,8 +53214,11 @@ class ReadModeSelectAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48560,6 +53262,11 @@ class SubscribeAttributeModeSelectAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48595,8 +53302,11 @@ class ReadModeSelectEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48640,6 +53350,11 @@ class SubscribeAttributeModeSelectEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48675,8 +53390,11 @@ class ReadModeSelectAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48720,6 +53438,11 @@ class SubscribeAttributeModeSelectAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48753,8 +53476,11 @@ class ReadModeSelectFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48798,6 +53524,11 @@ class SubscribeAttributeModeSelectFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48831,8 +53562,11 @@ class ReadModeSelectClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ModeSelect ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -48876,6 +53610,11 @@ class SubscribeAttributeModeSelectClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ModeSelect.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -48937,19 +53676,28 @@ class LaundryWasherModeChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^(MTRLaundryWasherModeClusterChangeToModeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^(MTRLaundryWasherModeClusterChangeToModeResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::LaundryWasherMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -48988,8 +53736,11 @@ class ReadLaundryWasherModeSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49033,6 +53784,11 @@ class SubscribeAttributeLaundryWasherModeSupportedModes : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49069,8 +53825,11 @@ class ReadLaundryWasherModeCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49114,6 +53873,11 @@ class SubscribeAttributeLaundryWasherModeCurrentMode : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49150,8 +53914,11 @@ class ReadLaundryWasherModeStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49186,13 +53953,18 @@ class WriteLaundryWasherModeStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LaundryWasherMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49200,7 +53972,7 @@ class WriteLaundryWasherModeStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLaundryWasherModeStartUpMode : public SubscribeAttribute { @@ -49239,6 +54011,11 @@ class SubscribeAttributeLaundryWasherModeStartUpMode : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49275,8 +54052,11 @@ class ReadLaundryWasherModeOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49311,13 +54091,18 @@ class WriteLaundryWasherModeOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LaundryWasherMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49325,7 +54110,7 @@ class WriteLaundryWasherModeOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLaundryWasherModeOnMode : public SubscribeAttribute { @@ -49364,6 +54149,11 @@ class SubscribeAttributeLaundryWasherModeOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49400,8 +54190,11 @@ class ReadLaundryWasherModeGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49445,6 +54238,11 @@ class SubscribeAttributeLaundryWasherModeGeneratedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49481,8 +54279,11 @@ class ReadLaundryWasherModeAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49526,6 +54327,11 @@ class SubscribeAttributeLaundryWasherModeAcceptedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49562,8 +54368,11 @@ class ReadLaundryWasherModeEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49607,6 +54416,11 @@ class SubscribeAttributeLaundryWasherModeEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49643,8 +54457,11 @@ class ReadLaundryWasherModeAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49688,6 +54505,11 @@ class SubscribeAttributeLaundryWasherModeAttributeList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49724,8 +54546,11 @@ class ReadLaundryWasherModeFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49769,6 +54594,11 @@ class SubscribeAttributeLaundryWasherModeFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49805,8 +54635,11 @@ class ReadLaundryWasherModeClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -49850,6 +54683,11 @@ class SubscribeAttributeLaundryWasherModeClusterRevision : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -49921,10 +54759,18 @@ class RefrigeratorAndTemperatureControlledCabinetModeChangeToMode : public Clust MTRRefrigeratorAndTemperatureControlledCabinetModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters:: + RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters:: + RefrigeratorAndTemperatureControlledCabinetMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -49970,8 +54816,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeSupportedModes : public queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50017,6 +54866,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeSupported } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50055,8 +54909,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeCurrentMode : public Re queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50102,6 +54959,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeCurrentMo } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50140,8 +55002,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public Re queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50178,7 +55043,10 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public W params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value @@ -50187,6 +55055,8 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public W if (error != nil) { LogNSError( "RefrigeratorAndTemperatureControlledCabinetMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50194,7 +55064,7 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public W } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeStartUpMode : public SubscribeAttribute { @@ -50235,6 +55105,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeStartUpMo } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50273,8 +55148,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeOnMode : public ReadAtt queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50311,13 +55189,18 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeOnMode : public WriteA params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50325,7 +55208,7 @@ class WriteRefrigeratorAndTemperatureControlledCabinetModeOnMode : public WriteA } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeOnMode : public SubscribeAttribute { @@ -50366,6 +55249,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeOnMode : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50404,8 +55292,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeGeneratedCommandList : queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50451,6 +55342,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeGenerated } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50489,8 +55385,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeAcceptedCommandList : p queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50536,6 +55435,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeAcceptedC } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50574,8 +55478,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeEventList : public Read queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50621,6 +55528,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeEventList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50659,8 +55571,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeAttributeList : public queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50706,6 +55621,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50744,8 +55664,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeFeatureMap : public Rea queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50791,6 +55714,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeFeatureMa } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50829,8 +55757,11 @@ class ReadRefrigeratorAndTemperatureControlledCabinetModeClusterRevision : publi queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAndTemperatureControlledCabinetMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50876,6 +55807,11 @@ class SubscribeAttributeRefrigeratorAndTemperatureControlledCabinetModeClusterRe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAndTemperatureControlledCabinetMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -50934,8 +55870,11 @@ class ReadLaundryWasherControlsSpinSpeeds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpinSpeedsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SpinSpeeds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls SpinSpeeds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -50979,6 +55918,11 @@ class SubscribeAttributeLaundryWasherControlsSpinSpeeds : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SpinSpeeds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51015,8 +55959,11 @@ class ReadLaundryWasherControlsSpinSpeedCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpinSpeedCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SpinSpeedCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls SpinSpeedCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51051,13 +55998,18 @@ class WriteLaundryWasherControlsSpinSpeedCurrent : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeSpinSpeedCurrentWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LaundryWasherControls SpinSpeedCurrent write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51065,7 +56017,7 @@ class WriteLaundryWasherControlsSpinSpeedCurrent : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeLaundryWasherControlsSpinSpeedCurrent : public SubscribeAttribute { @@ -51104,6 +56056,11 @@ class SubscribeAttributeLaundryWasherControlsSpinSpeedCurrent : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SpinSpeedCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51140,8 +56097,11 @@ class ReadLaundryWasherControlsNumberOfRinses : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfRinsesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.NumberOfRinses response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls NumberOfRinses read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51183,6 +56143,8 @@ class WriteLaundryWasherControlsNumberOfRinses : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("LaundryWasherControls NumberOfRinses write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51229,6 +56191,11 @@ class SubscribeAttributeLaundryWasherControlsNumberOfRinses : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.NumberOfRinses response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51265,8 +56232,11 @@ class ReadLaundryWasherControlsSupportedRinses : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedRinsesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SupportedRinses response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls SupportedRinses read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51310,6 +56280,11 @@ class SubscribeAttributeLaundryWasherControlsSupportedRinses : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.SupportedRinses response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51346,8 +56321,11 @@ class ReadLaundryWasherControlsGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51391,6 +56369,11 @@ class SubscribeAttributeLaundryWasherControlsGeneratedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51427,8 +56410,11 @@ class ReadLaundryWasherControlsAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51472,6 +56458,11 @@ class SubscribeAttributeLaundryWasherControlsAcceptedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51508,8 +56499,11 @@ class ReadLaundryWasherControlsEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51553,6 +56547,11 @@ class SubscribeAttributeLaundryWasherControlsEventList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51589,8 +56588,11 @@ class ReadLaundryWasherControlsAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51634,6 +56636,11 @@ class SubscribeAttributeLaundryWasherControlsAttributeList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51670,8 +56677,11 @@ class ReadLaundryWasherControlsFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51715,6 +56725,11 @@ class SubscribeAttributeLaundryWasherControlsFeatureMap : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51751,8 +56766,11 @@ class ReadLaundryWasherControlsClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LaundryWasherControls ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51796,6 +56814,11 @@ class SubscribeAttributeLaundryWasherControlsClusterRevision : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LaundryWasherControls.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51859,19 +56882,28 @@ class RvcRunModeChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^( - MTRRVCRunModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^( + MTRRVCRunModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcRunMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -51910,8 +56942,11 @@ class ReadRvcRunModeSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -51955,6 +56990,11 @@ class SubscribeAttributeRvcRunModeSupportedModes : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -51991,8 +57031,11 @@ class ReadRvcRunModeCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52036,6 +57079,11 @@ class SubscribeAttributeRvcRunModeCurrentMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52072,8 +57120,11 @@ class ReadRvcRunModeStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52108,13 +57159,18 @@ class WriteRvcRunModeStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RVCRunMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52122,7 +57178,7 @@ class WriteRvcRunModeStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRvcRunModeStartUpMode : public SubscribeAttribute { @@ -52161,6 +57217,11 @@ class SubscribeAttributeRvcRunModeStartUpMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52197,8 +57258,11 @@ class ReadRvcRunModeOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52233,13 +57297,18 @@ class WriteRvcRunModeOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RVCRunMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52247,7 +57316,7 @@ class WriteRvcRunModeOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRvcRunModeOnMode : public SubscribeAttribute { @@ -52286,6 +57355,11 @@ class SubscribeAttributeRvcRunModeOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52322,8 +57396,11 @@ class ReadRvcRunModeGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52367,6 +57444,11 @@ class SubscribeAttributeRvcRunModeGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52403,8 +57485,11 @@ class ReadRvcRunModeAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52448,6 +57533,11 @@ class SubscribeAttributeRvcRunModeAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52484,8 +57574,11 @@ class ReadRvcRunModeEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52529,6 +57622,11 @@ class SubscribeAttributeRvcRunModeEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52565,8 +57663,11 @@ class ReadRvcRunModeAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52610,6 +57711,11 @@ class SubscribeAttributeRvcRunModeAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52646,8 +57752,11 @@ class ReadRvcRunModeFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52691,6 +57800,11 @@ class SubscribeAttributeRvcRunModeFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52727,8 +57841,11 @@ class ReadRvcRunModeClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCRunMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52772,6 +57889,11 @@ class SubscribeAttributeRvcRunModeClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCRunMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52835,19 +57957,28 @@ class RvcCleanModeChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^(MTRRVCCleanModeClusterChangeToModeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^( + MTRRVCCleanModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcCleanMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -52886,8 +58017,11 @@ class ReadRvcCleanModeSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -52931,6 +58065,11 @@ class SubscribeAttributeRvcCleanModeSupportedModes : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -52967,8 +58106,11 @@ class ReadRvcCleanModeCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53012,6 +58154,11 @@ class SubscribeAttributeRvcCleanModeCurrentMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53048,8 +58195,11 @@ class ReadRvcCleanModeStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53084,13 +58234,18 @@ class WriteRvcCleanModeStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RVCCleanMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53098,7 +58253,7 @@ class WriteRvcCleanModeStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRvcCleanModeStartUpMode : public SubscribeAttribute { @@ -53137,6 +58292,11 @@ class SubscribeAttributeRvcCleanModeStartUpMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53173,8 +58333,11 @@ class ReadRvcCleanModeOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53209,13 +58372,18 @@ class WriteRvcCleanModeOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("RVCCleanMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53223,7 +58391,7 @@ class WriteRvcCleanModeOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeRvcCleanModeOnMode : public SubscribeAttribute { @@ -53262,6 +58430,11 @@ class SubscribeAttributeRvcCleanModeOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53298,8 +58471,11 @@ class ReadRvcCleanModeGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53343,6 +58519,11 @@ class SubscribeAttributeRvcCleanModeGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53379,8 +58560,11 @@ class ReadRvcCleanModeAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53424,6 +58608,11 @@ class SubscribeAttributeRvcCleanModeAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53460,8 +58649,11 @@ class ReadRvcCleanModeEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53505,6 +58697,11 @@ class SubscribeAttributeRvcCleanModeEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53541,8 +58738,11 @@ class ReadRvcCleanModeAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53586,6 +58786,11 @@ class SubscribeAttributeRvcCleanModeAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53622,8 +58827,11 @@ class ReadRvcCleanModeFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53667,6 +58875,11 @@ class SubscribeAttributeRvcCleanModeFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53703,8 +58916,11 @@ class ReadRvcCleanModeClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCCleanMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53748,6 +58964,11 @@ class SubscribeAttributeRvcCleanModeClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCCleanMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53829,6 +59050,8 @@ class TemperatureControlSetTemperature : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -53872,8 +59095,11 @@ class ReadTemperatureControlTemperatureSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTemperatureSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.TemperatureSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl TemperatureSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53917,6 +59143,11 @@ class SubscribeAttributeTemperatureControlTemperatureSetpoint : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.TemperatureSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -53953,8 +59184,11 @@ class ReadTemperatureControlMinTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.MinTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl MinTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -53998,6 +59232,11 @@ class SubscribeAttributeTemperatureControlMinTemperature : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.MinTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54034,8 +59273,11 @@ class ReadTemperatureControlMaxTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.MaxTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl MaxTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54079,6 +59321,11 @@ class SubscribeAttributeTemperatureControlMaxTemperature : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.MaxTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54115,8 +59362,11 @@ class ReadTemperatureControlStep : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStepWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.Step response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl Step read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54160,6 +59410,11 @@ class SubscribeAttributeTemperatureControlStep : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.Step response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54196,8 +59451,11 @@ class ReadTemperatureControlSelectedTemperatureLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSelectedTemperatureLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.SelectedTemperatureLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl SelectedTemperatureLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54241,6 +59499,11 @@ class SubscribeAttributeTemperatureControlSelectedTemperatureLevel : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.SelectedTemperatureLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54278,8 +59541,11 @@ class ReadTemperatureControlSupportedTemperatureLevels : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedTemperatureLevelsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.SupportedTemperatureLevels response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl SupportedTemperatureLevels read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54323,6 +59589,11 @@ class SubscribeAttributeTemperatureControlSupportedTemperatureLevels : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.SupportedTemperatureLevels response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54359,8 +59630,11 @@ class ReadTemperatureControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54404,6 +59678,11 @@ class SubscribeAttributeTemperatureControlGeneratedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54440,8 +59719,11 @@ class ReadTemperatureControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54485,6 +59767,11 @@ class SubscribeAttributeTemperatureControlAcceptedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54521,8 +59808,11 @@ class ReadTemperatureControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54566,6 +59856,11 @@ class SubscribeAttributeTemperatureControlEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54602,8 +59897,11 @@ class ReadTemperatureControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54647,6 +59945,11 @@ class SubscribeAttributeTemperatureControlAttributeList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54683,8 +59986,11 @@ class ReadTemperatureControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54728,6 +60034,11 @@ class SubscribeAttributeTemperatureControlFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54764,8 +60075,11 @@ class ReadTemperatureControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54809,6 +60123,11 @@ class SubscribeAttributeTemperatureControlClusterRevision : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54867,8 +60186,11 @@ class ReadRefrigeratorAlarmMask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.Mask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm Mask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54912,6 +60234,11 @@ class SubscribeAttributeRefrigeratorAlarmMask : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.Mask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -54948,8 +60275,11 @@ class ReadRefrigeratorAlarmState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.State response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm State read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -54993,6 +60323,11 @@ class SubscribeAttributeRefrigeratorAlarmState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.State response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55029,8 +60364,11 @@ class ReadRefrigeratorAlarmSupported : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.Supported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm Supported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55074,6 +60412,11 @@ class SubscribeAttributeRefrigeratorAlarmSupported : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.Supported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55110,8 +60453,11 @@ class ReadRefrigeratorAlarmGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55155,6 +60501,11 @@ class SubscribeAttributeRefrigeratorAlarmGeneratedCommandList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55191,8 +60542,11 @@ class ReadRefrigeratorAlarmAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55236,6 +60590,11 @@ class SubscribeAttributeRefrigeratorAlarmAcceptedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55272,8 +60631,11 @@ class ReadRefrigeratorAlarmEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55317,6 +60679,11 @@ class SubscribeAttributeRefrigeratorAlarmEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55353,8 +60720,11 @@ class ReadRefrigeratorAlarmAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55398,6 +60768,11 @@ class SubscribeAttributeRefrigeratorAlarmAttributeList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55434,8 +60809,11 @@ class ReadRefrigeratorAlarmFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55479,6 +60857,11 @@ class SubscribeAttributeRefrigeratorAlarmFeatureMap : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55515,8 +60898,11 @@ class ReadRefrigeratorAlarmClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RefrigeratorAlarm ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55560,6 +60946,11 @@ class SubscribeAttributeRefrigeratorAlarmClusterRevision : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RefrigeratorAlarm.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55623,19 +61014,28 @@ class DishwasherModeChangeToMode : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeToModeWithParams:params - completion:^(MTRDishwasherModeClusterChangeToModeResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeToModeWithParams:params + completion:^( + MTRDishwasherModeClusterChangeToModeResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DishwasherMode::Commands::ChangeToModeResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -55674,8 +61074,11 @@ class ReadDishwasherModeSupportedModes : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedModesWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.SupportedModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode SupportedModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55719,6 +61122,11 @@ class SubscribeAttributeDishwasherModeSupportedModes : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.SupportedModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55755,8 +61163,11 @@ class ReadDishwasherModeCurrentMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.CurrentMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode CurrentMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55800,6 +61211,11 @@ class SubscribeAttributeDishwasherModeCurrentMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.CurrentMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55836,8 +61252,11 @@ class ReadDishwasherModeStartUpMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.StartUpMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode StartUpMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55872,13 +61291,18 @@ class WriteDishwasherModeStartUpMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeStartUpModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DishwasherMode StartUpMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55886,7 +61310,7 @@ class WriteDishwasherModeStartUpMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeDishwasherModeStartUpMode : public SubscribeAttribute { @@ -55925,6 +61349,11 @@ class SubscribeAttributeDishwasherModeStartUpMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.StartUpMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -55961,8 +61390,11 @@ class ReadDishwasherModeOnMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOnModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.OnMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode OnMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -55997,13 +61429,18 @@ class WriteDishwasherModeOnMode : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOnModeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DishwasherMode OnMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56011,7 +61448,7 @@ class WriteDishwasherModeOnMode : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeDishwasherModeOnMode : public SubscribeAttribute { @@ -56050,6 +61487,11 @@ class SubscribeAttributeDishwasherModeOnMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.OnMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56086,8 +61528,11 @@ class ReadDishwasherModeGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56131,6 +61576,11 @@ class SubscribeAttributeDishwasherModeGeneratedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56167,8 +61617,11 @@ class ReadDishwasherModeAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56212,6 +61665,11 @@ class SubscribeAttributeDishwasherModeAcceptedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56248,8 +61706,11 @@ class ReadDishwasherModeEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56293,6 +61754,11 @@ class SubscribeAttributeDishwasherModeEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56329,8 +61795,11 @@ class ReadDishwasherModeAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56374,6 +61843,11 @@ class SubscribeAttributeDishwasherModeAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56410,8 +61884,11 @@ class ReadDishwasherModeFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56455,6 +61932,11 @@ class SubscribeAttributeDishwasherModeFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56491,8 +61973,11 @@ class ReadDishwasherModeClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherMode ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56536,6 +62021,11 @@ class SubscribeAttributeDishwasherModeClusterRevision : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherMode.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56591,8 +62081,11 @@ class ReadAirQualityAirQuality : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAirQualityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AirQuality response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality AirQuality read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56636,6 +62129,11 @@ class SubscribeAttributeAirQualityAirQuality : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AirQuality response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56672,8 +62170,11 @@ class ReadAirQualityGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56717,6 +62218,11 @@ class SubscribeAttributeAirQualityGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56753,8 +62259,11 @@ class ReadAirQualityAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56798,6 +62307,11 @@ class SubscribeAttributeAirQualityAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56834,8 +62348,11 @@ class ReadAirQualityEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56879,6 +62396,11 @@ class SubscribeAttributeAirQualityEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56915,8 +62437,11 @@ class ReadAirQualityAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -56960,6 +62485,11 @@ class SubscribeAttributeAirQualityAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -56996,8 +62526,11 @@ class ReadAirQualityFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57041,6 +62574,11 @@ class SubscribeAttributeAirQualityFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57077,8 +62615,11 @@ class ReadAirQualityClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AirQuality ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57122,6 +62663,11 @@ class SubscribeAttributeAirQualityClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AirQuality.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57209,6 +62755,8 @@ class SmokeCoAlarmSelfTestRequest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -57251,8 +62799,11 @@ class ReadSmokeCoAlarmExpressedState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeExpressedStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ExpressedState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm ExpressedState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57296,6 +62847,11 @@ class SubscribeAttributeSmokeCoAlarmExpressedState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ExpressedState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57332,8 +62888,11 @@ class ReadSmokeCoAlarmSmokeState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSmokeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.SmokeState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm SmokeState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57377,6 +62936,11 @@ class SubscribeAttributeSmokeCoAlarmSmokeState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.SmokeState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57413,8 +62977,11 @@ class ReadSmokeCoAlarmCOState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCOStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.COState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm COState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57458,6 +63025,11 @@ class SubscribeAttributeSmokeCoAlarmCOState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.COState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57494,8 +63066,11 @@ class ReadSmokeCoAlarmBatteryAlert : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBatteryAlertWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.BatteryAlert response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm BatteryAlert read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57539,6 +63114,11 @@ class SubscribeAttributeSmokeCoAlarmBatteryAlert : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.BatteryAlert response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57575,8 +63155,11 @@ class ReadSmokeCoAlarmDeviceMuted : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDeviceMutedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.DeviceMuted response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm DeviceMuted read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57620,6 +63203,11 @@ class SubscribeAttributeSmokeCoAlarmDeviceMuted : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.DeviceMuted response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57656,8 +63244,11 @@ class ReadSmokeCoAlarmTestInProgress : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTestInProgressWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.TestInProgress response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm TestInProgress read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57701,6 +63292,11 @@ class SubscribeAttributeSmokeCoAlarmTestInProgress : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.TestInProgress response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57737,8 +63333,11 @@ class ReadSmokeCoAlarmHardwareFaultAlert : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHardwareFaultAlertWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.HardwareFaultAlert response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm HardwareFaultAlert read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57782,6 +63381,11 @@ class SubscribeAttributeSmokeCoAlarmHardwareFaultAlert : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.HardwareFaultAlert response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57818,8 +63422,11 @@ class ReadSmokeCoAlarmEndOfServiceAlert : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEndOfServiceAlertWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.EndOfServiceAlert response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm EndOfServiceAlert read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57863,6 +63470,11 @@ class SubscribeAttributeSmokeCoAlarmEndOfServiceAlert : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.EndOfServiceAlert response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57899,8 +63511,11 @@ class ReadSmokeCoAlarmInterconnectSmokeAlarm : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInterconnectSmokeAlarmWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.InterconnectSmokeAlarm response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm InterconnectSmokeAlarm read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -57944,6 +63559,11 @@ class SubscribeAttributeSmokeCoAlarmInterconnectSmokeAlarm : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.InterconnectSmokeAlarm response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -57980,8 +63600,11 @@ class ReadSmokeCoAlarmInterconnectCOAlarm : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInterconnectCOAlarmWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.InterconnectCOAlarm response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm InterconnectCOAlarm read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58025,6 +63648,11 @@ class SubscribeAttributeSmokeCoAlarmInterconnectCOAlarm : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.InterconnectCOAlarm response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58061,8 +63689,11 @@ class ReadSmokeCoAlarmContaminationState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeContaminationStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ContaminationState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm ContaminationState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58106,6 +63737,11 @@ class SubscribeAttributeSmokeCoAlarmContaminationState : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ContaminationState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58142,8 +63778,11 @@ class ReadSmokeCoAlarmSmokeSensitivityLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSmokeSensitivityLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.SmokeSensitivityLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm SmokeSensitivityLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58185,6 +63824,8 @@ class WriteSmokeCoAlarmSmokeSensitivityLevel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("SmokeCOAlarm SmokeSensitivityLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58231,6 +63872,11 @@ class SubscribeAttributeSmokeCoAlarmSmokeSensitivityLevel : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.SmokeSensitivityLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58267,8 +63913,11 @@ class ReadSmokeCoAlarmExpiryDate : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeExpiryDateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ExpiryDate response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm ExpiryDate read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58312,6 +63961,11 @@ class SubscribeAttributeSmokeCoAlarmExpiryDate : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ExpiryDate response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58348,8 +64002,11 @@ class ReadSmokeCoAlarmGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58393,6 +64050,11 @@ class SubscribeAttributeSmokeCoAlarmGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58429,8 +64091,11 @@ class ReadSmokeCoAlarmAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58474,6 +64139,11 @@ class SubscribeAttributeSmokeCoAlarmAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58510,8 +64180,11 @@ class ReadSmokeCoAlarmEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58555,6 +64228,11 @@ class SubscribeAttributeSmokeCoAlarmEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58591,8 +64269,11 @@ class ReadSmokeCoAlarmAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58636,6 +64317,11 @@ class SubscribeAttributeSmokeCoAlarmAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58672,8 +64358,11 @@ class ReadSmokeCoAlarmFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58717,6 +64406,11 @@ class SubscribeAttributeSmokeCoAlarmFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58753,8 +64447,11 @@ class ReadSmokeCoAlarmClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("SmokeCOAlarm ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -58798,6 +64495,11 @@ class SubscribeAttributeSmokeCoAlarmClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"SmokeCOAlarm.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -58869,6 +64571,7 @@ class DishwasherAlarmReset : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -58921,6 +64624,8 @@ class DishwasherAlarmModifyEnabledAlarms : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -58964,8 +64669,11 @@ class ReadDishwasherAlarmMask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Mask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm Mask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59009,6 +64717,11 @@ class SubscribeAttributeDishwasherAlarmMask : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Mask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59045,8 +64758,11 @@ class ReadDishwasherAlarmLatch : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLatchWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Latch response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm Latch read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59090,6 +64806,11 @@ class SubscribeAttributeDishwasherAlarmLatch : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Latch response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59126,8 +64847,11 @@ class ReadDishwasherAlarmState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.State response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm State read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59171,6 +64895,11 @@ class SubscribeAttributeDishwasherAlarmState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.State response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59207,8 +64936,11 @@ class ReadDishwasherAlarmSupported : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Supported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm Supported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59252,6 +64984,11 @@ class SubscribeAttributeDishwasherAlarmSupported : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.Supported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59288,8 +65025,11 @@ class ReadDishwasherAlarmGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59333,6 +65073,11 @@ class SubscribeAttributeDishwasherAlarmGeneratedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59369,8 +65114,11 @@ class ReadDishwasherAlarmAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59414,6 +65162,11 @@ class SubscribeAttributeDishwasherAlarmAcceptedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59450,8 +65203,11 @@ class ReadDishwasherAlarmEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59495,6 +65251,11 @@ class SubscribeAttributeDishwasherAlarmEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59531,8 +65292,11 @@ class ReadDishwasherAlarmAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59576,6 +65340,11 @@ class SubscribeAttributeDishwasherAlarmAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59612,8 +65381,11 @@ class ReadDishwasherAlarmFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59657,6 +65429,11 @@ class SubscribeAttributeDishwasherAlarmFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59693,8 +65470,11 @@ class ReadDishwasherAlarmClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DishwasherAlarm ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -59738,6 +65518,11 @@ class SubscribeAttributeDishwasherAlarmClusterRevision : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DishwasherAlarm.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -59810,10 +65595,18 @@ class OperationalStatePause : public ClusterCommand { completion:^(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -59861,10 +65654,18 @@ class OperationalStateStop : public ClusterCommand { completion:^(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -59912,10 +65713,18 @@ class OperationalStateStart : public ClusterCommand { completion:^(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -59963,10 +65772,18 @@ class OperationalStateResume : public ClusterCommand { completion:^(MTROperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::OperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -60009,8 +65826,11 @@ class ReadOperationalStatePhaseList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.PhaseList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState PhaseList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60054,6 +65874,11 @@ class SubscribeAttributeOperationalStatePhaseList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.PhaseList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60090,8 +65915,11 @@ class ReadOperationalStateCurrentPhase : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.CurrentPhase response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState CurrentPhase read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60135,6 +65963,11 @@ class SubscribeAttributeOperationalStateCurrentPhase : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.CurrentPhase response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60171,8 +66004,11 @@ class ReadOperationalStateCountdownTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.CountdownTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState CountdownTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60216,6 +66052,11 @@ class SubscribeAttributeOperationalStateCountdownTime : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.CountdownTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60252,8 +66093,11 @@ class ReadOperationalStateOperationalStateList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalStateList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState OperationalStateList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60297,6 +66141,11 @@ class SubscribeAttributeOperationalStateOperationalStateList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalStateList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60333,8 +66182,11 @@ class ReadOperationalStateOperationalState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState OperationalState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60378,6 +66230,11 @@ class SubscribeAttributeOperationalStateOperationalState : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60415,8 +66272,11 @@ class ReadOperationalStateOperationalError : public ReadAttribute { [cluster readAttributeOperationalErrorWithCompletion:^( MTROperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalError response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState OperationalError read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60460,6 +66320,11 @@ class SubscribeAttributeOperationalStateOperationalError : public SubscribeAttri } reportHandler:^(MTROperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.OperationalError response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60496,8 +66361,11 @@ class ReadOperationalStateGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60541,6 +66409,11 @@ class SubscribeAttributeOperationalStateGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60577,8 +66450,11 @@ class ReadOperationalStateAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60622,6 +66498,11 @@ class SubscribeAttributeOperationalStateAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60658,8 +66539,11 @@ class ReadOperationalStateEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60703,6 +66587,11 @@ class SubscribeAttributeOperationalStateEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60739,8 +66628,11 @@ class ReadOperationalStateAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60784,6 +66676,11 @@ class SubscribeAttributeOperationalStateAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60820,8 +66717,11 @@ class ReadOperationalStateFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60865,6 +66765,11 @@ class SubscribeAttributeOperationalStateFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -60901,8 +66806,11 @@ class ReadOperationalStateClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OperationalState ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -60946,6 +66854,11 @@ class SubscribeAttributeOperationalStateClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OperationalState.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61018,10 +66931,18 @@ class RvcOperationalStatePause : public ClusterCommand { completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -61069,10 +66990,18 @@ class RvcOperationalStateStop : public ClusterCommand { completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -61120,10 +67049,18 @@ class RvcOperationalStateStart : public ClusterCommand { completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -61171,10 +67108,18 @@ class RvcOperationalStateResume : public ClusterCommand { completion:^(MTRRVCOperationalStateClusterOperationalCommandResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::RvcOperationalState::Commands::OperationalCommandResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -61217,8 +67162,11 @@ class ReadRvcOperationalStatePhaseList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhaseListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState PhaseList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61262,6 +67210,11 @@ class SubscribeAttributeRvcOperationalStatePhaseList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.PhaseList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61298,8 +67251,11 @@ class ReadRvcOperationalStateCurrentPhase : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPhaseWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState CurrentPhase read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61343,6 +67299,11 @@ class SubscribeAttributeRvcOperationalStateCurrentPhase : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.CurrentPhase response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61379,8 +67340,11 @@ class ReadRvcOperationalStateCountdownTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCountdownTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState CountdownTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61424,6 +67388,11 @@ class SubscribeAttributeRvcOperationalStateCountdownTime : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.CountdownTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61460,8 +67429,11 @@ class ReadRvcOperationalStateOperationalStateList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStateListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState OperationalStateList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61505,6 +67477,11 @@ class SubscribeAttributeRvcOperationalStateOperationalStateList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalStateList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61541,8 +67518,11 @@ class ReadRvcOperationalStateOperationalState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState OperationalState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61586,6 +67566,11 @@ class SubscribeAttributeRvcOperationalStateOperationalState : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61623,8 +67608,11 @@ class ReadRvcOperationalStateOperationalError : public ReadAttribute { [cluster readAttributeOperationalErrorWithCompletion:^( MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState OperationalError read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61668,6 +67656,11 @@ class SubscribeAttributeRvcOperationalStateOperationalError : public SubscribeAt } reportHandler:^(MTRRVCOperationalStateClusterErrorStateStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.OperationalError response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61704,8 +67697,11 @@ class ReadRvcOperationalStateGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61749,6 +67745,11 @@ class SubscribeAttributeRvcOperationalStateGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61785,8 +67786,11 @@ class ReadRvcOperationalStateAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61830,6 +67834,11 @@ class SubscribeAttributeRvcOperationalStateAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61866,8 +67875,11 @@ class ReadRvcOperationalStateEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61911,6 +67923,11 @@ class SubscribeAttributeRvcOperationalStateEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -61947,8 +67964,11 @@ class ReadRvcOperationalStateAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -61992,6 +68012,11 @@ class SubscribeAttributeRvcOperationalStateAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62028,8 +68053,11 @@ class ReadRvcOperationalStateFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62073,6 +68101,11 @@ class SubscribeAttributeRvcOperationalStateFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62109,8 +68142,11 @@ class ReadRvcOperationalStateClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RVCOperationalState ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62154,6 +68190,11 @@ class SubscribeAttributeRvcOperationalStateClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RVCOperationalState.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62223,6 +68264,8 @@ class HepaFilterMonitoringResetCondition : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -62265,8 +68308,11 @@ class ReadHepaFilterMonitoringCondition : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.Condition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring Condition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62310,6 +68356,11 @@ class SubscribeAttributeHepaFilterMonitoringCondition : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.Condition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62346,8 +68397,11 @@ class ReadHepaFilterMonitoringDegradationDirection : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.DegradationDirection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring DegradationDirection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62391,6 +68445,11 @@ class SubscribeAttributeHepaFilterMonitoringDegradationDirection : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.DegradationDirection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62427,8 +68486,11 @@ class ReadHepaFilterMonitoringChangeIndication : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ChangeIndication response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring ChangeIndication read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62472,6 +68534,11 @@ class SubscribeAttributeHepaFilterMonitoringChangeIndication : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ChangeIndication response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62508,8 +68575,11 @@ class ReadHepaFilterMonitoringInPlaceIndicator : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.InPlaceIndicator response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring InPlaceIndicator read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62553,6 +68623,11 @@ class SubscribeAttributeHepaFilterMonitoringInPlaceIndicator : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.InPlaceIndicator response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62589,8 +68664,11 @@ class ReadHepaFilterMonitoringLastChangedTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLastChangedTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.LastChangedTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring LastChangedTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62625,13 +68703,18 @@ class WriteHepaFilterMonitoringLastChangedTime : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLastChangedTimeWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("HEPAFilterMonitoring LastChangedTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62639,7 +68722,7 @@ class WriteHepaFilterMonitoringLastChangedTime : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeHepaFilterMonitoringLastChangedTime : public SubscribeAttribute { @@ -62678,6 +68761,11 @@ class SubscribeAttributeHepaFilterMonitoringLastChangedTime : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.LastChangedTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62714,8 +68802,11 @@ class ReadHepaFilterMonitoringReplacementProductList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReplacementProductListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ReplacementProductList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring ReplacementProductList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62759,6 +68850,11 @@ class SubscribeAttributeHepaFilterMonitoringReplacementProductList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ReplacementProductList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62795,8 +68891,11 @@ class ReadHepaFilterMonitoringGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62840,6 +68939,11 @@ class SubscribeAttributeHepaFilterMonitoringGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62876,8 +68980,11 @@ class ReadHepaFilterMonitoringAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -62921,6 +69028,11 @@ class SubscribeAttributeHepaFilterMonitoringAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -62957,8 +69069,11 @@ class ReadHepaFilterMonitoringEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63002,6 +69117,11 @@ class SubscribeAttributeHepaFilterMonitoringEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63038,8 +69158,11 @@ class ReadHepaFilterMonitoringAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63083,6 +69206,11 @@ class SubscribeAttributeHepaFilterMonitoringAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63119,8 +69247,11 @@ class ReadHepaFilterMonitoringFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63164,6 +69295,11 @@ class SubscribeAttributeHepaFilterMonitoringFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63200,8 +69336,11 @@ class ReadHepaFilterMonitoringClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("HEPAFilterMonitoring ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63245,6 +69384,11 @@ class SubscribeAttributeHepaFilterMonitoringClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"HEPAFilterMonitoring.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63314,6 +69458,8 @@ class ActivatedCarbonFilterMonitoringResetCondition : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -63356,8 +69502,11 @@ class ReadActivatedCarbonFilterMonitoringCondition : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeConditionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.Condition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring Condition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63401,6 +69550,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringCondition : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.Condition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63438,8 +69592,11 @@ class ReadActivatedCarbonFilterMonitoringDegradationDirection : public ReadAttri queue:callbackQueue]; [cluster readAttributeDegradationDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.DegradationDirection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring DegradationDirection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63484,6 +69641,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringDegradationDirection : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.DegradationDirection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63521,8 +69683,11 @@ class ReadActivatedCarbonFilterMonitoringChangeIndication : public ReadAttribute queue:callbackQueue]; [cluster readAttributeChangeIndicationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ChangeIndication response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring ChangeIndication read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63567,6 +69732,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringChangeIndication : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ChangeIndication response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63604,8 +69774,11 @@ class ReadActivatedCarbonFilterMonitoringInPlaceIndicator : public ReadAttribute queue:callbackQueue]; [cluster readAttributeInPlaceIndicatorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.InPlaceIndicator response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring InPlaceIndicator read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63650,6 +69823,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringInPlaceIndicator : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.InPlaceIndicator response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63687,8 +69865,11 @@ class ReadActivatedCarbonFilterMonitoringLastChangedTime : public ReadAttribute queue:callbackQueue]; [cluster readAttributeLastChangedTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.LastChangedTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring LastChangedTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63724,7 +69905,10 @@ class WriteActivatedCarbonFilterMonitoringLastChangedTime : public WriteAttribut params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLastChangedTimeWithValue:value @@ -63732,6 +69916,8 @@ class WriteActivatedCarbonFilterMonitoringLastChangedTime : public WriteAttribut completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ActivatedCarbonFilterMonitoring LastChangedTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63739,7 +69925,7 @@ class WriteActivatedCarbonFilterMonitoringLastChangedTime : public WriteAttribut } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeActivatedCarbonFilterMonitoringLastChangedTime : public SubscribeAttribute { @@ -63779,6 +69965,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringLastChangedTime : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.LastChangedTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63816,8 +70007,11 @@ class ReadActivatedCarbonFilterMonitoringReplacementProductList : public ReadAtt queue:callbackQueue]; [cluster readAttributeReplacementProductListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ReplacementProductList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring ReplacementProductList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63862,6 +70056,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringReplacementProductList : } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ReplacementProductList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63899,8 +70098,11 @@ class ReadActivatedCarbonFilterMonitoringGeneratedCommandList : public ReadAttri queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -63945,6 +70147,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringGeneratedCommandList : pu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -63982,8 +70189,11 @@ class ReadActivatedCarbonFilterMonitoringAcceptedCommandList : public ReadAttrib queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64028,6 +70238,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringAcceptedCommandList : pub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64064,8 +70279,11 @@ class ReadActivatedCarbonFilterMonitoringEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64109,6 +70327,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringEventList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64146,8 +70369,11 @@ class ReadActivatedCarbonFilterMonitoringAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64191,6 +70417,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringAttributeList : public Su } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64227,8 +70458,11 @@ class ReadActivatedCarbonFilterMonitoringFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64272,6 +70506,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringFeatureMap : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64309,8 +70548,11 @@ class ReadActivatedCarbonFilterMonitoringClusterRevision : public ReadAttribute queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ActivatedCarbonFilterMonitoring ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -64355,6 +70597,11 @@ class SubscribeAttributeActivatedCarbonFilterMonitoringClusterRevision : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ActivatedCarbonFilterMonitoring.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -64479,6 +70726,7 @@ class DoorLockLockDoor : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64525,17 +70773,19 @@ class DoorLockUnlockDoor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster unlockDoorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + unlockDoorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -64585,6 +70835,8 @@ class DoorLockUnlockWithTimeout : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64645,6 +70897,8 @@ class DoorLockSetWeekDaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64693,10 +70947,20 @@ class DoorLockGetWeekDaySchedule : public ClusterCommand { completion:^(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetWeekDayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64747,6 +71011,8 @@ class DoorLockClearWeekDaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64801,6 +71067,8 @@ class DoorLockSetYearDaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64849,10 +71117,20 @@ class DoorLockGetYearDaySchedule : public ClusterCommand { completion:^(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetYearDayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64903,6 +71181,8 @@ class DoorLockClearYearDaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -64957,6 +71237,8 @@ class DoorLockSetHolidaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65003,10 +71285,20 @@ class DoorLockGetHolidaySchedule : public ClusterCommand { completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetHolidayScheduleResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65055,6 +71347,8 @@ class DoorLockClearHolidaySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65137,6 +71431,7 @@ class DoorLockSetUser : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65179,18 +71474,25 @@ class DoorLockGetUser : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getUserWithParams:params - completion:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + getUserWithParams:params + completion:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::DoorLock::Commands::GetUserResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::DoorLock::Commands::GetUserResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -65228,17 +71530,19 @@ class DoorLockClearUser : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster clearUserWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + clearUserWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -65302,19 +71606,29 @@ class DoorLockSetCredential : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster setCredentialWithParams:params - completion:^( - MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + setCredentialWithParams:params + completion:^( + MTRDoorLockClusterSetCredentialResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::SetCredentialResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -65361,10 +71675,20 @@ class DoorLockGetCredentialStatus : public ClusterCommand { completion:^(MTRDoorLockClusterGetCredentialStatusResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::DoorLock::Commands::GetCredentialStatusResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65422,6 +71746,8 @@ class DoorLockClearCredential : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -65471,17 +71797,19 @@ class DoorLockUnboltDoor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster unboltDoorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + unboltDoorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -65516,8 +71844,11 @@ class ReadDoorLockLockState : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLockStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LockState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock LockState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65559,6 +71890,11 @@ class SubscribeAttributeDoorLockLockState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LockState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65590,8 +71926,11 @@ class ReadDoorLockLockType : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLockTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LockType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock LockType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65633,6 +71972,11 @@ class SubscribeAttributeDoorLockLockType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LockType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65664,8 +72008,11 @@ class ReadDoorLockActuatorEnabled : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeActuatorEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ActuatorEnabled response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock ActuatorEnabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65707,6 +72054,11 @@ class SubscribeAttributeDoorLockActuatorEnabled : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ActuatorEnabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65738,8 +72090,11 @@ class ReadDoorLockDoorState : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeDoorStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock DoorState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65781,6 +72136,11 @@ class SubscribeAttributeDoorLockDoorState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65812,8 +72172,11 @@ class ReadDoorLockDoorOpenEvents : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeDoorOpenEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorOpenEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock DoorOpenEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65853,6 +72216,8 @@ class WriteDoorLockDoorOpenEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock DoorOpenEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65897,6 +72262,11 @@ class SubscribeAttributeDoorLockDoorOpenEvents : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorOpenEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -65928,8 +72298,11 @@ class ReadDoorLockDoorClosedEvents : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeDoorClosedEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorClosedEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock DoorClosedEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -65969,6 +72342,8 @@ class WriteDoorLockDoorClosedEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock DoorClosedEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66013,6 +72388,11 @@ class SubscribeAttributeDoorLockDoorClosedEvents : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DoorClosedEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66044,8 +72424,11 @@ class ReadDoorLockOpenPeriod : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOpenPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.OpenPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock OpenPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66085,6 +72468,8 @@ class WriteDoorLockOpenPeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock OpenPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66129,6 +72514,11 @@ class SubscribeAttributeDoorLockOpenPeriod : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.OpenPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66160,8 +72550,11 @@ class ReadDoorLockNumberOfTotalUsersSupported : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNumberOfTotalUsersSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfTotalUsersSupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfTotalUsersSupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66203,6 +72596,11 @@ class SubscribeAttributeDoorLockNumberOfTotalUsersSupported : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfTotalUsersSupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66234,8 +72632,11 @@ class ReadDoorLockNumberOfPINUsersSupported : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNumberOfPINUsersSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfPINUsersSupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfPINUsersSupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66277,6 +72678,11 @@ class SubscribeAttributeDoorLockNumberOfPINUsersSupported : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfPINUsersSupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66308,8 +72714,11 @@ class ReadDoorLockNumberOfRFIDUsersSupported : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeNumberOfRFIDUsersSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfRFIDUsersSupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfRFIDUsersSupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66351,6 +72760,11 @@ class SubscribeAttributeDoorLockNumberOfRFIDUsersSupported : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfRFIDUsersSupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66384,8 +72798,11 @@ class ReadDoorLockNumberOfWeekDaySchedulesSupportedPerUser : public ReadAttribut [cluster readAttributeNumberOfWeekDaySchedulesSupportedPerUserWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfWeekDaySchedulesSupportedPerUser response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfWeekDaySchedulesSupportedPerUser read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66428,6 +72845,11 @@ class SubscribeAttributeDoorLockNumberOfWeekDaySchedulesSupportedPerUser : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfWeekDaySchedulesSupportedPerUser response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66461,8 +72883,11 @@ class ReadDoorLockNumberOfYearDaySchedulesSupportedPerUser : public ReadAttribut [cluster readAttributeNumberOfYearDaySchedulesSupportedPerUserWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfYearDaySchedulesSupportedPerUser response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfYearDaySchedulesSupportedPerUser read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66505,6 +72930,11 @@ class SubscribeAttributeDoorLockNumberOfYearDaySchedulesSupportedPerUser : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfYearDaySchedulesSupportedPerUser response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66537,8 +72967,11 @@ class ReadDoorLockNumberOfHolidaySchedulesSupported : public ReadAttribute { [cluster readAttributeNumberOfHolidaySchedulesSupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfHolidaySchedulesSupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfHolidaySchedulesSupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66580,6 +73013,11 @@ class SubscribeAttributeDoorLockNumberOfHolidaySchedulesSupported : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfHolidaySchedulesSupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66611,8 +73049,11 @@ class ReadDoorLockMaxPINCodeLength : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMaxPINCodeLengthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MaxPINCodeLength response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock MaxPINCodeLength read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66654,6 +73095,11 @@ class SubscribeAttributeDoorLockMaxPINCodeLength : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MaxPINCodeLength response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66685,8 +73131,11 @@ class ReadDoorLockMinPINCodeLength : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMinPINCodeLengthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MinPINCodeLength response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock MinPINCodeLength read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66728,6 +73177,11 @@ class SubscribeAttributeDoorLockMinPINCodeLength : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MinPINCodeLength response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66759,8 +73213,11 @@ class ReadDoorLockMaxRFIDCodeLength : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMaxRFIDCodeLengthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MaxRFIDCodeLength response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock MaxRFIDCodeLength read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66802,6 +73259,11 @@ class SubscribeAttributeDoorLockMaxRFIDCodeLength : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MaxRFIDCodeLength response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66833,8 +73295,11 @@ class ReadDoorLockMinRFIDCodeLength : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeMinRFIDCodeLengthWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MinRFIDCodeLength response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock MinRFIDCodeLength read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66876,6 +73341,11 @@ class SubscribeAttributeDoorLockMinRFIDCodeLength : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.MinRFIDCodeLength response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66907,8 +73377,11 @@ class ReadDoorLockCredentialRulesSupport : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeCredentialRulesSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.CredentialRulesSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock CredentialRulesSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -66950,6 +73423,11 @@ class SubscribeAttributeDoorLockCredentialRulesSupport : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.CredentialRulesSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -66983,8 +73461,11 @@ class ReadDoorLockNumberOfCredentialsSupportedPerUser : public ReadAttribute { [cluster readAttributeNumberOfCredentialsSupportedPerUserWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfCredentialsSupportedPerUser response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock NumberOfCredentialsSupportedPerUser read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67026,6 +73507,11 @@ class SubscribeAttributeDoorLockNumberOfCredentialsSupportedPerUser : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.NumberOfCredentialsSupportedPerUser response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67057,8 +73543,11 @@ class ReadDoorLockLanguage : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLanguageWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.Language response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock Language read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67100,6 +73589,8 @@ class WriteDoorLockLanguage : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock Language write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67144,6 +73635,11 @@ class SubscribeAttributeDoorLockLanguage : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.Language response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67175,8 +73671,11 @@ class ReadDoorLockLEDSettings : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLEDSettingsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LEDSettings response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock LEDSettings read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67216,6 +73715,8 @@ class WriteDoorLockLEDSettings : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock LEDSettings write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67260,6 +73761,11 @@ class SubscribeAttributeDoorLockLEDSettings : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LEDSettings response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67291,8 +73797,11 @@ class ReadDoorLockAutoRelockTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAutoRelockTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AutoRelockTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock AutoRelockTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67332,6 +73841,8 @@ class WriteDoorLockAutoRelockTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock AutoRelockTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67376,6 +73887,11 @@ class SubscribeAttributeDoorLockAutoRelockTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AutoRelockTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67407,8 +73923,11 @@ class ReadDoorLockSoundVolume : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSoundVolumeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SoundVolume response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock SoundVolume read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67448,6 +73967,8 @@ class WriteDoorLockSoundVolume : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock SoundVolume write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67492,6 +74013,11 @@ class SubscribeAttributeDoorLockSoundVolume : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SoundVolume response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67523,8 +74049,11 @@ class ReadDoorLockOperatingMode : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeOperatingModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.OperatingMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock OperatingMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67564,6 +74093,8 @@ class WriteDoorLockOperatingMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock OperatingMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67608,6 +74139,11 @@ class SubscribeAttributeDoorLockOperatingMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.OperatingMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67639,8 +74175,11 @@ class ReadDoorLockSupportedOperatingModes : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSupportedOperatingModesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SupportedOperatingModes response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock SupportedOperatingModes read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67682,6 +74221,11 @@ class SubscribeAttributeDoorLockSupportedOperatingModes : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SupportedOperatingModes response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67713,8 +74257,11 @@ class ReadDoorLockDefaultConfigurationRegister : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeDefaultConfigurationRegisterWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DefaultConfigurationRegister response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock DefaultConfigurationRegister read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67756,6 +74303,11 @@ class SubscribeAttributeDoorLockDefaultConfigurationRegister : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.DefaultConfigurationRegister response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67787,8 +74339,11 @@ class ReadDoorLockEnableLocalProgramming : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEnableLocalProgrammingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableLocalProgramming response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EnableLocalProgramming read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67828,6 +74383,8 @@ class WriteDoorLockEnableLocalProgramming : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock EnableLocalProgramming write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67872,6 +74429,11 @@ class SubscribeAttributeDoorLockEnableLocalProgramming : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableLocalProgramming response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -67903,8 +74465,11 @@ class ReadDoorLockEnableOneTouchLocking : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEnableOneTouchLockingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableOneTouchLocking response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EnableOneTouchLocking read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67944,6 +74509,8 @@ class WriteDoorLockEnableOneTouchLocking : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock EnableOneTouchLocking write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -67988,6 +74555,11 @@ class SubscribeAttributeDoorLockEnableOneTouchLocking : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableOneTouchLocking response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68019,8 +74591,11 @@ class ReadDoorLockEnableInsideStatusLED : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEnableInsideStatusLEDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableInsideStatusLED response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EnableInsideStatusLED read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68060,6 +74635,8 @@ class WriteDoorLockEnableInsideStatusLED : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock EnableInsideStatusLED write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68104,6 +74681,11 @@ class SubscribeAttributeDoorLockEnableInsideStatusLED : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnableInsideStatusLED response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68135,8 +74717,11 @@ class ReadDoorLockEnablePrivacyModeButton : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEnablePrivacyModeButtonWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnablePrivacyModeButton response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EnablePrivacyModeButton read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68176,6 +74761,8 @@ class WriteDoorLockEnablePrivacyModeButton : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock EnablePrivacyModeButton write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68220,6 +74807,11 @@ class SubscribeAttributeDoorLockEnablePrivacyModeButton : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EnablePrivacyModeButton response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68251,8 +74843,11 @@ class ReadDoorLockLocalProgrammingFeatures : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeLocalProgrammingFeaturesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LocalProgrammingFeatures response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock LocalProgrammingFeatures read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68292,6 +74887,8 @@ class WriteDoorLockLocalProgrammingFeatures : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock LocalProgrammingFeatures write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68336,6 +74933,11 @@ class SubscribeAttributeDoorLockLocalProgrammingFeatures : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.LocalProgrammingFeatures response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68367,8 +74969,11 @@ class ReadDoorLockWrongCodeEntryLimit : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeWrongCodeEntryLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.WrongCodeEntryLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock WrongCodeEntryLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68408,6 +75013,8 @@ class WriteDoorLockWrongCodeEntryLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock WrongCodeEntryLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68452,6 +75059,11 @@ class SubscribeAttributeDoorLockWrongCodeEntryLimit : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.WrongCodeEntryLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68483,8 +75095,11 @@ class ReadDoorLockUserCodeTemporaryDisableTime : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeUserCodeTemporaryDisableTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.UserCodeTemporaryDisableTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock UserCodeTemporaryDisableTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68525,6 +75140,8 @@ class WriteDoorLockUserCodeTemporaryDisableTime : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock UserCodeTemporaryDisableTime write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68569,6 +75186,11 @@ class SubscribeAttributeDoorLockUserCodeTemporaryDisableTime : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.UserCodeTemporaryDisableTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68600,8 +75222,11 @@ class ReadDoorLockSendPINOverTheAir : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeSendPINOverTheAirWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SendPINOverTheAir response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock SendPINOverTheAir read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68641,6 +75266,8 @@ class WriteDoorLockSendPINOverTheAir : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock SendPINOverTheAir write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68685,6 +75312,11 @@ class SubscribeAttributeDoorLockSendPINOverTheAir : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.SendPINOverTheAir response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68716,8 +75348,11 @@ class ReadDoorLockRequirePINforRemoteOperation : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeRequirePINforRemoteOperationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.RequirePINforRemoteOperation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock RequirePINforRemoteOperation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68758,6 +75393,8 @@ class WriteDoorLockRequirePINforRemoteOperation : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock RequirePINforRemoteOperation write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68802,6 +75439,11 @@ class SubscribeAttributeDoorLockRequirePINforRemoteOperation : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.RequirePINforRemoteOperation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68833,8 +75475,11 @@ class ReadDoorLockExpiringUserTimeout : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeExpiringUserTimeoutWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ExpiringUserTimeout response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock ExpiringUserTimeout read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68874,6 +75519,8 @@ class WriteDoorLockExpiringUserTimeout : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("DoorLock ExpiringUserTimeout write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68918,6 +75565,11 @@ class SubscribeAttributeDoorLockExpiringUserTimeout : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ExpiringUserTimeout response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -68949,8 +75601,11 @@ class ReadDoorLockGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -68992,6 +75647,11 @@ class SubscribeAttributeDoorLockGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69023,8 +75683,11 @@ class ReadDoorLockAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69066,6 +75729,11 @@ class SubscribeAttributeDoorLockAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69099,8 +75767,11 @@ class ReadDoorLockEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69142,6 +75813,11 @@ class SubscribeAttributeDoorLockEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69175,8 +75851,11 @@ class ReadDoorLockAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69218,6 +75897,11 @@ class SubscribeAttributeDoorLockAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69249,8 +75933,11 @@ class ReadDoorLockFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69292,6 +75979,11 @@ class SubscribeAttributeDoorLockFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69323,8 +76015,11 @@ class ReadDoorLockClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterDoorLock alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("DoorLock ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69366,6 +76061,11 @@ class SubscribeAttributeDoorLockClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"DoorLock.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69453,6 +76153,7 @@ class WindowCoveringUpOrOpen : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -69494,17 +76195,19 @@ class WindowCoveringDownOrClose : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster downOrCloseWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + downOrCloseWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -69541,17 +76244,19 @@ class WindowCoveringStopMotion : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopMotionWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stopMotionWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -69590,17 +76295,19 @@ class WindowCoveringGoToLiftValue : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster goToLiftValueWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + goToLiftValueWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -69646,6 +76353,8 @@ class WindowCoveringGoToLiftPercentage : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -69690,17 +76399,19 @@ class WindowCoveringGoToTiltValue : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster goToTiltValueWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + goToTiltValueWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -69746,6 +76457,8 @@ class WindowCoveringGoToTiltPercentage : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -69785,8 +76498,11 @@ class ReadWindowCoveringType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.Type response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering Type read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69830,6 +76546,11 @@ class SubscribeAttributeWindowCoveringType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.Type response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69863,8 +76584,11 @@ class ReadWindowCoveringPhysicalClosedLimitLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhysicalClosedLimitLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.PhysicalClosedLimitLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering PhysicalClosedLimitLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69908,6 +76632,11 @@ class SubscribeAttributeWindowCoveringPhysicalClosedLimitLift : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.PhysicalClosedLimitLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -69941,8 +76670,11 @@ class ReadWindowCoveringPhysicalClosedLimitTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhysicalClosedLimitTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.PhysicalClosedLimitTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering PhysicalClosedLimitTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -69986,6 +76718,11 @@ class SubscribeAttributeWindowCoveringPhysicalClosedLimitTilt : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.PhysicalClosedLimitTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70019,8 +76756,11 @@ class ReadWindowCoveringCurrentPositionLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPositionLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70064,6 +76804,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionLift : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70097,8 +76842,11 @@ class ReadWindowCoveringCurrentPositionTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPositionTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70142,6 +76890,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionTilt : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70175,8 +76928,11 @@ class ReadWindowCoveringNumberOfActuationsLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfActuationsLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.NumberOfActuationsLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering NumberOfActuationsLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70220,6 +76976,11 @@ class SubscribeAttributeWindowCoveringNumberOfActuationsLift : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.NumberOfActuationsLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70253,8 +77014,11 @@ class ReadWindowCoveringNumberOfActuationsTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfActuationsTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.NumberOfActuationsTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering NumberOfActuationsTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70298,6 +77062,11 @@ class SubscribeAttributeWindowCoveringNumberOfActuationsTilt : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.NumberOfActuationsTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70331,8 +77100,11 @@ class ReadWindowCoveringConfigStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeConfigStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.ConfigStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering ConfigStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70376,6 +77148,11 @@ class SubscribeAttributeWindowCoveringConfigStatus : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.ConfigStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70410,8 +77187,11 @@ class ReadWindowCoveringCurrentPositionLiftPercentage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPositionLiftPercentageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLiftPercentage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionLiftPercentage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70455,6 +77235,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionLiftPercentage : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLiftPercentage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70489,8 +77274,11 @@ class ReadWindowCoveringCurrentPositionTiltPercentage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentPositionTiltPercentageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTiltPercentage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionTiltPercentage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70534,6 +77322,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionTiltPercentage : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTiltPercentage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70567,8 +77360,11 @@ class ReadWindowCoveringOperationalStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationalStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.OperationalStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering OperationalStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70612,6 +77408,11 @@ class SubscribeAttributeWindowCoveringOperationalStatus : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.OperationalStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70647,8 +77448,11 @@ class ReadWindowCoveringTargetPositionLiftPercent100ths : public ReadAttribute { [cluster readAttributeTargetPositionLiftPercent100thsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.TargetPositionLiftPercent100ths response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering TargetPositionLiftPercent100ths read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70693,6 +77497,11 @@ class SubscribeAttributeWindowCoveringTargetPositionLiftPercent100ths : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.TargetPositionLiftPercent100ths response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70728,8 +77537,11 @@ class ReadWindowCoveringTargetPositionTiltPercent100ths : public ReadAttribute { [cluster readAttributeTargetPositionTiltPercent100thsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.TargetPositionTiltPercent100ths response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering TargetPositionTiltPercent100ths read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70774,6 +77586,11 @@ class SubscribeAttributeWindowCoveringTargetPositionTiltPercent100ths : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.TargetPositionTiltPercent100ths response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70807,8 +77624,11 @@ class ReadWindowCoveringEndProductType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEndProductTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.EndProductType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering EndProductType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70852,6 +77672,11 @@ class SubscribeAttributeWindowCoveringEndProductType : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.EndProductType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70887,8 +77712,11 @@ class ReadWindowCoveringCurrentPositionLiftPercent100ths : public ReadAttribute [cluster readAttributeCurrentPositionLiftPercent100thsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLiftPercent100ths response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionLiftPercent100ths read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -70933,6 +77761,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionLiftPercent100ths : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionLiftPercent100ths response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -70968,8 +77801,11 @@ class ReadWindowCoveringCurrentPositionTiltPercent100ths : public ReadAttribute [cluster readAttributeCurrentPositionTiltPercent100thsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTiltPercent100ths response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering CurrentPositionTiltPercent100ths read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71014,6 +77850,11 @@ class SubscribeAttributeWindowCoveringCurrentPositionTiltPercent100ths : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.CurrentPositionTiltPercent100ths response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71047,8 +77888,11 @@ class ReadWindowCoveringInstalledOpenLimitLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstalledOpenLimitLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledOpenLimitLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering InstalledOpenLimitLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71092,6 +77936,11 @@ class SubscribeAttributeWindowCoveringInstalledOpenLimitLift : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledOpenLimitLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71125,8 +77974,11 @@ class ReadWindowCoveringInstalledClosedLimitLift : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstalledClosedLimitLiftWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledClosedLimitLift response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering InstalledClosedLimitLift read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71170,6 +78022,11 @@ class SubscribeAttributeWindowCoveringInstalledClosedLimitLift : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledClosedLimitLift response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71203,8 +78060,11 @@ class ReadWindowCoveringInstalledOpenLimitTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstalledOpenLimitTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledOpenLimitTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering InstalledOpenLimitTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71248,6 +78108,11 @@ class SubscribeAttributeWindowCoveringInstalledOpenLimitTilt : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledOpenLimitTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71281,8 +78146,11 @@ class ReadWindowCoveringInstalledClosedLimitTilt : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstalledClosedLimitTiltWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledClosedLimitTilt response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering InstalledClosedLimitTilt read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71326,6 +78194,11 @@ class SubscribeAttributeWindowCoveringInstalledClosedLimitTilt : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.InstalledClosedLimitTilt response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71359,8 +78232,11 @@ class ReadWindowCoveringMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.Mode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering Mode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71402,6 +78278,8 @@ class WriteWindowCoveringMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("WindowCovering Mode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71448,6 +78326,11 @@ class SubscribeAttributeWindowCoveringMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.Mode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71481,8 +78364,11 @@ class ReadWindowCoveringSafetyStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSafetyStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.SafetyStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering SafetyStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71526,6 +78412,11 @@ class SubscribeAttributeWindowCoveringSafetyStatus : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.SafetyStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71559,8 +78450,11 @@ class ReadWindowCoveringGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71604,6 +78498,11 @@ class SubscribeAttributeWindowCoveringGeneratedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71637,8 +78536,11 @@ class ReadWindowCoveringAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71682,6 +78584,11 @@ class SubscribeAttributeWindowCoveringAcceptedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71717,8 +78624,11 @@ class ReadWindowCoveringEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71762,6 +78672,11 @@ class SubscribeAttributeWindowCoveringEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71797,8 +78712,11 @@ class ReadWindowCoveringAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71842,6 +78760,11 @@ class SubscribeAttributeWindowCoveringAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71875,8 +78798,11 @@ class ReadWindowCoveringFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71920,6 +78846,11 @@ class SubscribeAttributeWindowCoveringFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -71953,8 +78884,11 @@ class ReadWindowCoveringClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WindowCovering ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -71998,6 +78932,11 @@ class SubscribeAttributeWindowCoveringClusterRevision : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WindowCovering.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72070,6 +79009,8 @@ class BarrierControlBarrierControlGoToPercent : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -72118,6 +79059,8 @@ class BarrierControlBarrierControlStop : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -72156,8 +79099,11 @@ class ReadBarrierControlBarrierMovingState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierMovingStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierMovingState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierMovingState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72201,6 +79147,11 @@ class SubscribeAttributeBarrierControlBarrierMovingState : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierMovingState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72234,8 +79185,11 @@ class ReadBarrierControlBarrierSafetyStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierSafetyStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierSafetyStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierSafetyStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72279,6 +79233,11 @@ class SubscribeAttributeBarrierControlBarrierSafetyStatus : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierSafetyStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72312,8 +79271,11 @@ class ReadBarrierControlBarrierCapabilities : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierCapabilitiesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCapabilities response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierCapabilities read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72357,6 +79319,11 @@ class SubscribeAttributeBarrierControlBarrierCapabilities : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72390,8 +79357,11 @@ class ReadBarrierControlBarrierOpenEvents : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierOpenEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierOpenEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierOpenEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72433,6 +79403,8 @@ class WriteBarrierControlBarrierOpenEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierOpenEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72479,6 +79451,11 @@ class SubscribeAttributeBarrierControlBarrierOpenEvents : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierOpenEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72512,8 +79489,11 @@ class ReadBarrierControlBarrierCloseEvents : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierCloseEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCloseEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierCloseEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72555,6 +79535,8 @@ class WriteBarrierControlBarrierCloseEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierCloseEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72601,6 +79583,11 @@ class SubscribeAttributeBarrierControlBarrierCloseEvents : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCloseEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72634,8 +79621,11 @@ class ReadBarrierControlBarrierCommandOpenEvents : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierCommandOpenEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCommandOpenEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierCommandOpenEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72678,6 +79668,8 @@ class WriteBarrierControlBarrierCommandOpenEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierCommandOpenEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72724,6 +79716,11 @@ class SubscribeAttributeBarrierControlBarrierCommandOpenEvents : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCommandOpenEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72757,8 +79754,11 @@ class ReadBarrierControlBarrierCommandCloseEvents : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierCommandCloseEventsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCommandCloseEvents response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierCommandCloseEvents read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72801,6 +79801,8 @@ class WriteBarrierControlBarrierCommandCloseEvents : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierCommandCloseEvents write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72847,6 +79849,11 @@ class SubscribeAttributeBarrierControlBarrierCommandCloseEvents : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierCommandCloseEvents response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -72880,8 +79887,11 @@ class ReadBarrierControlBarrierOpenPeriod : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierOpenPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierOpenPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierOpenPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72923,6 +79933,8 @@ class WriteBarrierControlBarrierOpenPeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierOpenPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -72969,6 +79981,11 @@ class SubscribeAttributeBarrierControlBarrierOpenPeriod : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierOpenPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73002,8 +80019,11 @@ class ReadBarrierControlBarrierClosePeriod : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierClosePeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierClosePeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierClosePeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73045,6 +80065,8 @@ class WriteBarrierControlBarrierClosePeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BarrierControl BarrierClosePeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73091,6 +80113,11 @@ class SubscribeAttributeBarrierControlBarrierClosePeriod : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierClosePeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73124,8 +80151,11 @@ class ReadBarrierControlBarrierPosition : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBarrierPositionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierPosition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl BarrierPosition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73169,6 +80199,11 @@ class SubscribeAttributeBarrierControlBarrierPosition : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.BarrierPosition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73202,8 +80237,11 @@ class ReadBarrierControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73247,6 +80285,11 @@ class SubscribeAttributeBarrierControlGeneratedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73280,8 +80323,11 @@ class ReadBarrierControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73325,6 +80371,11 @@ class SubscribeAttributeBarrierControlAcceptedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73360,8 +80411,11 @@ class ReadBarrierControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73405,6 +80459,11 @@ class SubscribeAttributeBarrierControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73440,8 +80499,11 @@ class ReadBarrierControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73485,6 +80547,11 @@ class SubscribeAttributeBarrierControlAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73518,8 +80585,11 @@ class ReadBarrierControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73563,6 +80633,11 @@ class SubscribeAttributeBarrierControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73596,8 +80671,11 @@ class ReadBarrierControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BarrierControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73641,6 +80719,11 @@ class SubscribeAttributeBarrierControlClusterRevision : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BarrierControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73730,8 +80813,11 @@ class ReadPumpConfigurationAndControlMaxPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73775,6 +80861,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxPressure : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73808,8 +80899,11 @@ class ReadPumpConfigurationAndControlMaxSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxSpeed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxSpeed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73853,6 +80947,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxSpeed : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxSpeed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73886,8 +80985,11 @@ class ReadPumpConfigurationAndControlMaxFlow : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxFlowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxFlow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxFlow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -73931,6 +81033,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxFlow : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxFlow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -73965,8 +81072,11 @@ class ReadPumpConfigurationAndControlMinConstPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinConstPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinConstPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74010,6 +81120,11 @@ class SubscribeAttributePumpConfigurationAndControlMinConstPressure : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74044,8 +81159,11 @@ class ReadPumpConfigurationAndControlMaxConstPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxConstPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxConstPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74089,6 +81207,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstPressure : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74122,8 +81245,11 @@ class ReadPumpConfigurationAndControlMinCompPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinCompPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinCompPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinCompPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74167,6 +81293,11 @@ class SubscribeAttributePumpConfigurationAndControlMinCompPressure : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinCompPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74200,8 +81331,11 @@ class ReadPumpConfigurationAndControlMaxCompPressure : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxCompPressureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxCompPressure response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxCompPressure read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74245,6 +81379,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxCompPressure : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxCompPressure response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74278,8 +81417,11 @@ class ReadPumpConfigurationAndControlMinConstSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinConstSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstSpeed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinConstSpeed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74323,6 +81465,11 @@ class SubscribeAttributePumpConfigurationAndControlMinConstSpeed : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstSpeed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74356,8 +81503,11 @@ class ReadPumpConfigurationAndControlMaxConstSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxConstSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstSpeed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxConstSpeed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74401,6 +81551,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstSpeed : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstSpeed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74434,8 +81589,11 @@ class ReadPumpConfigurationAndControlMinConstFlow : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinConstFlowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstFlow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinConstFlow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74479,6 +81637,11 @@ class SubscribeAttributePumpConfigurationAndControlMinConstFlow : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstFlow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74512,8 +81675,11 @@ class ReadPumpConfigurationAndControlMaxConstFlow : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxConstFlowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstFlow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxConstFlow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74557,6 +81723,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstFlow : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstFlow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74590,8 +81761,11 @@ class ReadPumpConfigurationAndControlMinConstTemp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinConstTempWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstTemp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MinConstTemp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74635,6 +81809,11 @@ class SubscribeAttributePumpConfigurationAndControlMinConstTemp : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MinConstTemp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74668,8 +81847,11 @@ class ReadPumpConfigurationAndControlMaxConstTemp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxConstTempWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstTemp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl MaxConstTemp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74713,6 +81895,11 @@ class SubscribeAttributePumpConfigurationAndControlMaxConstTemp : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.MaxConstTemp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74746,8 +81933,11 @@ class ReadPumpConfigurationAndControlPumpStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePumpStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.PumpStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl PumpStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74791,6 +81981,11 @@ class SubscribeAttributePumpConfigurationAndControlPumpStatus : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.PumpStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74825,8 +82020,11 @@ class ReadPumpConfigurationAndControlEffectiveOperationMode : public ReadAttribu queue:callbackQueue]; [cluster readAttributeEffectiveOperationModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EffectiveOperationMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl EffectiveOperationMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74871,6 +82069,11 @@ class SubscribeAttributePumpConfigurationAndControlEffectiveOperationMode : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EffectiveOperationMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74905,8 +82108,11 @@ class ReadPumpConfigurationAndControlEffectiveControlMode : public ReadAttribute queue:callbackQueue]; [cluster readAttributeEffectiveControlModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EffectiveControlMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl EffectiveControlMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -74951,6 +82157,11 @@ class SubscribeAttributePumpConfigurationAndControlEffectiveControlMode : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EffectiveControlMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -74984,8 +82195,11 @@ class ReadPumpConfigurationAndControlCapacity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Capacity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl Capacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75029,6 +82243,11 @@ class SubscribeAttributePumpConfigurationAndControlCapacity : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Capacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75062,8 +82281,11 @@ class ReadPumpConfigurationAndControlSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Speed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl Speed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75107,6 +82329,11 @@ class SubscribeAttributePumpConfigurationAndControlSpeed : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Speed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75141,8 +82368,11 @@ class ReadPumpConfigurationAndControlLifetimeRunningHours : public ReadAttribute queue:callbackQueue]; [cluster readAttributeLifetimeRunningHoursWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.LifetimeRunningHours response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl LifetimeRunningHours read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75178,7 +82408,10 @@ class WritePumpConfigurationAndControlLifetimeRunningHours : public WriteAttribu params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLifetimeRunningHoursWithValue:value params:params @@ -75186,6 +82419,8 @@ class WritePumpConfigurationAndControlLifetimeRunningHours : public WriteAttribu if (error != nil) { LogNSError("PumpConfigurationAndControl LifetimeRunningHours write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75193,7 +82428,7 @@ class WritePumpConfigurationAndControlLifetimeRunningHours : public WriteAttribu } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours : public SubscribeAttribute { @@ -75233,6 +82468,11 @@ class SubscribeAttributePumpConfigurationAndControlLifetimeRunningHours : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.LifetimeRunningHours response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75266,8 +82506,11 @@ class ReadPumpConfigurationAndControlPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Power response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl Power read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75311,6 +82554,11 @@ class SubscribeAttributePumpConfigurationAndControlPower : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.Power response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75345,8 +82593,11 @@ class ReadPumpConfigurationAndControlLifetimeEnergyConsumed : public ReadAttribu queue:callbackQueue]; [cluster readAttributeLifetimeEnergyConsumedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.LifetimeEnergyConsumed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl LifetimeEnergyConsumed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75382,7 +82633,10 @@ class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public WriteAttri params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLifetimeEnergyConsumedWithValue:value @@ -75391,6 +82645,8 @@ class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public WriteAttri if (error != nil) { LogNSError( "PumpConfigurationAndControl LifetimeEnergyConsumed write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75398,7 +82654,7 @@ class WritePumpConfigurationAndControlLifetimeEnergyConsumed : public WriteAttri } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed : public SubscribeAttribute { @@ -75438,6 +82694,11 @@ class SubscribeAttributePumpConfigurationAndControlLifetimeEnergyConsumed : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.LifetimeEnergyConsumed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75471,8 +82732,11 @@ class ReadPumpConfigurationAndControlOperationMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOperationModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.OperationMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl OperationMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75514,6 +82778,8 @@ class WritePumpConfigurationAndControlOperationMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("PumpConfigurationAndControl OperationMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75560,6 +82826,11 @@ class SubscribeAttributePumpConfigurationAndControlOperationMode : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.OperationMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75593,8 +82864,11 @@ class ReadPumpConfigurationAndControlControlMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeControlModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.ControlMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl ControlMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75636,6 +82910,8 @@ class WritePumpConfigurationAndControlControlMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("PumpConfigurationAndControl ControlMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75682,6 +82958,11 @@ class SubscribeAttributePumpConfigurationAndControlControlMode : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.ControlMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75716,8 +82997,11 @@ class ReadPumpConfigurationAndControlGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75762,6 +83046,11 @@ class SubscribeAttributePumpConfigurationAndControlGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75796,8 +83085,11 @@ class ReadPumpConfigurationAndControlAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75842,6 +83134,11 @@ class SubscribeAttributePumpConfigurationAndControlAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75877,8 +83174,11 @@ class ReadPumpConfigurationAndControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -75922,6 +83222,11 @@ class SubscribeAttributePumpConfigurationAndControlEventList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -75957,8 +83262,11 @@ class ReadPumpConfigurationAndControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76002,6 +83310,11 @@ class SubscribeAttributePumpConfigurationAndControlAttributeList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76035,8 +83348,11 @@ class ReadPumpConfigurationAndControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76080,6 +83396,11 @@ class SubscribeAttributePumpConfigurationAndControlFeatureMap : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76113,8 +83434,11 @@ class ReadPumpConfigurationAndControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PumpConfigurationAndControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76158,6 +83482,11 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PumpConfigurationAndControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76273,6 +83602,8 @@ class ThermostatSetpointRaiseLower : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -76349,6 +83680,8 @@ class ThermostatSetWeeklySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -76402,10 +83735,20 @@ class ThermostatGetWeeklySchedule : public ClusterCommand { completion:^(MTRThermostatClusterGetWeeklyScheduleResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -76454,6 +83797,8 @@ class ThermostatClearWeeklySchedule : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -76492,8 +83837,11 @@ class ReadThermostatLocalTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocalTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.LocalTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat LocalTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76537,6 +83885,11 @@ class SubscribeAttributeThermostatLocalTemperature : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.LocalTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76570,8 +83923,11 @@ class ReadThermostatOutdoorTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOutdoorTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OutdoorTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OutdoorTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76615,6 +83971,11 @@ class SubscribeAttributeThermostatOutdoorTemperature : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OutdoorTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76648,8 +84009,11 @@ class ReadThermostatOccupancy : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupancyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.Occupancy response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat Occupancy read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76693,6 +84057,11 @@ class SubscribeAttributeThermostatOccupancy : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.Occupancy response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76726,8 +84095,11 @@ class ReadThermostatAbsMinHeatSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAbsMinHeatSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMinHeatSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AbsMinHeatSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76771,6 +84143,11 @@ class SubscribeAttributeThermostatAbsMinHeatSetpointLimit : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMinHeatSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76804,8 +84181,11 @@ class ReadThermostatAbsMaxHeatSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAbsMaxHeatSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMaxHeatSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AbsMaxHeatSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76849,6 +84229,11 @@ class SubscribeAttributeThermostatAbsMaxHeatSetpointLimit : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMaxHeatSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76882,8 +84267,11 @@ class ReadThermostatAbsMinCoolSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAbsMinCoolSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMinCoolSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AbsMinCoolSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -76927,6 +84315,11 @@ class SubscribeAttributeThermostatAbsMinCoolSetpointLimit : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMinCoolSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -76960,8 +84353,11 @@ class ReadThermostatAbsMaxCoolSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAbsMaxCoolSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMaxCoolSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AbsMaxCoolSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77005,6 +84401,11 @@ class SubscribeAttributeThermostatAbsMaxCoolSetpointLimit : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AbsMaxCoolSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77038,8 +84439,11 @@ class ReadThermostatPICoolingDemand : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePICoolingDemandWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.PICoolingDemand response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat PICoolingDemand read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77083,6 +84487,11 @@ class SubscribeAttributeThermostatPICoolingDemand : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.PICoolingDemand response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77116,8 +84525,11 @@ class ReadThermostatPIHeatingDemand : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePIHeatingDemandWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.PIHeatingDemand response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat PIHeatingDemand read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77161,6 +84573,11 @@ class SubscribeAttributeThermostatPIHeatingDemand : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.PIHeatingDemand response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77194,8 +84611,11 @@ class ReadThermostatHVACSystemTypeConfiguration : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeHVACSystemTypeConfigurationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.HVACSystemTypeConfiguration response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat HVACSystemTypeConfiguration read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77238,6 +84658,8 @@ class WriteThermostatHVACSystemTypeConfiguration : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat HVACSystemTypeConfiguration write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77284,6 +84706,11 @@ class SubscribeAttributeThermostatHVACSystemTypeConfiguration : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.HVACSystemTypeConfiguration response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77317,8 +84744,11 @@ class ReadThermostatLocalTemperatureCalibration : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLocalTemperatureCalibrationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.LocalTemperatureCalibration response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat LocalTemperatureCalibration read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77361,6 +84791,8 @@ class WriteThermostatLocalTemperatureCalibration : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat LocalTemperatureCalibration write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77407,6 +84839,11 @@ class SubscribeAttributeThermostatLocalTemperatureCalibration : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.LocalTemperatureCalibration response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77440,8 +84877,11 @@ class ReadThermostatOccupiedCoolingSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedCoolingSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedCoolingSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedCoolingSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77483,6 +84923,8 @@ class WriteThermostatOccupiedCoolingSetpoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat OccupiedCoolingSetpoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77529,6 +84971,11 @@ class SubscribeAttributeThermostatOccupiedCoolingSetpoint : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedCoolingSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77562,8 +85009,11 @@ class ReadThermostatOccupiedHeatingSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedHeatingSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedHeatingSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedHeatingSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77605,6 +85055,8 @@ class WriteThermostatOccupiedHeatingSetpoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat OccupiedHeatingSetpoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77651,6 +85103,11 @@ class SubscribeAttributeThermostatOccupiedHeatingSetpoint : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedHeatingSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77684,8 +85141,11 @@ class ReadThermostatUnoccupiedCoolingSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedCoolingSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedCoolingSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedCoolingSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77728,6 +85188,8 @@ class WriteThermostatUnoccupiedCoolingSetpoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat UnoccupiedCoolingSetpoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77774,6 +85236,11 @@ class SubscribeAttributeThermostatUnoccupiedCoolingSetpoint : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedCoolingSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77807,8 +85274,11 @@ class ReadThermostatUnoccupiedHeatingSetpoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedHeatingSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedHeatingSetpoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedHeatingSetpoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77851,6 +85321,8 @@ class WriteThermostatUnoccupiedHeatingSetpoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat UnoccupiedHeatingSetpoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77897,6 +85369,11 @@ class SubscribeAttributeThermostatUnoccupiedHeatingSetpoint : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedHeatingSetpoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -77930,8 +85407,11 @@ class ReadThermostatMinHeatSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinHeatSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinHeatSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MinHeatSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -77973,6 +85453,8 @@ class WriteThermostatMinHeatSetpointLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MinHeatSetpointLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78019,6 +85501,11 @@ class SubscribeAttributeThermostatMinHeatSetpointLimit : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinHeatSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78052,8 +85539,11 @@ class ReadThermostatMaxHeatSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxHeatSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MaxHeatSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MaxHeatSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78095,6 +85585,8 @@ class WriteThermostatMaxHeatSetpointLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MaxHeatSetpointLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78141,6 +85633,11 @@ class SubscribeAttributeThermostatMaxHeatSetpointLimit : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MaxHeatSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78174,8 +85671,11 @@ class ReadThermostatMinCoolSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinCoolSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinCoolSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MinCoolSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78217,6 +85717,8 @@ class WriteThermostatMinCoolSetpointLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MinCoolSetpointLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78263,6 +85765,11 @@ class SubscribeAttributeThermostatMinCoolSetpointLimit : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinCoolSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78296,8 +85803,11 @@ class ReadThermostatMaxCoolSetpointLimit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxCoolSetpointLimitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MaxCoolSetpointLimit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MaxCoolSetpointLimit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78339,6 +85849,8 @@ class WriteThermostatMaxCoolSetpointLimit : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MaxCoolSetpointLimit write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78385,6 +85897,11 @@ class SubscribeAttributeThermostatMaxCoolSetpointLimit : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MaxCoolSetpointLimit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78418,8 +85935,11 @@ class ReadThermostatMinSetpointDeadBand : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinSetpointDeadBandWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinSetpointDeadBand response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat MinSetpointDeadBand read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78461,6 +85981,8 @@ class WriteThermostatMinSetpointDeadBand : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat MinSetpointDeadBand write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78507,6 +86029,11 @@ class SubscribeAttributeThermostatMinSetpointDeadBand : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.MinSetpointDeadBand response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78540,8 +86067,11 @@ class ReadThermostatRemoteSensing : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRemoteSensingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.RemoteSensing response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat RemoteSensing read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78583,6 +86113,8 @@ class WriteThermostatRemoteSensing : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat RemoteSensing write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78629,6 +86161,11 @@ class SubscribeAttributeThermostatRemoteSensing : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.RemoteSensing response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78662,8 +86199,11 @@ class ReadThermostatControlSequenceOfOperation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeControlSequenceOfOperationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ControlSequenceOfOperation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ControlSequenceOfOperation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78706,6 +86246,8 @@ class WriteThermostatControlSequenceOfOperation : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ControlSequenceOfOperation write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78752,6 +86294,11 @@ class SubscribeAttributeThermostatControlSequenceOfOperation : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ControlSequenceOfOperation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78785,8 +86332,11 @@ class ReadThermostatSystemMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSystemModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SystemMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat SystemMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78828,6 +86378,8 @@ class WriteThermostatSystemMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat SystemMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78874,6 +86426,11 @@ class SubscribeAttributeThermostatSystemMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SystemMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78907,8 +86464,11 @@ class ReadThermostatThermostatRunningMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeThermostatRunningModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatRunningMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ThermostatRunningMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -78952,6 +86512,11 @@ class SubscribeAttributeThermostatThermostatRunningMode : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatRunningMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -78985,8 +86550,11 @@ class ReadThermostatStartOfWeek : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartOfWeekWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.StartOfWeek response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat StartOfWeek read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79030,6 +86598,11 @@ class SubscribeAttributeThermostatStartOfWeek : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.StartOfWeek response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79063,8 +86636,11 @@ class ReadThermostatNumberOfWeeklyTransitions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfWeeklyTransitionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.NumberOfWeeklyTransitions response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat NumberOfWeeklyTransitions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79108,6 +86684,11 @@ class SubscribeAttributeThermostatNumberOfWeeklyTransitions : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.NumberOfWeeklyTransitions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79141,8 +86722,11 @@ class ReadThermostatNumberOfDailyTransitions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfDailyTransitionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.NumberOfDailyTransitions response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat NumberOfDailyTransitions read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79186,6 +86770,11 @@ class SubscribeAttributeThermostatNumberOfDailyTransitions : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.NumberOfDailyTransitions response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79219,8 +86808,11 @@ class ReadThermostatTemperatureSetpointHold : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTemperatureSetpointHoldWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.TemperatureSetpointHold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat TemperatureSetpointHold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79262,6 +86854,8 @@ class WriteThermostatTemperatureSetpointHold : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat TemperatureSetpointHold write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79308,6 +86902,11 @@ class SubscribeAttributeThermostatTemperatureSetpointHold : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.TemperatureSetpointHold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79342,8 +86941,11 @@ class ReadThermostatTemperatureSetpointHoldDuration : public ReadAttribute { [cluster readAttributeTemperatureSetpointHoldDurationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.TemperatureSetpointHoldDuration response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat TemperatureSetpointHoldDuration read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79378,7 +86980,10 @@ class WriteThermostatTemperatureSetpointHoldDuration : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeTemperatureSetpointHoldDurationWithValue:value @@ -79387,6 +86992,8 @@ class WriteThermostatTemperatureSetpointHoldDuration : public WriteAttribute { if (error != nil) { LogNSError("Thermostat TemperatureSetpointHoldDuration write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79394,7 +87001,7 @@ class WriteThermostatTemperatureSetpointHoldDuration : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeThermostatTemperatureSetpointHoldDuration : public SubscribeAttribute { @@ -79433,6 +87040,11 @@ class SubscribeAttributeThermostatTemperatureSetpointHoldDuration : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.TemperatureSetpointHoldDuration response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79468,8 +87080,11 @@ class ReadThermostatThermostatProgrammingOperationMode : public ReadAttribute { [cluster readAttributeThermostatProgrammingOperationModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatProgrammingOperationMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ThermostatProgrammingOperationMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79515,6 +87130,8 @@ class WriteThermostatThermostatProgrammingOperationMode : public WriteAttribute LogNSError( "Thermostat ThermostatProgrammingOperationMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79561,6 +87178,11 @@ class SubscribeAttributeThermostatThermostatProgrammingOperationMode : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatProgrammingOperationMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79594,8 +87216,11 @@ class ReadThermostatThermostatRunningState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeThermostatRunningStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatRunningState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ThermostatRunningState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79639,6 +87264,11 @@ class SubscribeAttributeThermostatThermostatRunningState : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ThermostatRunningState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79672,8 +87302,11 @@ class ReadThermostatSetpointChangeSource : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSetpointChangeSourceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeSource response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat SetpointChangeSource read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79717,6 +87350,11 @@ class SubscribeAttributeThermostatSetpointChangeSource : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeSource response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79750,8 +87388,11 @@ class ReadThermostatSetpointChangeAmount : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSetpointChangeAmountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeAmount response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat SetpointChangeAmount read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79795,6 +87436,11 @@ class SubscribeAttributeThermostatSetpointChangeAmount : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeAmount response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79828,8 +87474,11 @@ class ReadThermostatSetpointChangeSourceTimestamp : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSetpointChangeSourceTimestampWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeSourceTimestamp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat SetpointChangeSourceTimestamp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79873,6 +87522,11 @@ class SubscribeAttributeThermostatSetpointChangeSourceTimestamp : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.SetpointChangeSourceTimestamp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -79906,8 +87560,11 @@ class ReadThermostatOccupiedSetback : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedSetbackWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetback response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedSetback read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79942,13 +87599,18 @@ class WriteThermostatOccupiedSetback : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeOccupiedSetbackWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat OccupiedSetback write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -79956,7 +87618,7 @@ class WriteThermostatOccupiedSetback : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeThermostatOccupiedSetback : public SubscribeAttribute { @@ -79995,6 +87657,11 @@ class SubscribeAttributeThermostatOccupiedSetback : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetback response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80028,8 +87695,11 @@ class ReadThermostatOccupiedSetbackMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedSetbackMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetbackMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedSetbackMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80073,6 +87743,11 @@ class SubscribeAttributeThermostatOccupiedSetbackMin : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetbackMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80106,8 +87781,11 @@ class ReadThermostatOccupiedSetbackMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupiedSetbackMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetbackMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat OccupiedSetbackMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80151,6 +87829,11 @@ class SubscribeAttributeThermostatOccupiedSetbackMax : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.OccupiedSetbackMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80184,8 +87867,11 @@ class ReadThermostatUnoccupiedSetback : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedSetbackWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetback response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedSetback read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80220,13 +87906,18 @@ class WriteThermostatUnoccupiedSetback : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeUnoccupiedSetbackWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat UnoccupiedSetback write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80234,7 +87925,7 @@ class WriteThermostatUnoccupiedSetback : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeThermostatUnoccupiedSetback : public SubscribeAttribute { @@ -80273,6 +87964,11 @@ class SubscribeAttributeThermostatUnoccupiedSetback : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetback response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80306,8 +88002,11 @@ class ReadThermostatUnoccupiedSetbackMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedSetbackMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetbackMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedSetbackMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80351,6 +88050,11 @@ class SubscribeAttributeThermostatUnoccupiedSetbackMin : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetbackMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80384,8 +88088,11 @@ class ReadThermostatUnoccupiedSetbackMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnoccupiedSetbackMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetbackMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat UnoccupiedSetbackMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80429,6 +88136,11 @@ class SubscribeAttributeThermostatUnoccupiedSetbackMax : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.UnoccupiedSetbackMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80462,8 +88174,11 @@ class ReadThermostatEmergencyHeatDelta : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEmergencyHeatDeltaWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.EmergencyHeatDelta response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat EmergencyHeatDelta read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80505,6 +88220,8 @@ class WriteThermostatEmergencyHeatDelta : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat EmergencyHeatDelta write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80551,6 +88268,11 @@ class SubscribeAttributeThermostatEmergencyHeatDelta : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.EmergencyHeatDelta response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80584,8 +88306,11 @@ class ReadThermostatACType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80627,6 +88352,8 @@ class WriteThermostatACType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80673,6 +88400,11 @@ class SubscribeAttributeThermostatACType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80706,8 +88438,11 @@ class ReadThermostatACCapacity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACCapacityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCapacity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACCapacity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80749,6 +88484,8 @@ class WriteThermostatACCapacity : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACCapacity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80795,6 +88532,11 @@ class SubscribeAttributeThermostatACCapacity : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCapacity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80828,8 +88570,11 @@ class ReadThermostatACRefrigerantType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACRefrigerantTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACRefrigerantType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACRefrigerantType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80871,6 +88616,8 @@ class WriteThermostatACRefrigerantType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACRefrigerantType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80917,6 +88664,11 @@ class SubscribeAttributeThermostatACRefrigerantType : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACRefrigerantType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -80950,8 +88702,11 @@ class ReadThermostatACCompressorType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACCompressorTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCompressorType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACCompressorType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -80993,6 +88748,8 @@ class WriteThermostatACCompressorType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACCompressorType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81039,6 +88796,11 @@ class SubscribeAttributeThermostatACCompressorType : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCompressorType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81072,8 +88834,11 @@ class ReadThermostatACErrorCode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACErrorCodeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACErrorCode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACErrorCode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81115,6 +88880,8 @@ class WriteThermostatACErrorCode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACErrorCode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81161,6 +88928,11 @@ class SubscribeAttributeThermostatACErrorCode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACErrorCode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81194,8 +88966,11 @@ class ReadThermostatACLouverPosition : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACLouverPositionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACLouverPosition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACLouverPosition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81237,6 +89012,8 @@ class WriteThermostatACLouverPosition : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACLouverPosition write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81283,6 +89060,11 @@ class SubscribeAttributeThermostatACLouverPosition : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACLouverPosition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81316,8 +89098,11 @@ class ReadThermostatACCoilTemperature : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACCoilTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCoilTemperature response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACCoilTemperature read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81361,6 +89146,11 @@ class SubscribeAttributeThermostatACCoilTemperature : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCoilTemperature response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81394,8 +89184,11 @@ class ReadThermostatACCapacityformat : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeACCapacityformatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCapacityformat response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ACCapacityformat read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81437,6 +89230,8 @@ class WriteThermostatACCapacityformat : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("Thermostat ACCapacityformat write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81483,6 +89278,11 @@ class SubscribeAttributeThermostatACCapacityformat : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ACCapacityformat response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81516,8 +89316,11 @@ class ReadThermostatGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81561,6 +89364,11 @@ class SubscribeAttributeThermostatGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81594,8 +89402,11 @@ class ReadThermostatAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81639,6 +89450,11 @@ class SubscribeAttributeThermostatAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81674,8 +89490,11 @@ class ReadThermostatEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81719,6 +89538,11 @@ class SubscribeAttributeThermostatEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81754,8 +89578,11 @@ class ReadThermostatAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81799,6 +89626,11 @@ class SubscribeAttributeThermostatAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81832,8 +89664,11 @@ class ReadThermostatFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81877,6 +89712,11 @@ class SubscribeAttributeThermostatFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -81910,8 +89750,11 @@ class ReadThermostatClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Thermostat ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -81955,6 +89798,11 @@ class SubscribeAttributeThermostatClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Thermostat.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82041,6 +89889,7 @@ class FanControlStep : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -82082,8 +89931,11 @@ class ReadFanControlFanMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFanModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FanMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl FanMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82125,6 +89977,8 @@ class WriteFanControlFanMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl FanMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82171,6 +90025,11 @@ class SubscribeAttributeFanControlFanMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FanMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82204,8 +90063,11 @@ class ReadFanControlFanModeSequence : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFanModeSequenceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FanModeSequence response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl FanModeSequence read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82247,6 +90109,8 @@ class WriteFanControlFanModeSequence : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl FanModeSequence write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82293,6 +90157,11 @@ class SubscribeAttributeFanControlFanModeSequence : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FanModeSequence response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82326,8 +90195,11 @@ class ReadFanControlPercentSetting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePercentSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.PercentSetting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl PercentSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82362,13 +90234,18 @@ class WriteFanControlPercentSetting : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributePercentSettingWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl PercentSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82376,7 +90253,7 @@ class WriteFanControlPercentSetting : public WriteAttribute { } private: - chip::Percent mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeFanControlPercentSetting : public SubscribeAttribute { @@ -82415,6 +90292,11 @@ class SubscribeAttributeFanControlPercentSetting : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.PercentSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82448,8 +90330,11 @@ class ReadFanControlPercentCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePercentCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.PercentCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl PercentCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82493,6 +90378,11 @@ class SubscribeAttributeFanControlPercentCurrent : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.PercentCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82526,8 +90416,11 @@ class ReadFanControlSpeedMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpeedMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl SpeedMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82571,6 +90464,11 @@ class SubscribeAttributeFanControlSpeedMax : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82604,8 +90502,11 @@ class ReadFanControlSpeedSetting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpeedSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedSetting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl SpeedSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82640,13 +90541,18 @@ class WriteFanControlSpeedSetting : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeSpeedSettingWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl SpeedSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82654,7 +90560,7 @@ class WriteFanControlSpeedSetting : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeFanControlSpeedSetting : public SubscribeAttribute { @@ -82693,6 +90599,11 @@ class SubscribeAttributeFanControlSpeedSetting : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82726,8 +90637,11 @@ class ReadFanControlSpeedCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSpeedCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl SpeedCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82771,6 +90685,11 @@ class SubscribeAttributeFanControlSpeedCurrent : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.SpeedCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82804,8 +90723,11 @@ class ReadFanControlRockSupport : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRockSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.RockSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl RockSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82849,6 +90771,11 @@ class SubscribeAttributeFanControlRockSupport : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.RockSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -82882,8 +90809,11 @@ class ReadFanControlRockSetting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRockSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.RockSetting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl RockSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82925,6 +90855,8 @@ class WriteFanControlRockSetting : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl RockSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -82971,6 +90903,11 @@ class SubscribeAttributeFanControlRockSetting : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.RockSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83004,8 +90941,11 @@ class ReadFanControlWindSupport : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWindSupportWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.WindSupport response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl WindSupport read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83049,6 +90989,11 @@ class SubscribeAttributeFanControlWindSupport : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.WindSupport response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83082,8 +91027,11 @@ class ReadFanControlWindSetting : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWindSettingWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.WindSetting response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl WindSetting read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83125,6 +91073,8 @@ class WriteFanControlWindSetting : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl WindSetting write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83171,6 +91121,11 @@ class SubscribeAttributeFanControlWindSetting : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.WindSetting response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83206,8 +91161,11 @@ class ReadFanControlAirflowDirection : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAirflowDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AirflowDirection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl AirflowDirection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83249,6 +91207,8 @@ class WriteFanControlAirflowDirection : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("FanControl AirflowDirection write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83295,6 +91255,11 @@ class SubscribeAttributeFanControlAirflowDirection : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AirflowDirection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83330,8 +91295,11 @@ class ReadFanControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83375,6 +91343,11 @@ class SubscribeAttributeFanControlGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83408,8 +91381,11 @@ class ReadFanControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83453,6 +91429,11 @@ class SubscribeAttributeFanControlAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83488,8 +91469,11 @@ class ReadFanControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83533,6 +91517,11 @@ class SubscribeAttributeFanControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83568,8 +91557,11 @@ class ReadFanControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83613,6 +91605,11 @@ class SubscribeAttributeFanControlAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83646,8 +91643,11 @@ class ReadFanControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83691,6 +91691,11 @@ class SubscribeAttributeFanControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83724,8 +91729,11 @@ class ReadFanControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FanControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83769,6 +91777,11 @@ class SubscribeAttributeFanControlClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FanControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83822,8 +91835,11 @@ class ReadThermostatUserInterfaceConfigurationTemperatureDisplayMode : public Re queue:callbackQueue]; [cluster readAttributeTemperatureDisplayModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.TemperatureDisplayMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration TemperatureDisplayMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83868,6 +91884,8 @@ class WriteThermostatUserInterfaceConfigurationTemperatureDisplayMode : public W LogNSError("ThermostatUserInterfaceConfiguration " "TemperatureDisplayMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83915,6 +91933,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationTemperatureDisplayMo } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.TemperatureDisplayMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -83949,8 +91972,11 @@ class ReadThermostatUserInterfaceConfigurationKeypadLockout : public ReadAttribu queue:callbackQueue]; [cluster readAttributeKeypadLockoutWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.KeypadLockout response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration KeypadLockout read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -83994,6 +92020,8 @@ class WriteThermostatUserInterfaceConfigurationKeypadLockout : public WriteAttri completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ThermostatUserInterfaceConfiguration KeypadLockout write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84041,6 +92069,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationKeypadLockout : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.KeypadLockout response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84075,8 +92108,11 @@ class ReadThermostatUserInterfaceConfigurationScheduleProgrammingVisibility : pu queue:callbackQueue]; [cluster readAttributeScheduleProgrammingVisibilityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.ScheduleProgrammingVisibility response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration ScheduleProgrammingVisibility read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84121,6 +92157,8 @@ class WriteThermostatUserInterfaceConfigurationScheduleProgrammingVisibility : p LogNSError("ThermostatUserInterfaceConfiguration " "ScheduleProgrammingVisibility write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84168,6 +92206,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationScheduleProgrammingV } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.ScheduleProgrammingVisibility response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84202,8 +92245,11 @@ class ReadThermostatUserInterfaceConfigurationGeneratedCommandList : public Read queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84248,6 +92294,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationGeneratedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84282,8 +92333,11 @@ class ReadThermostatUserInterfaceConfigurationAcceptedCommandList : public ReadA queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84328,6 +92382,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationAcceptedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84364,8 +92423,11 @@ class ReadThermostatUserInterfaceConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84410,6 +92472,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationEventList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84446,8 +92513,11 @@ class ReadThermostatUserInterfaceConfigurationAttributeList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84492,6 +92562,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationAttributeList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84526,8 +92601,11 @@ class ReadThermostatUserInterfaceConfigurationFeatureMap : public ReadAttribute queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84572,6 +92650,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationFeatureMap : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84606,8 +92689,11 @@ class ReadThermostatUserInterfaceConfigurationClusterRevision : public ReadAttri queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ThermostatUserInterfaceConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -84652,6 +92738,11 @@ class SubscribeAttributeThermostatUserInterfaceConfigurationClusterRevision : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ThermostatUserInterfaceConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -84785,17 +92876,19 @@ class ColorControlMoveToHue : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToHueWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveToHueWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -84847,6 +92940,7 @@ class ColorControlMoveHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -84905,6 +92999,7 @@ class ColorControlStepHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -84961,6 +93056,8 @@ class ColorControlMoveToSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85017,6 +93114,8 @@ class ColorControlMoveSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85075,6 +93174,8 @@ class ColorControlStepSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85133,6 +93234,8 @@ class ColorControlMoveToHueAndSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85185,17 +93288,19 @@ class ColorControlMoveToColor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveToColorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveToColorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85241,17 +93346,19 @@ class ColorControlMoveColor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster moveColorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + moveColorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85299,17 +93406,19 @@ class ColorControlStepColor : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stepColorWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stepColorWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85361,6 +93470,8 @@ class ColorControlMoveToColorTemperature : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85419,6 +93530,8 @@ class ColorControlEnhancedMoveToHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85475,6 +93588,8 @@ class ColorControlEnhancedMoveHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85533,6 +93648,8 @@ class ColorControlEnhancedStepHue : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85591,6 +93708,8 @@ class ColorControlEnhancedMoveToHueAndSaturation : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85647,17 +93766,19 @@ class ColorControlColorLoopSet : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster colorLoopSetWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + colorLoopSetWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85699,17 +93820,19 @@ class ColorControlStopMoveStep : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster stopMoveStepWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + stopMoveStepWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -85765,6 +93888,8 @@ class ColorControlMoveColorTemperature : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85827,6 +93952,8 @@ class ColorControlStepColorTemperature : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -85866,8 +93993,11 @@ class ReadColorControlCurrentHue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentHueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentHue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CurrentHue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -85911,6 +94041,11 @@ class SubscribeAttributeColorControlCurrentHue : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentHue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -85944,8 +94079,11 @@ class ReadColorControlCurrentSaturation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentSaturationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentSaturation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CurrentSaturation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -85989,6 +94127,11 @@ class SubscribeAttributeColorControlCurrentSaturation : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentSaturation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86022,8 +94165,11 @@ class ReadColorControlRemainingTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRemainingTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.RemainingTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl RemainingTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86067,6 +94213,11 @@ class SubscribeAttributeColorControlRemainingTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.RemainingTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86100,8 +94251,11 @@ class ReadColorControlCurrentX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CurrentX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86145,6 +94299,11 @@ class SubscribeAttributeColorControlCurrentX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86178,8 +94337,11 @@ class ReadColorControlCurrentY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CurrentY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86223,6 +94385,11 @@ class SubscribeAttributeColorControlCurrentY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CurrentY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86256,8 +94423,11 @@ class ReadColorControlDriftCompensation : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDriftCompensationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.DriftCompensation response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl DriftCompensation read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86301,6 +94471,11 @@ class SubscribeAttributeColorControlDriftCompensation : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.DriftCompensation response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86334,8 +94509,11 @@ class ReadColorControlCompensationText : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCompensationTextWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CompensationText response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CompensationText read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86379,6 +94557,11 @@ class SubscribeAttributeColorControlCompensationText : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CompensationText response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86412,8 +94595,11 @@ class ReadColorControlColorTemperatureMireds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorTemperatureMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTemperatureMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorTemperatureMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86457,6 +94643,11 @@ class SubscribeAttributeColorControlColorTemperatureMireds : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTemperatureMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86490,8 +94681,11 @@ class ReadColorControlColorMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86535,6 +94729,11 @@ class SubscribeAttributeColorControlColorMode : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86568,8 +94767,11 @@ class ReadColorControlOptions : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOptionsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Options response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Options read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86611,6 +94813,8 @@ class WriteColorControlOptions : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl Options write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86657,6 +94861,11 @@ class SubscribeAttributeColorControlOptions : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Options response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86690,8 +94899,11 @@ class ReadColorControlNumberOfPrimaries : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNumberOfPrimariesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.NumberOfPrimaries response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl NumberOfPrimaries read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86735,6 +94947,11 @@ class SubscribeAttributeColorControlNumberOfPrimaries : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.NumberOfPrimaries response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86768,8 +94985,11 @@ class ReadColorControlPrimary1X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary1XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary1X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86813,6 +95033,11 @@ class SubscribeAttributeColorControlPrimary1X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86846,8 +95071,11 @@ class ReadColorControlPrimary1Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary1YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary1Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86891,6 +95119,11 @@ class SubscribeAttributeColorControlPrimary1Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -86924,8 +95157,11 @@ class ReadColorControlPrimary1Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary1IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary1Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -86969,6 +95205,11 @@ class SubscribeAttributeColorControlPrimary1Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary1Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87002,8 +95243,11 @@ class ReadColorControlPrimary2X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary2XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary2X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87047,6 +95291,11 @@ class SubscribeAttributeColorControlPrimary2X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87080,8 +95329,11 @@ class ReadColorControlPrimary2Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary2YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary2Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87125,6 +95377,11 @@ class SubscribeAttributeColorControlPrimary2Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87158,8 +95415,11 @@ class ReadColorControlPrimary2Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary2IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary2Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87203,6 +95463,11 @@ class SubscribeAttributeColorControlPrimary2Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary2Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87236,8 +95501,11 @@ class ReadColorControlPrimary3X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary3XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary3X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87281,6 +95549,11 @@ class SubscribeAttributeColorControlPrimary3X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87314,8 +95587,11 @@ class ReadColorControlPrimary3Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary3YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary3Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87359,6 +95635,11 @@ class SubscribeAttributeColorControlPrimary3Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87392,8 +95673,11 @@ class ReadColorControlPrimary3Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary3IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary3Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87437,6 +95721,11 @@ class SubscribeAttributeColorControlPrimary3Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary3Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87470,8 +95759,11 @@ class ReadColorControlPrimary4X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary4XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary4X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87515,6 +95807,11 @@ class SubscribeAttributeColorControlPrimary4X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87548,8 +95845,11 @@ class ReadColorControlPrimary4Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary4YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary4Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87593,6 +95893,11 @@ class SubscribeAttributeColorControlPrimary4Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87626,8 +95931,11 @@ class ReadColorControlPrimary4Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary4IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary4Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87671,6 +95979,11 @@ class SubscribeAttributeColorControlPrimary4Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary4Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87704,8 +96017,11 @@ class ReadColorControlPrimary5X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary5XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary5X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87749,6 +96065,11 @@ class SubscribeAttributeColorControlPrimary5X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87782,8 +96103,11 @@ class ReadColorControlPrimary5Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary5YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary5Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87827,6 +96151,11 @@ class SubscribeAttributeColorControlPrimary5Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87860,8 +96189,11 @@ class ReadColorControlPrimary5Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary5IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary5Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87905,6 +96237,11 @@ class SubscribeAttributeColorControlPrimary5Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary5Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -87938,8 +96275,11 @@ class ReadColorControlPrimary6X : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary6XWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6X response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary6X read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -87983,6 +96323,11 @@ class SubscribeAttributeColorControlPrimary6X : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6X response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88016,8 +96361,11 @@ class ReadColorControlPrimary6Y : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary6YWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6Y response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary6Y read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88061,6 +96409,11 @@ class SubscribeAttributeColorControlPrimary6Y : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6Y response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88094,8 +96447,11 @@ class ReadColorControlPrimary6Intensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePrimary6IntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6Intensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl Primary6Intensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88139,6 +96495,11 @@ class SubscribeAttributeColorControlPrimary6Intensity : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.Primary6Intensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88172,8 +96533,11 @@ class ReadColorControlWhitePointX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWhitePointXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.WhitePointX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl WhitePointX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88215,6 +96579,8 @@ class WriteColorControlWhitePointX : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl WhitePointX write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88261,6 +96627,11 @@ class SubscribeAttributeColorControlWhitePointX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.WhitePointX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88294,8 +96665,11 @@ class ReadColorControlWhitePointY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWhitePointYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.WhitePointY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl WhitePointY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88337,6 +96711,8 @@ class WriteColorControlWhitePointY : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl WhitePointY write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88383,6 +96759,11 @@ class SubscribeAttributeColorControlWhitePointY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.WhitePointY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88416,8 +96797,11 @@ class ReadColorControlColorPointRX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointRXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointRX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88459,6 +96843,8 @@ class WriteColorControlColorPointRX : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointRX write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88505,6 +96891,11 @@ class SubscribeAttributeColorControlColorPointRX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88538,8 +96929,11 @@ class ReadColorControlColorPointRY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointRYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointRY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88581,6 +96975,8 @@ class WriteColorControlColorPointRY : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointRY write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88627,6 +97023,11 @@ class SubscribeAttributeColorControlColorPointRY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88660,8 +97061,11 @@ class ReadColorControlColorPointRIntensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointRIntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRIntensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointRIntensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88696,13 +97100,18 @@ class WriteColorControlColorPointRIntensity : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeColorPointRIntensityWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointRIntensity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88710,7 +97119,7 @@ class WriteColorControlColorPointRIntensity : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeColorControlColorPointRIntensity : public SubscribeAttribute { @@ -88749,6 +97158,11 @@ class SubscribeAttributeColorControlColorPointRIntensity : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointRIntensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88782,8 +97196,11 @@ class ReadColorControlColorPointGX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointGXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointGX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88825,6 +97242,8 @@ class WriteColorControlColorPointGX : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointGX write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88871,6 +97290,11 @@ class SubscribeAttributeColorControlColorPointGX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -88904,8 +97328,11 @@ class ReadColorControlColorPointGY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointGYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointGY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88947,6 +97374,8 @@ class WriteColorControlColorPointGY : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointGY write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -88993,6 +97422,11 @@ class SubscribeAttributeColorControlColorPointGY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89026,8 +97460,11 @@ class ReadColorControlColorPointGIntensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointGIntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGIntensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointGIntensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89062,13 +97499,18 @@ class WriteColorControlColorPointGIntensity : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeColorPointGIntensityWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointGIntensity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89076,7 +97518,7 @@ class WriteColorControlColorPointGIntensity : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeColorControlColorPointGIntensity : public SubscribeAttribute { @@ -89115,6 +97557,11 @@ class SubscribeAttributeColorControlColorPointGIntensity : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointGIntensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89148,8 +97595,11 @@ class ReadColorControlColorPointBX : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointBXWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBX response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointBX read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89191,6 +97641,8 @@ class WriteColorControlColorPointBX : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointBX write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89237,6 +97689,11 @@ class SubscribeAttributeColorControlColorPointBX : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBX response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89270,8 +97727,11 @@ class ReadColorControlColorPointBY : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointBYWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBY response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointBY read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89313,6 +97773,8 @@ class WriteColorControlColorPointBY : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointBY write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89359,6 +97821,11 @@ class SubscribeAttributeColorControlColorPointBY : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBY response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89392,8 +97859,11 @@ class ReadColorControlColorPointBIntensity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorPointBIntensityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBIntensity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorPointBIntensity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89428,13 +97898,18 @@ class WriteColorControlColorPointBIntensity : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeColorPointBIntensityWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ColorControl ColorPointBIntensity write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89442,7 +97917,7 @@ class WriteColorControlColorPointBIntensity : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeColorControlColorPointBIntensity : public SubscribeAttribute { @@ -89481,6 +97956,11 @@ class SubscribeAttributeColorControlColorPointBIntensity : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorPointBIntensity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89514,8 +97994,11 @@ class ReadColorControlEnhancedCurrentHue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnhancedCurrentHueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EnhancedCurrentHue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl EnhancedCurrentHue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89559,6 +98042,11 @@ class SubscribeAttributeColorControlEnhancedCurrentHue : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EnhancedCurrentHue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89592,8 +98080,11 @@ class ReadColorControlEnhancedColorMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnhancedColorModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EnhancedColorMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl EnhancedColorMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89637,6 +98128,11 @@ class SubscribeAttributeColorControlEnhancedColorMode : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EnhancedColorMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89670,8 +98166,11 @@ class ReadColorControlColorLoopActive : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopActiveWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopActive response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopActive read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89715,6 +98214,11 @@ class SubscribeAttributeColorControlColorLoopActive : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopActive response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89748,8 +98252,11 @@ class ReadColorControlColorLoopDirection : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopDirectionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopDirection response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopDirection read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89793,6 +98300,11 @@ class SubscribeAttributeColorControlColorLoopDirection : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopDirection response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89826,8 +98338,11 @@ class ReadColorControlColorLoopTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89871,6 +98386,11 @@ class SubscribeAttributeColorControlColorLoopTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89904,8 +98424,11 @@ class ReadColorControlColorLoopStartEnhancedHue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopStartEnhancedHueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopStartEnhancedHue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopStartEnhancedHue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -89949,6 +98472,11 @@ class SubscribeAttributeColorControlColorLoopStartEnhancedHue : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopStartEnhancedHue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -89982,8 +98510,11 @@ class ReadColorControlColorLoopStoredEnhancedHue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorLoopStoredEnhancedHueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopStoredEnhancedHue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorLoopStoredEnhancedHue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90027,6 +98558,11 @@ class SubscribeAttributeColorControlColorLoopStoredEnhancedHue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorLoopStoredEnhancedHue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90060,8 +98596,11 @@ class ReadColorControlColorCapabilities : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorCapabilitiesWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorCapabilities response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorCapabilities read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90105,6 +98644,11 @@ class SubscribeAttributeColorControlColorCapabilities : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorCapabilities response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90138,8 +98682,11 @@ class ReadColorControlColorTempPhysicalMinMireds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorTempPhysicalMinMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTempPhysicalMinMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorTempPhysicalMinMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90183,6 +98730,11 @@ class SubscribeAttributeColorControlColorTempPhysicalMinMireds : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTempPhysicalMinMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90216,8 +98768,11 @@ class ReadColorControlColorTempPhysicalMaxMireds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeColorTempPhysicalMaxMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTempPhysicalMaxMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ColorTempPhysicalMaxMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90261,6 +98816,11 @@ class SubscribeAttributeColorControlColorTempPhysicalMaxMireds : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ColorTempPhysicalMaxMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90296,8 +98856,11 @@ class ReadColorControlCoupleColorTempToLevelMinMireds : public ReadAttribute { [cluster readAttributeCoupleColorTempToLevelMinMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CoupleColorTempToLevelMinMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl CoupleColorTempToLevelMinMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90341,6 +98904,11 @@ class SubscribeAttributeColorControlCoupleColorTempToLevelMinMireds : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.CoupleColorTempToLevelMinMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90374,8 +98942,11 @@ class ReadColorControlStartUpColorTemperatureMireds : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartUpColorTemperatureMiredsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.StartUpColorTemperatureMireds response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl StartUpColorTemperatureMireds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90410,7 +98981,10 @@ class WriteColorControlStartUpColorTemperatureMireds : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeStartUpColorTemperatureMiredsWithValue:value @@ -90419,6 +98993,8 @@ class WriteColorControlStartUpColorTemperatureMireds : public WriteAttribute { if (error != nil) { LogNSError( "ColorControl StartUpColorTemperatureMireds write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90426,7 +99002,7 @@ class WriteColorControlStartUpColorTemperatureMireds : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeColorControlStartUpColorTemperatureMireds : public SubscribeAttribute { @@ -90465,6 +99041,11 @@ class SubscribeAttributeColorControlStartUpColorTemperatureMireds : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.StartUpColorTemperatureMireds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90498,8 +99079,11 @@ class ReadColorControlGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90543,6 +99127,11 @@ class SubscribeAttributeColorControlGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90576,8 +99165,11 @@ class ReadColorControlAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90621,6 +99213,11 @@ class SubscribeAttributeColorControlAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90656,8 +99253,11 @@ class ReadColorControlEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90701,6 +99301,11 @@ class SubscribeAttributeColorControlEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90736,8 +99341,11 @@ class ReadColorControlAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90781,6 +99389,11 @@ class SubscribeAttributeColorControlAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90814,8 +99427,11 @@ class ReadColorControlFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90859,6 +99475,11 @@ class SubscribeAttributeColorControlFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -90892,8 +99513,11 @@ class ReadColorControlClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ColorControl ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -90937,6 +99561,11 @@ class SubscribeAttributeColorControlClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ColorControl.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91000,8 +99629,11 @@ class ReadBallastConfigurationPhysicalMinLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhysicalMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.PhysicalMinLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration PhysicalMinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91045,6 +99677,11 @@ class SubscribeAttributeBallastConfigurationPhysicalMinLevel : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.PhysicalMinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91078,8 +99715,11 @@ class ReadBallastConfigurationPhysicalMaxLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePhysicalMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.PhysicalMaxLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration PhysicalMaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91123,6 +99763,11 @@ class SubscribeAttributeBallastConfigurationPhysicalMaxLevel : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.PhysicalMaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91156,8 +99801,11 @@ class ReadBallastConfigurationBallastStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBallastStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.BallastStatus response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration BallastStatus read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91201,6 +99849,11 @@ class SubscribeAttributeBallastConfigurationBallastStatus : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.BallastStatus response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91234,8 +99887,11 @@ class ReadBallastConfigurationMinLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.MinLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration MinLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91277,6 +99933,8 @@ class WriteBallastConfigurationMinLevel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration MinLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91323,6 +99981,11 @@ class SubscribeAttributeBallastConfigurationMinLevel : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.MinLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91356,8 +100019,11 @@ class ReadBallastConfigurationMaxLevel : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.MaxLevel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration MaxLevel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91399,6 +100065,8 @@ class WriteBallastConfigurationMaxLevel : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration MaxLevel write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91445,6 +100113,11 @@ class SubscribeAttributeBallastConfigurationMaxLevel : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.MaxLevel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91478,8 +100151,11 @@ class ReadBallastConfigurationIntrinsicBallastFactor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeIntrinsicBallastFactorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.IntrinsicBallastFactor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration IntrinsicBallastFactor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91514,7 +100190,10 @@ class WriteBallastConfigurationIntrinsicBallastFactor : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeIntrinsicBallastFactorWithValue:value @@ -91522,6 +100201,8 @@ class WriteBallastConfigurationIntrinsicBallastFactor : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration IntrinsicBallastFactor write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91529,7 +100210,7 @@ class WriteBallastConfigurationIntrinsicBallastFactor : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationIntrinsicBallastFactor : public SubscribeAttribute { @@ -91568,6 +100249,11 @@ class SubscribeAttributeBallastConfigurationIntrinsicBallastFactor : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.IntrinsicBallastFactor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91602,8 +100288,11 @@ class ReadBallastConfigurationBallastFactorAdjustment : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBallastFactorAdjustmentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.BallastFactorAdjustment response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration BallastFactorAdjustment read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91639,7 +100328,10 @@ class WriteBallastConfigurationBallastFactorAdjustment : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeBallastFactorAdjustmentWithValue:value params:params @@ -91647,6 +100339,8 @@ class WriteBallastConfigurationBallastFactorAdjustment : public WriteAttribute { if (error != nil) { LogNSError( "BallastConfiguration BallastFactorAdjustment write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91654,7 +100348,7 @@ class WriteBallastConfigurationBallastFactorAdjustment : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationBallastFactorAdjustment : public SubscribeAttribute { @@ -91693,6 +100387,11 @@ class SubscribeAttributeBallastConfigurationBallastFactorAdjustment : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.BallastFactorAdjustment response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91726,8 +100425,11 @@ class ReadBallastConfigurationLampQuantity : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampQuantityWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampQuantity response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampQuantity read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91771,6 +100473,11 @@ class SubscribeAttributeBallastConfigurationLampQuantity : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampQuantity response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91804,8 +100511,11 @@ class ReadBallastConfigurationLampType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampTypeWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91849,6 +100559,8 @@ class WriteBallastConfigurationLampType : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampType write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91895,6 +100607,11 @@ class SubscribeAttributeBallastConfigurationLampType : public SubscribeAttribute } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -91928,8 +100645,11 @@ class ReadBallastConfigurationLampManufacturer : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampManufacturerWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampManufacturer response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampManufacturer read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -91973,6 +100693,8 @@ class WriteBallastConfigurationLampManufacturer : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampManufacturer write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92019,6 +100741,11 @@ class SubscribeAttributeBallastConfigurationLampManufacturer : public SubscribeA } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampManufacturer response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92052,8 +100779,11 @@ class ReadBallastConfigurationLampRatedHours : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampRatedHoursWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampRatedHours response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampRatedHours read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92088,13 +100818,18 @@ class WriteBallastConfigurationLampRatedHours : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLampRatedHoursWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampRatedHours write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92102,7 +100837,7 @@ class WriteBallastConfigurationLampRatedHours : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationLampRatedHours : public SubscribeAttribute { @@ -92141,6 +100876,11 @@ class SubscribeAttributeBallastConfigurationLampRatedHours : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampRatedHours response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92174,8 +100914,11 @@ class ReadBallastConfigurationLampBurnHours : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampBurnHoursWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampBurnHours response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampBurnHours read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92210,13 +100953,18 @@ class WriteBallastConfigurationLampBurnHours : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLampBurnHoursWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampBurnHours write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92224,7 +100972,7 @@ class WriteBallastConfigurationLampBurnHours : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationLampBurnHours : public SubscribeAttribute { @@ -92263,6 +101011,11 @@ class SubscribeAttributeBallastConfigurationLampBurnHours : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampBurnHours response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92296,8 +101049,11 @@ class ReadBallastConfigurationLampAlarmMode : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampAlarmModeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampAlarmMode response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampAlarmMode read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92339,6 +101095,8 @@ class WriteBallastConfigurationLampAlarmMode : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampAlarmMode write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92385,6 +101143,11 @@ class SubscribeAttributeBallastConfigurationLampAlarmMode : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampAlarmMode response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92418,8 +101181,11 @@ class ReadBallastConfigurationLampBurnHoursTripPoint : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLampBurnHoursTripPointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampBurnHoursTripPoint response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration LampBurnHoursTripPoint read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92454,7 +101220,10 @@ class WriteBallastConfigurationLampBurnHoursTripPoint : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeLampBurnHoursTripPointWithValue:value @@ -92462,6 +101231,8 @@ class WriteBallastConfigurationLampBurnHoursTripPoint : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("BallastConfiguration LampBurnHoursTripPoint write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92469,7 +101240,7 @@ class WriteBallastConfigurationLampBurnHoursTripPoint : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint : public SubscribeAttribute { @@ -92508,6 +101279,11 @@ class SubscribeAttributeBallastConfigurationLampBurnHoursTripPoint : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.LampBurnHoursTripPoint response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92541,8 +101317,11 @@ class ReadBallastConfigurationGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92586,6 +101365,11 @@ class SubscribeAttributeBallastConfigurationGeneratedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92619,8 +101403,11 @@ class ReadBallastConfigurationAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92664,6 +101451,11 @@ class SubscribeAttributeBallastConfigurationAcceptedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92699,8 +101491,11 @@ class ReadBallastConfigurationEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92744,6 +101539,11 @@ class SubscribeAttributeBallastConfigurationEventList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92779,8 +101579,11 @@ class ReadBallastConfigurationAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92824,6 +101627,11 @@ class SubscribeAttributeBallastConfigurationAttributeList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92857,8 +101665,11 @@ class ReadBallastConfigurationFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92902,6 +101713,11 @@ class SubscribeAttributeBallastConfigurationFeatureMap : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -92935,8 +101751,11 @@ class ReadBallastConfigurationClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("BallastConfiguration ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -92980,6 +101799,11 @@ class SubscribeAttributeBallastConfigurationClusterRevision : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"BallastConfiguration.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93034,8 +101858,11 @@ class ReadIlluminanceMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93079,6 +101906,11 @@ class SubscribeAttributeIlluminanceMeasurementMeasuredValue : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93112,8 +101944,11 @@ class ReadIlluminanceMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93157,6 +101992,11 @@ class SubscribeAttributeIlluminanceMeasurementMinMeasuredValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93190,8 +102030,11 @@ class ReadIlluminanceMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93235,6 +102078,11 @@ class SubscribeAttributeIlluminanceMeasurementMaxMeasuredValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93268,8 +102116,11 @@ class ReadIlluminanceMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93313,6 +102164,11 @@ class SubscribeAttributeIlluminanceMeasurementTolerance : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93346,8 +102202,11 @@ class ReadIlluminanceMeasurementLightSensorType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLightSensorTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.LightSensorType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement LightSensorType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93391,6 +102250,11 @@ class SubscribeAttributeIlluminanceMeasurementLightSensorType : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.LightSensorType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93424,8 +102288,11 @@ class ReadIlluminanceMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93469,6 +102336,11 @@ class SubscribeAttributeIlluminanceMeasurementGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93502,8 +102374,11 @@ class ReadIlluminanceMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93547,6 +102422,11 @@ class SubscribeAttributeIlluminanceMeasurementAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93582,8 +102462,11 @@ class ReadIlluminanceMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93627,6 +102510,11 @@ class SubscribeAttributeIlluminanceMeasurementEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93662,8 +102550,11 @@ class ReadIlluminanceMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93707,6 +102598,11 @@ class SubscribeAttributeIlluminanceMeasurementAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93740,8 +102636,11 @@ class ReadIlluminanceMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93785,6 +102684,11 @@ class SubscribeAttributeIlluminanceMeasurementFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93818,8 +102722,11 @@ class ReadIlluminanceMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("IlluminanceMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93863,6 +102770,11 @@ class SubscribeAttributeIlluminanceMeasurementClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"IlluminanceMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93916,8 +102828,11 @@ class ReadTemperatureMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -93961,6 +102876,11 @@ class SubscribeAttributeTemperatureMeasurementMeasuredValue : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -93994,8 +102914,11 @@ class ReadTemperatureMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94039,6 +102962,11 @@ class SubscribeAttributeTemperatureMeasurementMinMeasuredValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94072,8 +103000,11 @@ class ReadTemperatureMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94117,6 +103048,11 @@ class SubscribeAttributeTemperatureMeasurementMaxMeasuredValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94150,8 +103086,11 @@ class ReadTemperatureMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94195,6 +103134,11 @@ class SubscribeAttributeTemperatureMeasurementTolerance : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94228,8 +103172,11 @@ class ReadTemperatureMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94273,6 +103220,11 @@ class SubscribeAttributeTemperatureMeasurementGeneratedCommandList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94306,8 +103258,11 @@ class ReadTemperatureMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94351,6 +103306,11 @@ class SubscribeAttributeTemperatureMeasurementAcceptedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94386,8 +103346,11 @@ class ReadTemperatureMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94431,6 +103394,11 @@ class SubscribeAttributeTemperatureMeasurementEventList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94466,8 +103434,11 @@ class ReadTemperatureMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94511,6 +103482,11 @@ class SubscribeAttributeTemperatureMeasurementAttributeList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94544,8 +103520,11 @@ class ReadTemperatureMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94589,6 +103568,11 @@ class SubscribeAttributeTemperatureMeasurementFeatureMap : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94622,8 +103606,11 @@ class ReadTemperatureMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TemperatureMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94667,6 +103654,11 @@ class SubscribeAttributeTemperatureMeasurementClusterRevision : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TemperatureMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94725,8 +103717,11 @@ class ReadPressureMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94770,6 +103765,11 @@ class SubscribeAttributePressureMeasurementMeasuredValue : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94803,8 +103803,11 @@ class ReadPressureMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94848,6 +103851,11 @@ class SubscribeAttributePressureMeasurementMinMeasuredValue : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94881,8 +103889,11 @@ class ReadPressureMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -94926,6 +103937,11 @@ class SubscribeAttributePressureMeasurementMaxMeasuredValue : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -94959,8 +103975,11 @@ class ReadPressureMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95004,6 +104023,11 @@ class SubscribeAttributePressureMeasurementTolerance : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95037,8 +104061,11 @@ class ReadPressureMeasurementScaledValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeScaledValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ScaledValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement ScaledValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95082,6 +104109,11 @@ class SubscribeAttributePressureMeasurementScaledValue : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ScaledValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95115,8 +104147,11 @@ class ReadPressureMeasurementMinScaledValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinScaledValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MinScaledValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MinScaledValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95160,6 +104195,11 @@ class SubscribeAttributePressureMeasurementMinScaledValue : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MinScaledValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95193,8 +104233,11 @@ class ReadPressureMeasurementMaxScaledValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxScaledValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MaxScaledValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement MaxScaledValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95238,6 +104281,11 @@ class SubscribeAttributePressureMeasurementMaxScaledValue : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.MaxScaledValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95271,8 +104319,11 @@ class ReadPressureMeasurementScaledTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeScaledToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ScaledTolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement ScaledTolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95316,6 +104367,11 @@ class SubscribeAttributePressureMeasurementScaledTolerance : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ScaledTolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95349,8 +104405,11 @@ class ReadPressureMeasurementScale : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeScaleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.Scale response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement Scale read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95394,6 +104453,11 @@ class SubscribeAttributePressureMeasurementScale : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.Scale response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95427,8 +104491,11 @@ class ReadPressureMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95472,6 +104539,11 @@ class SubscribeAttributePressureMeasurementGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95505,8 +104577,11 @@ class ReadPressureMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95550,6 +104625,11 @@ class SubscribeAttributePressureMeasurementAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95585,8 +104665,11 @@ class ReadPressureMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95630,6 +104713,11 @@ class SubscribeAttributePressureMeasurementEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95665,8 +104753,11 @@ class ReadPressureMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95710,6 +104801,11 @@ class SubscribeAttributePressureMeasurementAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95743,8 +104839,11 @@ class ReadPressureMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95788,6 +104887,11 @@ class SubscribeAttributePressureMeasurementFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95821,8 +104925,11 @@ class ReadPressureMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PressureMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95866,6 +104973,11 @@ class SubscribeAttributePressureMeasurementClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PressureMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95919,8 +105031,11 @@ class ReadFlowMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -95964,6 +105079,11 @@ class SubscribeAttributeFlowMeasurementMeasuredValue : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -95997,8 +105117,11 @@ class ReadFlowMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96042,6 +105165,11 @@ class SubscribeAttributeFlowMeasurementMinMeasuredValue : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96075,8 +105203,11 @@ class ReadFlowMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96120,6 +105251,11 @@ class SubscribeAttributeFlowMeasurementMaxMeasuredValue : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96153,8 +105289,11 @@ class ReadFlowMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96198,6 +105337,11 @@ class SubscribeAttributeFlowMeasurementTolerance : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96231,8 +105375,11 @@ class ReadFlowMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96276,6 +105423,11 @@ class SubscribeAttributeFlowMeasurementGeneratedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96309,8 +105461,11 @@ class ReadFlowMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96354,6 +105509,11 @@ class SubscribeAttributeFlowMeasurementAcceptedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96389,8 +105549,11 @@ class ReadFlowMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96434,6 +105597,11 @@ class SubscribeAttributeFlowMeasurementEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96469,8 +105637,11 @@ class ReadFlowMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96514,6 +105685,11 @@ class SubscribeAttributeFlowMeasurementAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96547,8 +105723,11 @@ class ReadFlowMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96592,6 +105771,11 @@ class SubscribeAttributeFlowMeasurementFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96625,8 +105809,11 @@ class ReadFlowMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FlowMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96670,6 +105857,11 @@ class SubscribeAttributeFlowMeasurementClusterRevision : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FlowMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96723,8 +105915,11 @@ class ReadRelativeHumidityMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96768,6 +105963,11 @@ class SubscribeAttributeRelativeHumidityMeasurementMeasuredValue : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96802,8 +106002,11 @@ class ReadRelativeHumidityMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96847,6 +106050,11 @@ class SubscribeAttributeRelativeHumidityMeasurementMinMeasuredValue : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96881,8 +106089,11 @@ class ReadRelativeHumidityMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -96926,6 +106137,11 @@ class SubscribeAttributeRelativeHumidityMeasurementMaxMeasuredValue : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -96959,8 +106175,11 @@ class ReadRelativeHumidityMeasurementTolerance : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeToleranceWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.Tolerance response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement Tolerance read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97004,6 +106223,11 @@ class SubscribeAttributeRelativeHumidityMeasurementTolerance : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.Tolerance response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97038,8 +106262,11 @@ class ReadRelativeHumidityMeasurementGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97084,6 +106311,11 @@ class SubscribeAttributeRelativeHumidityMeasurementGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97118,8 +106350,11 @@ class ReadRelativeHumidityMeasurementAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97164,6 +106399,11 @@ class SubscribeAttributeRelativeHumidityMeasurementAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97199,8 +106439,11 @@ class ReadRelativeHumidityMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97244,6 +106487,11 @@ class SubscribeAttributeRelativeHumidityMeasurementEventList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97279,8 +106527,11 @@ class ReadRelativeHumidityMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97324,6 +106575,11 @@ class SubscribeAttributeRelativeHumidityMeasurementAttributeList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97357,8 +106613,11 @@ class ReadRelativeHumidityMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97402,6 +106661,11 @@ class SubscribeAttributeRelativeHumidityMeasurementFeatureMap : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97435,8 +106699,11 @@ class ReadRelativeHumidityMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RelativeHumidityMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97480,6 +106747,11 @@ class SubscribeAttributeRelativeHumidityMeasurementClusterRevision : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RelativeHumidityMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97541,8 +106813,11 @@ class ReadOccupancySensingOccupancy : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupancyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.Occupancy response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing Occupancy read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97586,6 +106861,11 @@ class SubscribeAttributeOccupancySensingOccupancy : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.Occupancy response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97619,8 +106899,11 @@ class ReadOccupancySensingOccupancySensorType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupancySensorTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.OccupancySensorType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing OccupancySensorType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97664,6 +106947,11 @@ class SubscribeAttributeOccupancySensingOccupancySensorType : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.OccupancySensorType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97697,8 +106985,11 @@ class ReadOccupancySensingOccupancySensorTypeBitmap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOccupancySensorTypeBitmapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.OccupancySensorTypeBitmap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing OccupancySensorTypeBitmap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97742,6 +107033,11 @@ class SubscribeAttributeOccupancySensingOccupancySensorTypeBitmap : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.OccupancySensorTypeBitmap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97776,8 +107072,11 @@ class ReadOccupancySensingPIROccupiedToUnoccupiedDelay : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePIROccupiedToUnoccupiedDelayWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIROccupiedToUnoccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PIROccupiedToUnoccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97822,6 +107121,8 @@ class WriteOccupancySensingPIROccupiedToUnoccupiedDelay : public WriteAttribute if (error != nil) { LogNSError("OccupancySensing PIROccupiedToUnoccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97868,6 +107169,11 @@ class SubscribeAttributeOccupancySensingPIROccupiedToUnoccupiedDelay : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIROccupiedToUnoccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -97902,8 +107208,11 @@ class ReadOccupancySensingPIRUnoccupiedToOccupiedDelay : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePIRUnoccupiedToOccupiedDelayWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIRUnoccupiedToOccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PIRUnoccupiedToOccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97948,6 +107257,8 @@ class WriteOccupancySensingPIRUnoccupiedToOccupiedDelay : public WriteAttribute if (error != nil) { LogNSError("OccupancySensing PIRUnoccupiedToOccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -97994,6 +107305,11 @@ class SubscribeAttributeOccupancySensingPIRUnoccupiedToOccupiedDelay : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIRUnoccupiedToOccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98029,8 +107345,11 @@ class ReadOccupancySensingPIRUnoccupiedToOccupiedThreshold : public ReadAttribut [cluster readAttributePIRUnoccupiedToOccupiedThresholdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIRUnoccupiedToOccupiedThreshold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PIRUnoccupiedToOccupiedThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98075,6 +107394,8 @@ class WriteOccupancySensingPIRUnoccupiedToOccupiedThreshold : public WriteAttrib LogNSError("OccupancySensing " "PIRUnoccupiedToOccupiedThreshold write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98122,6 +107443,11 @@ class SubscribeAttributeOccupancySensingPIRUnoccupiedToOccupiedThreshold : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PIRUnoccupiedToOccupiedThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98157,8 +107483,11 @@ class ReadOccupancySensingUltrasonicOccupiedToUnoccupiedDelay : public ReadAttri [cluster readAttributeUltrasonicOccupiedToUnoccupiedDelayWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicOccupiedToUnoccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing UltrasonicOccupiedToUnoccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98204,6 +107533,8 @@ class WriteOccupancySensingUltrasonicOccupiedToUnoccupiedDelay : public WriteAtt LogNSError("OccupancySensing " "UltrasonicOccupiedToUnoccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98251,6 +107582,11 @@ class SubscribeAttributeOccupancySensingUltrasonicOccupiedToUnoccupiedDelay : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicOccupiedToUnoccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98286,8 +107622,11 @@ class ReadOccupancySensingUltrasonicUnoccupiedToOccupiedDelay : public ReadAttri [cluster readAttributeUltrasonicUnoccupiedToOccupiedDelayWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing UltrasonicUnoccupiedToOccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98333,6 +107672,8 @@ class WriteOccupancySensingUltrasonicUnoccupiedToOccupiedDelay : public WriteAtt LogNSError("OccupancySensing " "UltrasonicUnoccupiedToOccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98380,6 +107721,11 @@ class SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedDelay : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98415,8 +107761,11 @@ class ReadOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold : public ReadA [cluster readAttributeUltrasonicUnoccupiedToOccupiedThresholdWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedThreshold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing UltrasonicUnoccupiedToOccupiedThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98463,6 +107812,8 @@ class WriteOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold : public Writ "OccupancySensing " "UltrasonicUnoccupiedToOccupiedThreshold write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98510,6 +107861,11 @@ class SubscribeAttributeOccupancySensingUltrasonicUnoccupiedToOccupiedThreshold } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.UltrasonicUnoccupiedToOccupiedThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98545,8 +107901,11 @@ class ReadOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public Read [cluster readAttributePhysicalContactOccupiedToUnoccupiedDelayWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactOccupiedToUnoccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PhysicalContactOccupiedToUnoccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98593,6 +107952,8 @@ class WriteOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay : public Wri "OccupancySensing " "PhysicalContactOccupiedToUnoccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98640,6 +108001,11 @@ class SubscribeAttributeOccupancySensingPhysicalContactOccupiedToUnoccupiedDelay } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactOccupiedToUnoccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98675,8 +108041,11 @@ class ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public Read [cluster readAttributePhysicalContactUnoccupiedToOccupiedDelayWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedDelay response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PhysicalContactUnoccupiedToOccupiedDelay read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98723,6 +108092,8 @@ class WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay : public Wri "OccupancySensing " "PhysicalContactUnoccupiedToOccupiedDelay write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98770,6 +108141,11 @@ class SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedDelay } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedDelay response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98805,8 +108181,11 @@ class ReadOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold : public [cluster readAttributePhysicalContactUnoccupiedToOccupiedThresholdWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedThreshold response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing PhysicalContactUnoccupiedToOccupiedThreshold read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98852,6 +108231,9 @@ class WriteOccupancySensingPhysicalContactUnoccupiedToOccupiedThreshold : public "PhysicalContactUnoccupiedToOccupiedTh" "reshold write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), + error); } SetCommandExitStatus(error); }]; @@ -98899,6 +108281,11 @@ class SubscribeAttributeOccupancySensingPhysicalContactUnoccupiedToOccupiedThres } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.PhysicalContactUnoccupiedToOccupiedThreshold response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -98932,8 +108319,11 @@ class ReadOccupancySensingGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -98977,6 +108367,11 @@ class SubscribeAttributeOccupancySensingGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99010,8 +108405,11 @@ class ReadOccupancySensingAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99055,6 +108453,11 @@ class SubscribeAttributeOccupancySensingAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99090,8 +108493,11 @@ class ReadOccupancySensingEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99135,6 +108541,11 @@ class SubscribeAttributeOccupancySensingEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99170,8 +108581,11 @@ class ReadOccupancySensingAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99215,6 +108629,11 @@ class SubscribeAttributeOccupancySensingAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99248,8 +108667,11 @@ class ReadOccupancySensingFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99293,6 +108715,11 @@ class SubscribeAttributeOccupancySensingFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99326,8 +108753,11 @@ class ReadOccupancySensingClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OccupancySensing ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99371,6 +108801,11 @@ class SubscribeAttributeOccupancySensingClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OccupancySensing.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99435,8 +108870,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMeasuredValue : public ReadAttri queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99481,6 +108919,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMeasuredValue : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99518,8 +108961,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMinMeasuredValue : public ReadAt queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99564,6 +109010,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMinMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99601,8 +109052,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMaxMeasuredValue : public ReadAt queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99647,6 +109101,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMaxMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99684,8 +109143,11 @@ class ReadCarbonMonoxideConcentrationMeasurementPeakMeasuredValue : public ReadA queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99730,6 +109192,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementPeakMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99767,8 +109234,11 @@ class ReadCarbonMonoxideConcentrationMeasurementPeakMeasuredValueWindow : public queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99813,6 +109283,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementPeakMeasuredValueW } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99850,8 +109325,11 @@ class ReadCarbonMonoxideConcentrationMeasurementAverageMeasuredValue : public Re queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99896,6 +109374,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementAverageMeasuredVal } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -99933,8 +109416,11 @@ class ReadCarbonMonoxideConcentrationMeasurementAverageMeasuredValueWindow : pub queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -99979,6 +109465,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementAverageMeasuredVal } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100016,8 +109507,11 @@ class ReadCarbonMonoxideConcentrationMeasurementUncertainty : public ReadAttribu queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100062,6 +109556,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementUncertainty : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100099,8 +109598,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMeasurementUnit : public ReadAtt queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100145,6 +109647,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMeasurementUnit : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100182,8 +109689,11 @@ class ReadCarbonMonoxideConcentrationMeasurementMeasurementMedium : public ReadA queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100228,6 +109738,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementMeasurementMedium } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100265,8 +109780,11 @@ class ReadCarbonMonoxideConcentrationMeasurementLevelValue : public ReadAttribut queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100311,6 +109829,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementLevelValue : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100348,8 +109871,11 @@ class ReadCarbonMonoxideConcentrationMeasurementGeneratedCommandList : public Re queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100394,6 +109920,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementGeneratedCommandLi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100431,8 +109962,11 @@ class ReadCarbonMonoxideConcentrationMeasurementAcceptedCommandList : public Rea queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100477,6 +110011,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementAcceptedCommandLis } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100514,8 +110053,11 @@ class ReadCarbonMonoxideConcentrationMeasurementEventList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100560,6 +110102,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementEventList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100597,8 +110144,11 @@ class ReadCarbonMonoxideConcentrationMeasurementAttributeList : public ReadAttri queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100643,6 +110193,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementAttributeList : pu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100680,8 +110235,11 @@ class ReadCarbonMonoxideConcentrationMeasurementFeatureMap : public ReadAttribut queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100726,6 +110284,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementFeatureMap : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100763,8 +110326,11 @@ class ReadCarbonMonoxideConcentrationMeasurementClusterRevision : public ReadAtt queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonMonoxideConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100809,6 +110375,11 @@ class SubscribeAttributeCarbonMonoxideConcentrationMeasurementClusterRevision : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonMonoxideConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100875,8 +110446,11 @@ class ReadCarbonDioxideConcentrationMeasurementMeasuredValue : public ReadAttrib queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -100921,6 +110495,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMeasuredValue : pub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -100958,8 +110537,11 @@ class ReadCarbonDioxideConcentrationMeasurementMinMeasuredValue : public ReadAtt queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101004,6 +110586,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMinMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101041,8 +110628,11 @@ class ReadCarbonDioxideConcentrationMeasurementMaxMeasuredValue : public ReadAtt queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101087,6 +110677,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMaxMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101124,8 +110719,11 @@ class ReadCarbonDioxideConcentrationMeasurementPeakMeasuredValue : public ReadAt queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101170,6 +110768,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementPeakMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101207,8 +110810,11 @@ class ReadCarbonDioxideConcentrationMeasurementPeakMeasuredValueWindow : public queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101253,6 +110859,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementPeakMeasuredValueWi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101290,8 +110901,11 @@ class ReadCarbonDioxideConcentrationMeasurementAverageMeasuredValue : public Rea queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101336,6 +110950,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementAverageMeasuredValu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101373,8 +110992,11 @@ class ReadCarbonDioxideConcentrationMeasurementAverageMeasuredValueWindow : publ queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101419,6 +111041,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementAverageMeasuredValu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101456,8 +111083,11 @@ class ReadCarbonDioxideConcentrationMeasurementUncertainty : public ReadAttribut queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101502,6 +111132,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementUncertainty : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101539,8 +111174,11 @@ class ReadCarbonDioxideConcentrationMeasurementMeasurementUnit : public ReadAttr queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101585,6 +111223,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMeasurementUnit : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101622,8 +111265,11 @@ class ReadCarbonDioxideConcentrationMeasurementMeasurementMedium : public ReadAt queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101668,6 +111314,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementMeasurementMedium : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101705,8 +111356,11 @@ class ReadCarbonDioxideConcentrationMeasurementLevelValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101751,6 +111405,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementLevelValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101788,8 +111447,11 @@ class ReadCarbonDioxideConcentrationMeasurementGeneratedCommandList : public Rea queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101834,6 +111496,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementGeneratedCommandLis } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101871,8 +111538,11 @@ class ReadCarbonDioxideConcentrationMeasurementAcceptedCommandList : public Read queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -101917,6 +111587,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementAcceptedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -101954,8 +111629,11 @@ class ReadCarbonDioxideConcentrationMeasurementEventList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102000,6 +111678,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementEventList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102037,8 +111720,11 @@ class ReadCarbonDioxideConcentrationMeasurementAttributeList : public ReadAttrib queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102083,6 +111769,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementAttributeList : pub } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102120,8 +111811,11 @@ class ReadCarbonDioxideConcentrationMeasurementFeatureMap : public ReadAttribute queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102166,6 +111860,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementFeatureMap : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102203,8 +111902,11 @@ class ReadCarbonDioxideConcentrationMeasurementClusterRevision : public ReadAttr queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("CarbonDioxideConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102249,6 +111951,11 @@ class SubscribeAttributeCarbonDioxideConcentrationMeasurementClusterRevision : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"CarbonDioxideConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102315,8 +112022,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMeasuredValue : public ReadAttr queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102361,6 +112071,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMeasuredValue : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102398,8 +112113,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMinMeasuredValue : public ReadA queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102444,6 +112162,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMinMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102481,8 +112204,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMaxMeasuredValue : public ReadA queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102527,6 +112253,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMaxMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102564,8 +112295,11 @@ class ReadNitrogenDioxideConcentrationMeasurementPeakMeasuredValue : public Read queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102610,6 +112344,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementPeakMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102647,8 +112386,11 @@ class ReadNitrogenDioxideConcentrationMeasurementPeakMeasuredValueWindow : publi queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102693,6 +112435,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementPeakMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102730,8 +112477,11 @@ class ReadNitrogenDioxideConcentrationMeasurementAverageMeasuredValue : public R queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102776,6 +112526,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementAverageMeasuredVa } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102813,8 +112568,11 @@ class ReadNitrogenDioxideConcentrationMeasurementAverageMeasuredValueWindow : pu queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102859,6 +112617,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementAverageMeasuredVa } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102896,8 +112659,11 @@ class ReadNitrogenDioxideConcentrationMeasurementUncertainty : public ReadAttrib queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -102942,6 +112708,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementUncertainty : pub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -102979,8 +112750,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMeasurementUnit : public ReadAt queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103025,6 +112799,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMeasurementUnit : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103062,8 +112841,11 @@ class ReadNitrogenDioxideConcentrationMeasurementMeasurementMedium : public Read queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103108,6 +112890,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementMeasurementMedium } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103145,8 +112932,11 @@ class ReadNitrogenDioxideConcentrationMeasurementLevelValue : public ReadAttribu queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103191,6 +112981,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementLevelValue : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103228,8 +113023,11 @@ class ReadNitrogenDioxideConcentrationMeasurementGeneratedCommandList : public R queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103274,6 +113072,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementGeneratedCommandL } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103311,8 +113114,11 @@ class ReadNitrogenDioxideConcentrationMeasurementAcceptedCommandList : public Re queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103357,6 +113163,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementAcceptedCommandLi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103394,8 +113205,11 @@ class ReadNitrogenDioxideConcentrationMeasurementEventList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103440,6 +113254,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementEventList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103477,8 +113296,11 @@ class ReadNitrogenDioxideConcentrationMeasurementAttributeList : public ReadAttr queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103523,6 +113345,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementAttributeList : p } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103560,8 +113387,11 @@ class ReadNitrogenDioxideConcentrationMeasurementFeatureMap : public ReadAttribu queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103606,6 +113436,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementFeatureMap : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103643,8 +113478,11 @@ class ReadNitrogenDioxideConcentrationMeasurementClusterRevision : public ReadAt queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("NitrogenDioxideConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103689,6 +113527,11 @@ class SubscribeAttributeNitrogenDioxideConcentrationMeasurementClusterRevision : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"NitrogenDioxideConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103754,8 +113597,11 @@ class ReadOzoneConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103799,6 +113645,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMeasuredValue : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103836,8 +113687,11 @@ class ReadOzoneConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103882,6 +113736,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMinMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -103919,8 +113778,11 @@ class ReadOzoneConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -103965,6 +113827,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMaxMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104002,8 +113869,11 @@ class ReadOzoneConcentrationMeasurementPeakMeasuredValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104048,6 +113918,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementPeakMeasuredValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104085,8 +113960,11 @@ class ReadOzoneConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttr queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104131,6 +114009,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementPeakMeasuredValueWindow : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104168,8 +114051,11 @@ class ReadOzoneConcentrationMeasurementAverageMeasuredValue : public ReadAttribu queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104214,6 +114100,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementAverageMeasuredValue : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104251,8 +114142,11 @@ class ReadOzoneConcentrationMeasurementAverageMeasuredValueWindow : public ReadA queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104297,6 +114191,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementAverageMeasuredValueWindow } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104333,8 +114232,11 @@ class ReadOzoneConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104378,6 +114280,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementUncertainty : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104415,8 +114322,11 @@ class ReadOzoneConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104460,6 +114370,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMeasurementUnit : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104497,8 +114412,11 @@ class ReadOzoneConcentrationMeasurementMeasurementMedium : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104543,6 +114461,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementMeasurementMedium : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104579,8 +114502,11 @@ class ReadOzoneConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104624,6 +114550,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementLevelValue : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104661,8 +114592,11 @@ class ReadOzoneConcentrationMeasurementGeneratedCommandList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104707,6 +114641,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementGeneratedCommandList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104744,8 +114683,11 @@ class ReadOzoneConcentrationMeasurementAcceptedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104790,6 +114732,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementAcceptedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104826,8 +114773,11 @@ class ReadOzoneConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104871,6 +114821,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementEventList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104907,8 +114862,11 @@ class ReadOzoneConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -104952,6 +114910,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementAttributeList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -104988,8 +114951,11 @@ class ReadOzoneConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105033,6 +114999,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementFeatureMap : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105070,8 +115041,11 @@ class ReadOzoneConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("OzoneConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105115,6 +115089,11 @@ class SubscribeAttributeOzoneConcentrationMeasurementClusterRevision : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"OzoneConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105180,8 +115159,11 @@ class ReadPm25ConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105225,6 +115207,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMeasuredValue : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105262,8 +115249,11 @@ class ReadPm25ConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105307,6 +115297,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMinMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105344,8 +115339,11 @@ class ReadPm25ConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105389,6 +115387,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMaxMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105426,8 +115429,11 @@ class ReadPm25ConcentrationMeasurementPeakMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105472,6 +115478,11 @@ class SubscribeAttributePm25ConcentrationMeasurementPeakMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105509,8 +115520,11 @@ class ReadPm25ConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttri queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105555,6 +115569,11 @@ class SubscribeAttributePm25ConcentrationMeasurementPeakMeasuredValueWindow : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105592,8 +115611,11 @@ class ReadPm25ConcentrationMeasurementAverageMeasuredValue : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105638,6 +115660,11 @@ class SubscribeAttributePm25ConcentrationMeasurementAverageMeasuredValue : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105675,8 +115702,11 @@ class ReadPm25ConcentrationMeasurementAverageMeasuredValueWindow : public ReadAt queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105721,6 +115751,11 @@ class SubscribeAttributePm25ConcentrationMeasurementAverageMeasuredValueWindow : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105757,8 +115792,11 @@ class ReadPm25ConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105802,6 +115840,11 @@ class SubscribeAttributePm25ConcentrationMeasurementUncertainty : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105839,8 +115882,11 @@ class ReadPm25ConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105884,6 +115930,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMeasurementUnit : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -105921,8 +115972,11 @@ class ReadPm25ConcentrationMeasurementMeasurementMedium : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -105967,6 +116021,11 @@ class SubscribeAttributePm25ConcentrationMeasurementMeasurementMedium : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106003,8 +116062,11 @@ class ReadPm25ConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106048,6 +116110,11 @@ class SubscribeAttributePm25ConcentrationMeasurementLevelValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106085,8 +116152,11 @@ class ReadPm25ConcentrationMeasurementGeneratedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106131,6 +116201,11 @@ class SubscribeAttributePm25ConcentrationMeasurementGeneratedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106168,8 +116243,11 @@ class ReadPm25ConcentrationMeasurementAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106214,6 +116292,11 @@ class SubscribeAttributePm25ConcentrationMeasurementAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106250,8 +116333,11 @@ class ReadPm25ConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106295,6 +116381,11 @@ class SubscribeAttributePm25ConcentrationMeasurementEventList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106331,8 +116422,11 @@ class ReadPm25ConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106376,6 +116470,11 @@ class SubscribeAttributePm25ConcentrationMeasurementAttributeList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106412,8 +116511,11 @@ class ReadPm25ConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106457,6 +116559,11 @@ class SubscribeAttributePm25ConcentrationMeasurementFeatureMap : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106494,8 +116601,11 @@ class ReadPm25ConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM25ConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106539,6 +116649,11 @@ class SubscribeAttributePm25ConcentrationMeasurementClusterRevision : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM25ConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106605,8 +116720,11 @@ class ReadFormaldehydeConcentrationMeasurementMeasuredValue : public ReadAttribu queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106651,6 +116769,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMeasuredValue : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106688,8 +116811,11 @@ class ReadFormaldehydeConcentrationMeasurementMinMeasuredValue : public ReadAttr queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106734,6 +116860,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMinMeasuredValue : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106771,8 +116902,11 @@ class ReadFormaldehydeConcentrationMeasurementMaxMeasuredValue : public ReadAttr queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106817,6 +116951,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMaxMeasuredValue : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106854,8 +116993,11 @@ class ReadFormaldehydeConcentrationMeasurementPeakMeasuredValue : public ReadAtt queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106900,6 +117042,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementPeakMeasuredValue : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -106937,8 +117084,11 @@ class ReadFormaldehydeConcentrationMeasurementPeakMeasuredValueWindow : public R queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -106983,6 +117133,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementPeakMeasuredValueWin } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107020,8 +117175,11 @@ class ReadFormaldehydeConcentrationMeasurementAverageMeasuredValue : public Read queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107066,6 +117224,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementAverageMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107103,8 +117266,11 @@ class ReadFormaldehydeConcentrationMeasurementAverageMeasuredValueWindow : publi queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107149,6 +117315,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementAverageMeasuredValue } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107186,8 +117357,11 @@ class ReadFormaldehydeConcentrationMeasurementUncertainty : public ReadAttribute queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107232,6 +117406,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementUncertainty : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107269,8 +117448,11 @@ class ReadFormaldehydeConcentrationMeasurementMeasurementUnit : public ReadAttri queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107315,6 +117497,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMeasurementUnit : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107352,8 +117539,11 @@ class ReadFormaldehydeConcentrationMeasurementMeasurementMedium : public ReadAtt queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107398,6 +117588,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementMeasurementMedium : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107435,8 +117630,11 @@ class ReadFormaldehydeConcentrationMeasurementLevelValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107481,6 +117679,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementLevelValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107518,8 +117721,11 @@ class ReadFormaldehydeConcentrationMeasurementGeneratedCommandList : public Read queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107564,6 +117770,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementGeneratedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107601,8 +117812,11 @@ class ReadFormaldehydeConcentrationMeasurementAcceptedCommandList : public ReadA queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107647,6 +117861,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementAcceptedCommandList } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107684,8 +117903,11 @@ class ReadFormaldehydeConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107730,6 +117952,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementEventList : public S } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107767,8 +117994,11 @@ class ReadFormaldehydeConcentrationMeasurementAttributeList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107813,6 +118043,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementAttributeList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107850,8 +118085,11 @@ class ReadFormaldehydeConcentrationMeasurementFeatureMap : public ReadAttribute queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107896,6 +118134,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementFeatureMap : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -107933,8 +118176,11 @@ class ReadFormaldehydeConcentrationMeasurementClusterRevision : public ReadAttri queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("FormaldehydeConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -107979,6 +118225,11 @@ class SubscribeAttributeFormaldehydeConcentrationMeasurementClusterRevision : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"FormaldehydeConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108044,8 +118295,11 @@ class ReadPm1ConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108089,6 +118343,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMeasuredValue : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108126,8 +118385,11 @@ class ReadPm1ConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108171,6 +118433,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMinMeasuredValue : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108208,8 +118475,11 @@ class ReadPm1ConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108253,6 +118523,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMaxMeasuredValue : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108290,8 +118565,11 @@ class ReadPm1ConcentrationMeasurementPeakMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108335,6 +118613,11 @@ class SubscribeAttributePm1ConcentrationMeasurementPeakMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108372,8 +118655,11 @@ class ReadPm1ConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttrib queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108418,6 +118704,11 @@ class SubscribeAttributePm1ConcentrationMeasurementPeakMeasuredValueWindow : pub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108455,8 +118746,11 @@ class ReadPm1ConcentrationMeasurementAverageMeasuredValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108501,6 +118795,11 @@ class SubscribeAttributePm1ConcentrationMeasurementAverageMeasuredValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108538,8 +118837,11 @@ class ReadPm1ConcentrationMeasurementAverageMeasuredValueWindow : public ReadAtt queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108584,6 +118886,11 @@ class SubscribeAttributePm1ConcentrationMeasurementAverageMeasuredValueWindow : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108620,8 +118927,11 @@ class ReadPm1ConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108665,6 +118975,11 @@ class SubscribeAttributePm1ConcentrationMeasurementUncertainty : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108701,8 +119016,11 @@ class ReadPm1ConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108746,6 +119064,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMeasurementUnit : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108783,8 +119106,11 @@ class ReadPm1ConcentrationMeasurementMeasurementMedium : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108828,6 +119154,11 @@ class SubscribeAttributePm1ConcentrationMeasurementMeasurementMedium : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108864,8 +119195,11 @@ class ReadPm1ConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108909,6 +119243,11 @@ class SubscribeAttributePm1ConcentrationMeasurementLevelValue : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -108946,8 +119285,11 @@ class ReadPm1ConcentrationMeasurementGeneratedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -108992,6 +119334,11 @@ class SubscribeAttributePm1ConcentrationMeasurementGeneratedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109029,8 +119376,11 @@ class ReadPm1ConcentrationMeasurementAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109075,6 +119425,11 @@ class SubscribeAttributePm1ConcentrationMeasurementAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109111,8 +119466,11 @@ class ReadPm1ConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109156,6 +119514,11 @@ class SubscribeAttributePm1ConcentrationMeasurementEventList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109192,8 +119555,11 @@ class ReadPm1ConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109237,6 +119603,11 @@ class SubscribeAttributePm1ConcentrationMeasurementAttributeList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109273,8 +119644,11 @@ class ReadPm1ConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109318,6 +119692,11 @@ class SubscribeAttributePm1ConcentrationMeasurementFeatureMap : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109354,8 +119733,11 @@ class ReadPm1ConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM1ConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109399,6 +119781,11 @@ class SubscribeAttributePm1ConcentrationMeasurementClusterRevision : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM1ConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109464,8 +119851,11 @@ class ReadPm10ConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109509,6 +119899,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMeasuredValue : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109546,8 +119941,11 @@ class ReadPm10ConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109591,6 +119989,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMinMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109628,8 +120031,11 @@ class ReadPm10ConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109673,6 +120079,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMaxMeasuredValue : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109710,8 +120121,11 @@ class ReadPm10ConcentrationMeasurementPeakMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109756,6 +120170,11 @@ class SubscribeAttributePm10ConcentrationMeasurementPeakMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109793,8 +120212,11 @@ class ReadPm10ConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttri queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109839,6 +120261,11 @@ class SubscribeAttributePm10ConcentrationMeasurementPeakMeasuredValueWindow : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109876,8 +120303,11 @@ class ReadPm10ConcentrationMeasurementAverageMeasuredValue : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -109922,6 +120352,11 @@ class SubscribeAttributePm10ConcentrationMeasurementAverageMeasuredValue : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -109959,8 +120394,11 @@ class ReadPm10ConcentrationMeasurementAverageMeasuredValueWindow : public ReadAt queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110005,6 +120443,11 @@ class SubscribeAttributePm10ConcentrationMeasurementAverageMeasuredValueWindow : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110041,8 +120484,11 @@ class ReadPm10ConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110086,6 +120532,11 @@ class SubscribeAttributePm10ConcentrationMeasurementUncertainty : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110123,8 +120574,11 @@ class ReadPm10ConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110168,6 +120622,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMeasurementUnit : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110205,8 +120664,11 @@ class ReadPm10ConcentrationMeasurementMeasurementMedium : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110251,6 +120713,11 @@ class SubscribeAttributePm10ConcentrationMeasurementMeasurementMedium : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110287,8 +120754,11 @@ class ReadPm10ConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110332,6 +120802,11 @@ class SubscribeAttributePm10ConcentrationMeasurementLevelValue : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110369,8 +120844,11 @@ class ReadPm10ConcentrationMeasurementGeneratedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110415,6 +120893,11 @@ class SubscribeAttributePm10ConcentrationMeasurementGeneratedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110452,8 +120935,11 @@ class ReadPm10ConcentrationMeasurementAcceptedCommandList : public ReadAttribute queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110498,6 +120984,11 @@ class SubscribeAttributePm10ConcentrationMeasurementAcceptedCommandList : public } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110534,8 +121025,11 @@ class ReadPm10ConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110579,6 +121073,11 @@ class SubscribeAttributePm10ConcentrationMeasurementEventList : public Subscribe } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110615,8 +121114,11 @@ class ReadPm10ConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110660,6 +121162,11 @@ class SubscribeAttributePm10ConcentrationMeasurementAttributeList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110696,8 +121203,11 @@ class ReadPm10ConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110741,6 +121251,11 @@ class SubscribeAttributePm10ConcentrationMeasurementFeatureMap : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110778,8 +121293,11 @@ class ReadPm10ConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("PM10ConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110823,6 +121341,11 @@ class SubscribeAttributePm10ConcentrationMeasurementClusterRevision : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"PM10ConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110890,8 +121413,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMeasuredValue : p queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -110937,6 +121463,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -110975,8 +121506,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMinMeasuredValue queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111022,6 +121556,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMin } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111060,8 +121599,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMaxMeasuredValue queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111107,6 +121649,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMax } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111145,8 +121692,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValue queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111192,6 +121742,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementPea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111231,8 +121786,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementPeakMeasuredValue [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog( @"TotalVolatileOrganicCompoundsConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111279,6 +121837,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementPea reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111317,8 +121880,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredVa queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111365,6 +121931,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementAve reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog( @"TotalVolatileOrganicCompoundsConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111404,8 +121975,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementAverageMeasuredVa [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111453,6 +122027,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementAve reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111491,8 +122070,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementUncertainty : pub queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111538,6 +122120,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementUnc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111576,8 +122163,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMeasurementUnit : queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111623,6 +122213,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111661,8 +122256,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementMeasurementMedium queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111708,6 +122306,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementMea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111746,8 +122349,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementLevelValue : publ queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111793,6 +122399,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementLev } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111831,8 +122442,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementGeneratedCommandL queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111879,6 +122493,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementGen reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog( @"TotalVolatileOrganicCompoundsConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -111917,8 +122536,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementAcceptedCommandLi queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -111965,6 +122587,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementAcc reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog( @"TotalVolatileOrganicCompoundsConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112003,8 +122630,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementEventList : publi queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112050,6 +122680,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementEve } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112088,8 +122723,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementAttributeList : p queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112135,6 +122773,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112173,8 +122816,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementFeatureMap : publ queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112220,6 +122866,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementFea } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112258,8 +122909,11 @@ class ReadTotalVolatileOrganicCompoundsConcentrationMeasurementClusterRevision : queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TotalVolatileOrganicCompoundsConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112305,6 +122959,11 @@ class SubscribeAttributeTotalVolatileOrganicCompoundsConcentrationMeasurementClu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TotalVolatileOrganicCompoundsConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112370,8 +123029,11 @@ class ReadRadonConcentrationMeasurementMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112415,6 +123077,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMeasuredValue : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112452,8 +123119,11 @@ class ReadRadonConcentrationMeasurementMinMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMinMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MinMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MinMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112498,6 +123168,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMinMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MinMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112535,8 +123210,11 @@ class ReadRadonConcentrationMeasurementMaxMeasuredValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMaxMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MaxMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112581,6 +123259,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMaxMeasuredValue : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MaxMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112618,8 +123301,11 @@ class ReadRadonConcentrationMeasurementPeakMeasuredValue : public ReadAttribute queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement PeakMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112664,6 +123350,11 @@ class SubscribeAttributeRadonConcentrationMeasurementPeakMeasuredValue : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.PeakMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112701,8 +123392,11 @@ class ReadRadonConcentrationMeasurementPeakMeasuredValueWindow : public ReadAttr queue:callbackQueue]; [cluster readAttributePeakMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement PeakMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112747,6 +123441,11 @@ class SubscribeAttributeRadonConcentrationMeasurementPeakMeasuredValueWindow : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.PeakMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112784,8 +123483,11 @@ class ReadRadonConcentrationMeasurementAverageMeasuredValue : public ReadAttribu queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement AverageMeasuredValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112830,6 +123532,11 @@ class SubscribeAttributeRadonConcentrationMeasurementAverageMeasuredValue : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AverageMeasuredValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112867,8 +123574,11 @@ class ReadRadonConcentrationMeasurementAverageMeasuredValueWindow : public ReadA queue:callbackQueue]; [cluster readAttributeAverageMeasuredValueWindowWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement AverageMeasuredValueWindow read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112913,6 +123623,11 @@ class SubscribeAttributeRadonConcentrationMeasurementAverageMeasuredValueWindow } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AverageMeasuredValueWindow response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -112949,8 +123664,11 @@ class ReadRadonConcentrationMeasurementUncertainty : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUncertaintyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.Uncertainty response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement Uncertainty read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -112994,6 +123712,11 @@ class SubscribeAttributeRadonConcentrationMeasurementUncertainty : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.Uncertainty response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113031,8 +123754,11 @@ class ReadRadonConcentrationMeasurementMeasurementUnit : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementUnitWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasurementUnit response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MeasurementUnit read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113076,6 +123802,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMeasurementUnit : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasurementUnit response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113113,8 +123844,11 @@ class ReadRadonConcentrationMeasurementMeasurementMedium : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasurementMediumWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasurementMedium response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement MeasurementMedium read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113159,6 +123893,11 @@ class SubscribeAttributeRadonConcentrationMeasurementMeasurementMedium : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.MeasurementMedium response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113195,8 +123934,11 @@ class ReadRadonConcentrationMeasurementLevelValue : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLevelValueWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.LevelValue response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement LevelValue read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113240,6 +123982,11 @@ class SubscribeAttributeRadonConcentrationMeasurementLevelValue : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.LevelValue response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113277,8 +124024,11 @@ class ReadRadonConcentrationMeasurementGeneratedCommandList : public ReadAttribu queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113323,6 +124073,11 @@ class SubscribeAttributeRadonConcentrationMeasurementGeneratedCommandList : publ } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113360,8 +124115,11 @@ class ReadRadonConcentrationMeasurementAcceptedCommandList : public ReadAttribut queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113406,6 +124164,11 @@ class SubscribeAttributeRadonConcentrationMeasurementAcceptedCommandList : publi } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113442,8 +124205,11 @@ class ReadRadonConcentrationMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113487,6 +124253,11 @@ class SubscribeAttributeRadonConcentrationMeasurementEventList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113523,8 +124294,11 @@ class ReadRadonConcentrationMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113568,6 +124342,11 @@ class SubscribeAttributeRadonConcentrationMeasurementAttributeList : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113604,8 +124383,11 @@ class ReadRadonConcentrationMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113649,6 +124431,11 @@ class SubscribeAttributeRadonConcentrationMeasurementFeatureMap : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113686,8 +124473,11 @@ class ReadRadonConcentrationMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("RadonConcentrationMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113731,6 +124521,11 @@ class SubscribeAttributeRadonConcentrationMeasurementClusterRevision : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"RadonConcentrationMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113783,8 +124578,11 @@ class ReadWakeOnLanMACAddress : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMACAddressWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.MACAddress response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN MACAddress read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113828,6 +124626,11 @@ class SubscribeAttributeWakeOnLanMACAddress : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.MACAddress response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113861,8 +124664,11 @@ class ReadWakeOnLanGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113906,6 +124712,11 @@ class SubscribeAttributeWakeOnLanGeneratedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -113939,8 +124750,11 @@ class ReadWakeOnLanAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -113984,6 +124798,11 @@ class SubscribeAttributeWakeOnLanAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114019,8 +124838,11 @@ class ReadWakeOnLanEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114064,6 +124886,11 @@ class SubscribeAttributeWakeOnLanEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114099,8 +124926,11 @@ class ReadWakeOnLanAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114144,6 +124974,11 @@ class SubscribeAttributeWakeOnLanAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114177,8 +125012,11 @@ class ReadWakeOnLanFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114222,6 +125060,11 @@ class SubscribeAttributeWakeOnLanFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114255,8 +125098,11 @@ class ReadWakeOnLanClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("WakeOnLAN ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114300,6 +125146,11 @@ class SubscribeAttributeWakeOnLanClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"WakeOnLAN.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114360,19 +125211,29 @@ class ChannelChangeChannel : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster changeChannelWithParams:params - completion:^( - MTRChannelClusterChangeChannelResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + changeChannelWithParams:params + completion:^( + MTRChannelClusterChangeChannelResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::Channel::Commands::ChangeChannelResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -114418,6 +125279,8 @@ class ChannelChangeChannelByNumber : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -114460,17 +125323,19 @@ class ChannelSkipChannel : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster skipChannelWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + skipChannelWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -114503,8 +125368,11 @@ class ReadChannelChannelList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeChannelListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.ChannelList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel ChannelList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114546,6 +125414,11 @@ class SubscribeAttributeChannelChannelList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.ChannelList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114578,8 +125451,11 @@ class ReadChannelLineup : public ReadAttribute { [cluster readAttributeLineupWithCompletion:^(MTRChannelClusterLineupInfoStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.Lineup response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel Lineup read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114621,6 +125497,11 @@ class SubscribeAttributeChannelLineup : public SubscribeAttribute { } reportHandler:^(MTRChannelClusterLineupInfoStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.Lineup response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114653,8 +125534,11 @@ class ReadChannelCurrentChannel : public ReadAttribute { [cluster readAttributeCurrentChannelWithCompletion:^( MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.CurrentChannel response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel CurrentChannel read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114696,6 +125580,11 @@ class SubscribeAttributeChannelCurrentChannel : public SubscribeAttribute { } reportHandler:^(MTRChannelClusterChannelInfoStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.CurrentChannel response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114727,8 +125616,11 @@ class ReadChannelGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114770,6 +125662,11 @@ class SubscribeAttributeChannelGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114801,8 +125698,11 @@ class ReadChannelAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114844,6 +125744,11 @@ class SubscribeAttributeChannelAcceptedCommandList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114877,8 +125782,11 @@ class ReadChannelEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114920,6 +125828,11 @@ class SubscribeAttributeChannelEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -114953,8 +125866,11 @@ class ReadChannelAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -114996,6 +125912,11 @@ class SubscribeAttributeChannelAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115027,8 +125948,11 @@ class ReadChannelFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115070,6 +125994,11 @@ class SubscribeAttributeChannelFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115101,8 +126030,11 @@ class ReadChannelClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterChannel alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("Channel ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115144,6 +126076,11 @@ class SubscribeAttributeChannelClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"Channel.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115209,19 +126146,29 @@ class TargetNavigatorNavigateTarget : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster navigateTargetWithParams:params - completion:^(MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + navigateTargetWithParams:params + completion:^(MTRTargetNavigatorClusterNavigateTargetResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::TargetNavigator::Commands::NavigateTargetResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -115256,8 +126203,11 @@ class ReadTargetNavigatorTargetList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTargetListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.TargetList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator TargetList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115301,6 +126251,11 @@ class SubscribeAttributeTargetNavigatorTargetList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.TargetList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115334,8 +126289,11 @@ class ReadTargetNavigatorCurrentTarget : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentTargetWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.CurrentTarget response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator CurrentTarget read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115379,6 +126337,11 @@ class SubscribeAttributeTargetNavigatorCurrentTarget : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.CurrentTarget response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115412,8 +126375,11 @@ class ReadTargetNavigatorGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115457,6 +126423,11 @@ class SubscribeAttributeTargetNavigatorGeneratedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115490,8 +126461,11 @@ class ReadTargetNavigatorAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115535,6 +126509,11 @@ class SubscribeAttributeTargetNavigatorAcceptedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115570,8 +126549,11 @@ class ReadTargetNavigatorEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115615,6 +126597,11 @@ class SubscribeAttributeTargetNavigatorEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115650,8 +126637,11 @@ class ReadTargetNavigatorAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115695,6 +126685,11 @@ class SubscribeAttributeTargetNavigatorAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115728,8 +126723,11 @@ class ReadTargetNavigatorFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115773,6 +126771,11 @@ class SubscribeAttributeTargetNavigatorFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115806,8 +126809,11 @@ class ReadTargetNavigatorClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("TargetNavigator ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -115851,6 +126857,11 @@ class SubscribeAttributeTargetNavigatorClusterRevision : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"TargetNavigator.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -115924,10 +126935,18 @@ class MediaPlaybackPlay : public ClusterCommand { [cluster playWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -115973,10 +126992,18 @@ class MediaPlaybackPause : public ClusterCommand { pauseWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116021,10 +127048,18 @@ class MediaPlaybackStop : public ClusterCommand { [cluster stopWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116070,10 +127105,18 @@ class MediaPlaybackStartOver : public ClusterCommand { startOverWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116119,10 +127162,18 @@ class MediaPlaybackPrevious : public ClusterCommand { previousWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116167,10 +127218,18 @@ class MediaPlaybackNext : public ClusterCommand { [cluster nextWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116216,10 +127275,18 @@ class MediaPlaybackRewind : public ClusterCommand { rewindWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116261,19 +127328,28 @@ class MediaPlaybackFastForward : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster fastForwardWithParams:params - completion:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + fastForwardWithParams:params + completion:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -116312,19 +127388,28 @@ class MediaPlaybackSkipForward : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster skipForwardWithParams:params - completion:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + skipForwardWithParams:params + completion:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -116364,19 +127449,28 @@ class MediaPlaybackSkipBackward : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster skipBackwardWithParams:params - completion:^( - MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + skipBackwardWithParams:params + completion:^( + MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -116419,10 +127513,18 @@ class MediaPlaybackSeek : public ClusterCommand { [cluster seekWithParams:params completion:^(MTRMediaPlaybackClusterPlaybackResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::MediaPlayback::Commands::PlaybackResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -116462,8 +127564,11 @@ class ReadMediaPlaybackCurrentState : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentStateWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.CurrentState response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback CurrentState read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116507,6 +127612,11 @@ class SubscribeAttributeMediaPlaybackCurrentState : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.CurrentState response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116540,8 +127650,11 @@ class ReadMediaPlaybackStartTime : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStartTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.StartTime response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback StartTime read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116585,6 +127698,11 @@ class SubscribeAttributeMediaPlaybackStartTime : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.StartTime response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116618,8 +127736,11 @@ class ReadMediaPlaybackDuration : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDurationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.Duration response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback Duration read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116663,6 +127784,11 @@ class SubscribeAttributeMediaPlaybackDuration : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.Duration response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116697,8 +127823,11 @@ class ReadMediaPlaybackSampledPosition : public ReadAttribute { [cluster readAttributeSampledPositionWithCompletion:^( MTRMediaPlaybackClusterPlaybackPositionStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SampledPosition response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback SampledPosition read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116742,6 +127871,11 @@ class SubscribeAttributeMediaPlaybackSampledPosition : public SubscribeAttribute } reportHandler:^(MTRMediaPlaybackClusterPlaybackPositionStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SampledPosition response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116775,8 +127909,11 @@ class ReadMediaPlaybackPlaybackSpeed : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePlaybackSpeedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.PlaybackSpeed response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback PlaybackSpeed read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116820,6 +127957,11 @@ class SubscribeAttributeMediaPlaybackPlaybackSpeed : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.PlaybackSpeed response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116853,8 +127995,11 @@ class ReadMediaPlaybackSeekRangeEnd : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSeekRangeEndWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SeekRangeEnd response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback SeekRangeEnd read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116898,6 +128043,11 @@ class SubscribeAttributeMediaPlaybackSeekRangeEnd : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SeekRangeEnd response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -116931,8 +128081,11 @@ class ReadMediaPlaybackSeekRangeStart : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSeekRangeStartWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SeekRangeStart response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback SeekRangeStart read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -116976,6 +128129,11 @@ class SubscribeAttributeMediaPlaybackSeekRangeStart : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.SeekRangeStart response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117009,8 +128167,11 @@ class ReadMediaPlaybackGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117054,6 +128215,11 @@ class SubscribeAttributeMediaPlaybackGeneratedCommandList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117087,8 +128253,11 @@ class ReadMediaPlaybackAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117132,6 +128301,11 @@ class SubscribeAttributeMediaPlaybackAcceptedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117167,8 +128341,11 @@ class ReadMediaPlaybackEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117212,6 +128389,11 @@ class SubscribeAttributeMediaPlaybackEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117247,8 +128429,11 @@ class ReadMediaPlaybackAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117292,6 +128477,11 @@ class SubscribeAttributeMediaPlaybackAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117325,8 +128515,11 @@ class ReadMediaPlaybackFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117370,6 +128563,11 @@ class SubscribeAttributeMediaPlaybackFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117403,8 +128601,11 @@ class ReadMediaPlaybackClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaPlayback ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117448,6 +128649,11 @@ class SubscribeAttributeMediaPlaybackClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaPlayback.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117508,17 +128714,19 @@ class MediaInputSelectInput : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster selectInputWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + selectInputWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -117562,6 +128770,8 @@ class MediaInputShowInputStatus : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -117609,6 +128819,8 @@ class MediaInputHideInputStatus : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -117656,17 +128868,19 @@ class MediaInputRenameInput : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster renameInputWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + renameInputWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -117701,8 +128915,11 @@ class ReadMediaInputInputList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.InputList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput InputList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117746,6 +128963,11 @@ class SubscribeAttributeMediaInputInputList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.InputList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117779,8 +129001,11 @@ class ReadMediaInputCurrentInput : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentInputWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.CurrentInput response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput CurrentInput read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117824,6 +129049,11 @@ class SubscribeAttributeMediaInputCurrentInput : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.CurrentInput response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117857,8 +129087,11 @@ class ReadMediaInputGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117902,6 +129135,11 @@ class SubscribeAttributeMediaInputGeneratedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -117935,8 +129173,11 @@ class ReadMediaInputAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -117980,6 +129221,11 @@ class SubscribeAttributeMediaInputAcceptedCommandList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118015,8 +129261,11 @@ class ReadMediaInputEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118060,6 +129309,11 @@ class SubscribeAttributeMediaInputEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118095,8 +129349,11 @@ class ReadMediaInputAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118140,6 +129397,11 @@ class SubscribeAttributeMediaInputAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118173,8 +129435,11 @@ class ReadMediaInputFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118218,6 +129483,11 @@ class SubscribeAttributeMediaInputFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118251,8 +129521,11 @@ class ReadMediaInputClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("MediaInput ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118296,6 +129569,11 @@ class SubscribeAttributeMediaInputClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"MediaInput.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118353,6 +129631,7 @@ class LowPowerSleep : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -118389,8 +129668,11 @@ class ReadLowPowerGeneratedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118432,6 +129714,11 @@ class SubscribeAttributeLowPowerGeneratedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118463,8 +129750,11 @@ class ReadLowPowerAcceptedCommandList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118506,6 +129796,11 @@ class SubscribeAttributeLowPowerAcceptedCommandList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118539,8 +129834,11 @@ class ReadLowPowerEventList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118582,6 +129880,11 @@ class SubscribeAttributeLowPowerEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118615,8 +129918,11 @@ class ReadLowPowerAttributeList : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118658,6 +129964,11 @@ class SubscribeAttributeLowPowerAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118689,8 +130000,11 @@ class ReadLowPowerFeatureMap : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118732,6 +130046,11 @@ class SubscribeAttributeLowPowerFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118763,8 +130082,11 @@ class ReadLowPowerClusterRevision : public ReadAttribute { __auto_type * cluster = [[MTRBaseClusterLowPower alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("LowPower ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118806,6 +130128,11 @@ class SubscribeAttributeLowPowerClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"LowPower.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118864,10 +130191,18 @@ class KeypadInputSendKey : public ClusterCommand { [cluster sendKeyWithParams:params completion:^(MTRKeypadInputClusterSendKeyResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::KeypadInput::Commands::SendKeyResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -118907,8 +130242,11 @@ class ReadKeypadInputGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -118952,6 +130290,11 @@ class SubscribeAttributeKeypadInputGeneratedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -118985,8 +130328,11 @@ class ReadKeypadInputAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119030,6 +130376,11 @@ class SubscribeAttributeKeypadInputAcceptedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119065,8 +130416,11 @@ class ReadKeypadInputEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119110,6 +130464,11 @@ class SubscribeAttributeKeypadInputEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119145,8 +130504,11 @@ class ReadKeypadInputAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119190,6 +130552,11 @@ class SubscribeAttributeKeypadInputAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119223,8 +130590,11 @@ class ReadKeypadInputFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119268,6 +130638,11 @@ class SubscribeAttributeKeypadInputFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119301,8 +130676,11 @@ class ReadKeypadInputClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("KeypadInput ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119346,6 +130724,11 @@ class SubscribeAttributeKeypadInputClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"KeypadInput.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119447,19 +130830,29 @@ class ContentLauncherLaunchContent : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster launchContentWithParams:params - completion:^(MTRContentLauncherClusterLauncherResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + launchContentWithParams:params + completion:^( + MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -119686,19 +131079,28 @@ class ContentLauncherLaunchURL : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster launchURLWithParams:params - completion:^( - MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + launchURLWithParams:params + completion:^( + MTRContentLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ContentLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -119735,8 +131137,11 @@ class ReadContentLauncherAcceptHeader : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptHeaderWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AcceptHeader response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher AcceptHeader read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119780,6 +131185,11 @@ class SubscribeAttributeContentLauncherAcceptHeader : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AcceptHeader response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119813,8 +131223,11 @@ class ReadContentLauncherSupportedStreamingProtocols : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeSupportedStreamingProtocolsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.SupportedStreamingProtocols response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher SupportedStreamingProtocols read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119858,6 +131271,8 @@ class WriteContentLauncherSupportedStreamingProtocols : public WriteAttribute { if (error != nil) { LogNSError( "ContentLauncher SupportedStreamingProtocols write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119904,6 +131319,11 @@ class SubscribeAttributeContentLauncherSupportedStreamingProtocols : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.SupportedStreamingProtocols response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -119937,8 +131357,11 @@ class ReadContentLauncherGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -119982,6 +131405,11 @@ class SubscribeAttributeContentLauncherGeneratedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120015,8 +131443,11 @@ class ReadContentLauncherAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120060,6 +131491,11 @@ class SubscribeAttributeContentLauncherAcceptedCommandList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120095,8 +131531,11 @@ class ReadContentLauncherEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120140,6 +131579,11 @@ class SubscribeAttributeContentLauncherEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120175,8 +131619,11 @@ class ReadContentLauncherAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120220,6 +131667,11 @@ class SubscribeAttributeContentLauncherAttributeList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120253,8 +131705,11 @@ class ReadContentLauncherFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120298,6 +131753,11 @@ class SubscribeAttributeContentLauncherFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120331,8 +131791,11 @@ class ReadContentLauncherClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ContentLauncher ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120376,6 +131839,11 @@ class SubscribeAttributeContentLauncherClusterRevision : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ContentLauncher.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120434,17 +131902,19 @@ class AudioOutputSelectOutput : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster selectOutputWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + selectOutputWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -120488,17 +131958,19 @@ class AudioOutputRenameOutput : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster renameOutputWithParams:params - completion:^(NSError * _Nullable error) { - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + renameOutputWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -120533,8 +132005,11 @@ class ReadAudioOutputOutputList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOutputListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.OutputList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput OutputList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120578,6 +132053,11 @@ class SubscribeAttributeAudioOutputOutputList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.OutputList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120611,8 +132091,11 @@ class ReadAudioOutputCurrentOutput : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentOutputWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.CurrentOutput response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput CurrentOutput read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120656,6 +132139,11 @@ class SubscribeAttributeAudioOutputCurrentOutput : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.CurrentOutput response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120689,8 +132177,11 @@ class ReadAudioOutputGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120734,6 +132225,11 @@ class SubscribeAttributeAudioOutputGeneratedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120767,8 +132263,11 @@ class ReadAudioOutputAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120812,6 +132311,11 @@ class SubscribeAttributeAudioOutputAcceptedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120847,8 +132351,11 @@ class ReadAudioOutputEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120892,6 +132399,11 @@ class SubscribeAttributeAudioOutputEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -120927,8 +132439,11 @@ class ReadAudioOutputAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -120972,6 +132487,11 @@ class SubscribeAttributeAudioOutputAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121005,8 +132525,11 @@ class ReadAudioOutputFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121050,6 +132573,11 @@ class SubscribeAttributeAudioOutputFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121083,8 +132611,11 @@ class ReadAudioOutputClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AudioOutput ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121128,6 +132659,11 @@ class SubscribeAttributeAudioOutputClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AudioOutput.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121202,19 +132738,28 @@ class ApplicationLauncherLaunchApp : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster launchAppWithParams:params - completion:^(MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + launchAppWithParams:params + completion:^( + MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -121269,10 +132814,18 @@ class ApplicationLauncherStopApp : public ClusterCommand { completion:^( MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -121332,10 +132885,18 @@ class ApplicationLauncherHideApp : public ClusterCommand { completion:^( MTRApplicationLauncherClusterLauncherResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::ApplicationLauncher::Commands::LauncherResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -121377,8 +132938,11 @@ class ReadApplicationLauncherCatalogList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCatalogListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CatalogList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher CatalogList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121422,6 +132986,11 @@ class SubscribeAttributeApplicationLauncherCatalogList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CatalogList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121456,8 +133025,11 @@ class ReadApplicationLauncherCurrentApp : public ReadAttribute { [cluster readAttributeCurrentAppWithCompletion:^( MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CurrentApp response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher CurrentApp read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121515,6 +133087,8 @@ class WriteApplicationLauncherCurrentApp : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ApplicationLauncher CurrentApp write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121564,6 +133138,11 @@ class SubscribeAttributeApplicationLauncherCurrentApp : public SubscribeAttribut } reportHandler:^(MTRApplicationLauncherClusterApplicationEPStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.CurrentApp response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121597,8 +133176,11 @@ class ReadApplicationLauncherGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121642,6 +133224,11 @@ class SubscribeAttributeApplicationLauncherGeneratedCommandList : public Subscri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121675,8 +133262,11 @@ class ReadApplicationLauncherAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121720,6 +133310,11 @@ class SubscribeAttributeApplicationLauncherAcceptedCommandList : public Subscrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121755,8 +133350,11 @@ class ReadApplicationLauncherEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121800,6 +133398,11 @@ class SubscribeAttributeApplicationLauncherEventList : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121835,8 +133438,11 @@ class ReadApplicationLauncherAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121880,6 +133486,11 @@ class SubscribeAttributeApplicationLauncherAttributeList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121913,8 +133524,11 @@ class ReadApplicationLauncherFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -121958,6 +133572,11 @@ class SubscribeAttributeApplicationLauncherFeatureMap : public SubscribeAttribut } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -121991,8 +133610,11 @@ class ReadApplicationLauncherClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationLauncher ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122036,6 +133658,11 @@ class SubscribeAttributeApplicationLauncherClusterRevision : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationLauncher.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122093,8 +133720,11 @@ class ReadApplicationBasicVendorName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.VendorName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic VendorName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122138,6 +133768,11 @@ class SubscribeAttributeApplicationBasicVendorName : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.VendorName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122171,8 +133806,11 @@ class ReadApplicationBasicVendorID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.VendorID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic VendorID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122216,6 +133854,11 @@ class SubscribeAttributeApplicationBasicVendorID : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.VendorID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122249,8 +133892,11 @@ class ReadApplicationBasicApplicationName : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApplicationNameWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ApplicationName response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic ApplicationName read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122294,6 +133940,11 @@ class SubscribeAttributeApplicationBasicApplicationName : public SubscribeAttrib } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ApplicationName response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122327,8 +133978,11 @@ class ReadApplicationBasicProductID : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeProductIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ProductID response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic ProductID read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122372,6 +134026,11 @@ class SubscribeAttributeApplicationBasicProductID : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ProductID response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122406,8 +134065,11 @@ class ReadApplicationBasicApplication : public ReadAttribute { [cluster readAttributeApplicationWithCompletion:^( MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Application response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic Application read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122451,6 +134113,11 @@ class SubscribeAttributeApplicationBasicApplication : public SubscribeAttribute } reportHandler:^(MTRApplicationBasicClusterApplicationStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Application response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122484,8 +134151,11 @@ class ReadApplicationBasicStatus : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeStatusWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Status response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic Status read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122529,6 +134199,11 @@ class SubscribeAttributeApplicationBasicStatus : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.Status response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122562,8 +134237,11 @@ class ReadApplicationBasicApplicationVersion : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApplicationVersionWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ApplicationVersion response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic ApplicationVersion read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122607,6 +134285,11 @@ class SubscribeAttributeApplicationBasicApplicationVersion : public SubscribeAtt } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ApplicationVersion response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122640,8 +134323,11 @@ class ReadApplicationBasicAllowedVendorList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAllowedVendorListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AllowedVendorList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic AllowedVendorList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122685,6 +134371,11 @@ class SubscribeAttributeApplicationBasicAllowedVendorList : public SubscribeAttr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AllowedVendorList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122718,8 +134409,11 @@ class ReadApplicationBasicGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122763,6 +134457,11 @@ class SubscribeAttributeApplicationBasicGeneratedCommandList : public SubscribeA } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122796,8 +134495,11 @@ class ReadApplicationBasicAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122841,6 +134543,11 @@ class SubscribeAttributeApplicationBasicAcceptedCommandList : public SubscribeAt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122876,8 +134583,11 @@ class ReadApplicationBasicEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -122921,6 +134631,11 @@ class SubscribeAttributeApplicationBasicEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -122956,8 +134671,11 @@ class ReadApplicationBasicAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123001,6 +134719,11 @@ class SubscribeAttributeApplicationBasicAttributeList : public SubscribeAttribut } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123034,8 +134757,11 @@ class ReadApplicationBasicFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123079,6 +134805,11 @@ class SubscribeAttributeApplicationBasicFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123112,8 +134843,11 @@ class ReadApplicationBasicClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ApplicationBasic ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123157,6 +134891,11 @@ class SubscribeAttributeApplicationBasicClusterRevision : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ApplicationBasic.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123216,19 +134955,28 @@ class AccountLoginGetSetupPIN : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster getSetupPINWithParams:params - completion:^( - MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable values, NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + getSetupPINWithParams:params + completion:^( + MTRAccountLoginClusterGetSetupPINResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::AccountLogin::Commands::GetSetupPINResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -123280,6 +135028,7 @@ class AccountLoginLogin : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -123328,6 +135077,7 @@ class AccountLoginLogout : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -123366,8 +135116,11 @@ class ReadAccountLoginGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123411,6 +135164,11 @@ class SubscribeAttributeAccountLoginGeneratedCommandList : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123444,8 +135202,11 @@ class ReadAccountLoginAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123489,6 +135250,11 @@ class SubscribeAttributeAccountLoginAcceptedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123524,8 +135290,11 @@ class ReadAccountLoginEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123569,6 +135338,11 @@ class SubscribeAttributeAccountLoginEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123604,8 +135378,11 @@ class ReadAccountLoginAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123649,6 +135426,11 @@ class SubscribeAttributeAccountLoginAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123682,8 +135464,11 @@ class ReadAccountLoginFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123727,6 +135512,11 @@ class SubscribeAttributeAccountLoginFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123760,8 +135550,11 @@ class ReadAccountLoginClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("AccountLogin ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -123805,6 +135598,11 @@ class SubscribeAttributeAccountLoginClusterRevision : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"AccountLogin.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -123993,6 +135791,8 @@ class ElectricalMeasurementGetProfileInfoCommand : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -124047,6 +135847,8 @@ class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -124086,8 +135888,11 @@ class ReadElectricalMeasurementMeasurementType : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeMeasurementTypeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasurementType response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasurementType read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124131,6 +135936,11 @@ class SubscribeAttributeElectricalMeasurementMeasurementType : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasurementType response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124164,8 +135974,11 @@ class ReadElectricalMeasurementDcVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124209,6 +136022,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltage : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124242,8 +136060,11 @@ class ReadElectricalMeasurementDcVoltageMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltageMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124287,6 +136108,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltageMin : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124320,8 +136146,11 @@ class ReadElectricalMeasurementDcVoltageMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltageMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124365,6 +136194,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltageMax : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124398,8 +136232,11 @@ class ReadElectricalMeasurementDcCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124443,6 +136280,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrent : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124476,8 +136318,11 @@ class ReadElectricalMeasurementDcCurrentMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrentMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124521,6 +136366,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrentMin : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124554,8 +136404,11 @@ class ReadElectricalMeasurementDcCurrentMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrentMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124599,6 +136452,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrentMax : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124632,8 +136490,11 @@ class ReadElectricalMeasurementDcPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124677,6 +136538,11 @@ class SubscribeAttributeElectricalMeasurementDcPower : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124710,8 +136576,11 @@ class ReadElectricalMeasurementDcPowerMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPowerMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124755,6 +136624,11 @@ class SubscribeAttributeElectricalMeasurementDcPowerMin : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124788,8 +136662,11 @@ class ReadElectricalMeasurementDcPowerMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPowerMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124833,6 +136710,11 @@ class SubscribeAttributeElectricalMeasurementDcPowerMax : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124866,8 +136748,11 @@ class ReadElectricalMeasurementDcVoltageMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltageMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124911,6 +136796,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltageMultiplier : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -124944,8 +136834,11 @@ class ReadElectricalMeasurementDcVoltageDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcVoltageDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcVoltageDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -124989,6 +136882,11 @@ class SubscribeAttributeElectricalMeasurementDcVoltageDivisor : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcVoltageDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125022,8 +136920,11 @@ class ReadElectricalMeasurementDcCurrentMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrentMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125067,6 +136968,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrentMultiplier : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125100,8 +137006,11 @@ class ReadElectricalMeasurementDcCurrentDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcCurrentDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcCurrentDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125145,6 +137054,11 @@ class SubscribeAttributeElectricalMeasurementDcCurrentDivisor : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcCurrentDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125178,8 +137092,11 @@ class ReadElectricalMeasurementDcPowerMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPowerMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125223,6 +137140,11 @@ class SubscribeAttributeElectricalMeasurementDcPowerMultiplier : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125256,8 +137178,11 @@ class ReadElectricalMeasurementDcPowerDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeDcPowerDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement DcPowerDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125301,6 +137226,11 @@ class SubscribeAttributeElectricalMeasurementDcPowerDivisor : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.DcPowerDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125334,8 +137264,11 @@ class ReadElectricalMeasurementAcFrequency : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequency response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequency read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125379,6 +137312,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequency : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequency response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125412,8 +137350,11 @@ class ReadElectricalMeasurementAcFrequencyMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequencyMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125457,6 +137398,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequencyMin : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125490,8 +137436,11 @@ class ReadElectricalMeasurementAcFrequencyMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequencyMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125535,6 +137484,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequencyMax : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125568,8 +137522,11 @@ class ReadElectricalMeasurementNeutralCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNeutralCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.NeutralCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement NeutralCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125613,6 +137570,11 @@ class SubscribeAttributeElectricalMeasurementNeutralCurrent : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.NeutralCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125646,8 +137608,11 @@ class ReadElectricalMeasurementTotalActivePower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTotalActivePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalActivePower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement TotalActivePower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125691,6 +137656,11 @@ class SubscribeAttributeElectricalMeasurementTotalActivePower : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalActivePower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125724,8 +137694,11 @@ class ReadElectricalMeasurementTotalReactivePower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTotalReactivePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalReactivePower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement TotalReactivePower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125769,6 +137742,11 @@ class SubscribeAttributeElectricalMeasurementTotalReactivePower : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalReactivePower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125802,8 +137780,11 @@ class ReadElectricalMeasurementTotalApparentPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTotalApparentPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalApparentPower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement TotalApparentPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125847,6 +137828,11 @@ class SubscribeAttributeElectricalMeasurementTotalApparentPower : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.TotalApparentPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125881,8 +137867,11 @@ class ReadElectricalMeasurementMeasured1stHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured1stHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured1stHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured1stHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -125927,6 +137916,11 @@ class SubscribeAttributeElectricalMeasurementMeasured1stHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured1stHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -125961,8 +137955,11 @@ class ReadElectricalMeasurementMeasured3rdHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured3rdHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured3rdHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured3rdHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126007,6 +138004,11 @@ class SubscribeAttributeElectricalMeasurementMeasured3rdHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured3rdHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126041,8 +138043,11 @@ class ReadElectricalMeasurementMeasured5thHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured5thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured5thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured5thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126087,6 +138092,11 @@ class SubscribeAttributeElectricalMeasurementMeasured5thHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured5thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126121,8 +138131,11 @@ class ReadElectricalMeasurementMeasured7thHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured7thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured7thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured7thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126167,6 +138180,11 @@ class SubscribeAttributeElectricalMeasurementMeasured7thHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured7thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126201,8 +138219,11 @@ class ReadElectricalMeasurementMeasured9thHarmonicCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeMeasured9thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured9thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured9thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126247,6 +138268,11 @@ class SubscribeAttributeElectricalMeasurementMeasured9thHarmonicCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured9thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126281,8 +138307,11 @@ class ReadElectricalMeasurementMeasured11thHarmonicCurrent : public ReadAttribut queue:callbackQueue]; [cluster readAttributeMeasured11thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured11thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement Measured11thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126327,6 +138356,11 @@ class SubscribeAttributeElectricalMeasurementMeasured11thHarmonicCurrent : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.Measured11thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126362,8 +138396,11 @@ class ReadElectricalMeasurementMeasuredPhase1stHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase1stHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase1stHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase1stHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126408,6 +138445,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase1stHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase1stHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126443,8 +138485,11 @@ class ReadElectricalMeasurementMeasuredPhase3rdHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase3rdHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase3rdHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase3rdHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126489,6 +138534,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase3rdHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase3rdHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126524,8 +138574,11 @@ class ReadElectricalMeasurementMeasuredPhase5thHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase5thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase5thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase5thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126570,6 +138623,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase5thHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase5thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126605,8 +138663,11 @@ class ReadElectricalMeasurementMeasuredPhase7thHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase7thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase7thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase7thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126651,6 +138712,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase7thHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase7thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126686,8 +138752,11 @@ class ReadElectricalMeasurementMeasuredPhase9thHarmonicCurrent : public ReadAttr [cluster readAttributeMeasuredPhase9thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase9thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase9thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126732,6 +138801,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase9thHarmonicCurrent : p } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase9thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126767,8 +138841,11 @@ class ReadElectricalMeasurementMeasuredPhase11thHarmonicCurrent : public ReadAtt [cluster readAttributeMeasuredPhase11thHarmonicCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase11thHarmonicCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement MeasuredPhase11thHarmonicCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126813,6 +138890,11 @@ class SubscribeAttributeElectricalMeasurementMeasuredPhase11thHarmonicCurrent : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.MeasuredPhase11thHarmonicCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126846,8 +138928,11 @@ class ReadElectricalMeasurementAcFrequencyMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequencyMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126891,6 +138976,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequencyMultiplier : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -126924,8 +139014,11 @@ class ReadElectricalMeasurementAcFrequencyDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcFrequencyDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcFrequencyDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -126969,6 +139062,11 @@ class SubscribeAttributeElectricalMeasurementAcFrequencyDivisor : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcFrequencyDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127002,8 +139100,11 @@ class ReadElectricalMeasurementPowerMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127047,6 +139148,11 @@ class SubscribeAttributeElectricalMeasurementPowerMultiplier : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127080,8 +139186,11 @@ class ReadElectricalMeasurementPowerDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127125,6 +139234,11 @@ class SubscribeAttributeElectricalMeasurementPowerDivisor : public SubscribeAttr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127159,8 +139273,11 @@ class ReadElectricalMeasurementHarmonicCurrentMultiplier : public ReadAttribute queue:callbackQueue]; [cluster readAttributeHarmonicCurrentMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.HarmonicCurrentMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement HarmonicCurrentMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127205,6 +139322,11 @@ class SubscribeAttributeElectricalMeasurementHarmonicCurrentMultiplier : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.HarmonicCurrentMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127240,8 +139362,11 @@ class ReadElectricalMeasurementPhaseHarmonicCurrentMultiplier : public ReadAttri [cluster readAttributePhaseHarmonicCurrentMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PhaseHarmonicCurrentMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PhaseHarmonicCurrentMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127286,6 +139411,11 @@ class SubscribeAttributeElectricalMeasurementPhaseHarmonicCurrentMultiplier : pu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PhaseHarmonicCurrentMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127319,8 +139449,11 @@ class ReadElectricalMeasurementInstantaneousVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstantaneousVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127364,6 +139497,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousVoltage : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127398,8 +139536,11 @@ class ReadElectricalMeasurementInstantaneousLineCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstantaneousLineCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousLineCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousLineCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127444,6 +139585,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousLineCurrent : public S } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousLineCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127478,8 +139624,11 @@ class ReadElectricalMeasurementInstantaneousActiveCurrent : public ReadAttribute queue:callbackQueue]; [cluster readAttributeInstantaneousActiveCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousActiveCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousActiveCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127524,6 +139673,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousActiveCurrent : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousActiveCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127558,8 +139712,11 @@ class ReadElectricalMeasurementInstantaneousReactiveCurrent : public ReadAttribu queue:callbackQueue]; [cluster readAttributeInstantaneousReactiveCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousReactiveCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousReactiveCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127604,6 +139761,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousReactiveCurrent : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousReactiveCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127637,8 +139799,11 @@ class ReadElectricalMeasurementInstantaneousPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInstantaneousPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousPower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement InstantaneousPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127682,6 +139847,11 @@ class SubscribeAttributeElectricalMeasurementInstantaneousPower : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.InstantaneousPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127715,8 +139885,11 @@ class ReadElectricalMeasurementRmsVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127760,6 +139933,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltage : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127793,8 +139971,11 @@ class ReadElectricalMeasurementRmsVoltageMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127838,6 +140019,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMin : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127871,8 +140057,11 @@ class ReadElectricalMeasurementRmsVoltageMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127916,6 +140105,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMax : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -127949,8 +140143,11 @@ class ReadElectricalMeasurementRmsCurrent : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrent response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrent read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -127994,6 +140191,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrent : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrent response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128027,8 +140229,11 @@ class ReadElectricalMeasurementRmsCurrentMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128072,6 +140277,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMin : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128105,8 +140315,11 @@ class ReadElectricalMeasurementRmsCurrentMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128150,6 +140363,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMax : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128183,8 +140401,11 @@ class ReadElectricalMeasurementActivePower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128228,6 +140449,11 @@ class SubscribeAttributeElectricalMeasurementActivePower : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128261,8 +140487,11 @@ class ReadElectricalMeasurementActivePowerMin : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMinWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMin response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMin read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128306,6 +140535,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMin : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMin response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128339,8 +140573,11 @@ class ReadElectricalMeasurementActivePowerMax : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMaxWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMax response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMax read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128384,6 +140621,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMax : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMax response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128417,8 +140659,11 @@ class ReadElectricalMeasurementReactivePower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactivePowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactivePower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128462,6 +140707,11 @@ class SubscribeAttributeElectricalMeasurementReactivePower : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128495,8 +140745,11 @@ class ReadElectricalMeasurementApparentPower : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApparentPowerWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPower response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ApparentPower read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128540,6 +140793,11 @@ class SubscribeAttributeElectricalMeasurementApparentPower : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPower response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128573,8 +140831,11 @@ class ReadElectricalMeasurementPowerFactor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerFactorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerFactor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128618,6 +140879,11 @@ class SubscribeAttributeElectricalMeasurementPowerFactor : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128653,8 +140919,11 @@ class ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriod : public ReadA [cluster readAttributeAverageRmsVoltageMeasurementPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsVoltageMeasurementPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128699,6 +140968,8 @@ class WriteElectricalMeasurementAverageRmsVoltageMeasurementPeriod : public Writ LogNSError("ElectricalMeasurement " "AverageRmsVoltageMeasurementPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128746,6 +141017,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriod } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128780,8 +141056,11 @@ class ReadElectricalMeasurementAverageRmsUnderVoltageCounter : public ReadAttrib queue:callbackQueue]; [cluster readAttributeAverageRmsUnderVoltageCounterWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounter response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsUnderVoltageCounter read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128827,6 +141106,8 @@ class WriteElectricalMeasurementAverageRmsUnderVoltageCounter : public WriteAttr LogNSError( "ElectricalMeasurement AverageRmsUnderVoltageCounter write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128874,6 +141155,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounter : pub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounter response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -128908,8 +141194,11 @@ class ReadElectricalMeasurementRmsExtremeOverVoltagePeriod : public ReadAttribut queue:callbackQueue]; [cluster readAttributeRmsExtremeOverVoltagePeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeOverVoltagePeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -128955,6 +141244,8 @@ class WriteElectricalMeasurementRmsExtremeOverVoltagePeriod : public WriteAttrib LogNSError( "ElectricalMeasurement RmsExtremeOverVoltagePeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129002,6 +141293,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriod : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129036,8 +141332,11 @@ class ReadElectricalMeasurementRmsExtremeUnderVoltagePeriod : public ReadAttribu queue:callbackQueue]; [cluster readAttributeRmsExtremeUnderVoltagePeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeUnderVoltagePeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129083,6 +141382,8 @@ class WriteElectricalMeasurementRmsExtremeUnderVoltagePeriod : public WriteAttri LogNSError( "ElectricalMeasurement RmsExtremeUnderVoltagePeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129130,6 +141431,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriod : publ } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129163,8 +141469,11 @@ class ReadElectricalMeasurementRmsVoltageSagPeriod : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageSagPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSagPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129206,6 +141515,8 @@ class WriteElectricalMeasurementRmsVoltageSagPeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ElectricalMeasurement RmsVoltageSagPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129252,6 +141563,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriod : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129285,8 +141601,11 @@ class ReadElectricalMeasurementRmsVoltageSwellPeriod : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageSwellPeriodWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriod response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSwellPeriod read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129329,6 +141648,8 @@ class WriteElectricalMeasurementRmsVoltageSwellPeriod : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ElectricalMeasurement RmsVoltageSwellPeriod write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129375,6 +141696,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriod : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriod response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129408,8 +141734,11 @@ class ReadElectricalMeasurementAcVoltageMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcVoltageMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcVoltageMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129453,6 +141782,11 @@ class SubscribeAttributeElectricalMeasurementAcVoltageMultiplier : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129486,8 +141820,11 @@ class ReadElectricalMeasurementAcVoltageDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcVoltageDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcVoltageDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129531,6 +141868,11 @@ class SubscribeAttributeElectricalMeasurementAcVoltageDivisor : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129564,8 +141906,11 @@ class ReadElectricalMeasurementAcCurrentMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcCurrentMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcCurrentMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129609,6 +141954,11 @@ class SubscribeAttributeElectricalMeasurementAcCurrentMultiplier : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129642,8 +141992,11 @@ class ReadElectricalMeasurementAcCurrentDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcCurrentDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcCurrentDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129687,6 +142040,11 @@ class SubscribeAttributeElectricalMeasurementAcCurrentDivisor : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129720,8 +142078,11 @@ class ReadElectricalMeasurementAcPowerMultiplier : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcPowerMultiplierWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcPowerMultiplier response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcPowerMultiplier read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129765,6 +142126,11 @@ class SubscribeAttributeElectricalMeasurementAcPowerMultiplier : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcPowerMultiplier response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129798,8 +142164,11 @@ class ReadElectricalMeasurementAcPowerDivisor : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcPowerDivisorWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcPowerDivisor response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcPowerDivisor read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129843,6 +142212,11 @@ class SubscribeAttributeElectricalMeasurementAcPowerDivisor : public SubscribeAt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcPowerDivisor response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129876,8 +142250,11 @@ class ReadElectricalMeasurementOverloadAlarmsMask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOverloadAlarmsMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.OverloadAlarmsMask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement OverloadAlarmsMask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129919,6 +142296,8 @@ class WriteElectricalMeasurementOverloadAlarmsMask : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ElectricalMeasurement OverloadAlarmsMask write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -129965,6 +142344,11 @@ class SubscribeAttributeElectricalMeasurementOverloadAlarmsMask : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.OverloadAlarmsMask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -129998,8 +142382,11 @@ class ReadElectricalMeasurementVoltageOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVoltageOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.VoltageOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement VoltageOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130043,6 +142430,11 @@ class SubscribeAttributeElectricalMeasurementVoltageOverload : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.VoltageOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130076,8 +142468,11 @@ class ReadElectricalMeasurementCurrentOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCurrentOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.CurrentOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement CurrentOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130121,6 +142516,11 @@ class SubscribeAttributeElectricalMeasurementCurrentOverload : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.CurrentOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130154,8 +142554,11 @@ class ReadElectricalMeasurementAcOverloadAlarmsMask : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcOverloadAlarmsMaskWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcOverloadAlarmsMask response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcOverloadAlarmsMask read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130198,6 +142601,8 @@ class WriteElectricalMeasurementAcOverloadAlarmsMask : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("ElectricalMeasurement AcOverloadAlarmsMask write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130244,6 +142649,11 @@ class SubscribeAttributeElectricalMeasurementAcOverloadAlarmsMask : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcOverloadAlarmsMask response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130277,8 +142687,11 @@ class ReadElectricalMeasurementAcVoltageOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcVoltageOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcVoltageOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130322,6 +142735,11 @@ class SubscribeAttributeElectricalMeasurementAcVoltageOverload : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcVoltageOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130355,8 +142773,11 @@ class ReadElectricalMeasurementAcCurrentOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcCurrentOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcCurrentOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130400,6 +142821,11 @@ class SubscribeAttributeElectricalMeasurementAcCurrentOverload : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcCurrentOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130433,8 +142859,11 @@ class ReadElectricalMeasurementAcActivePowerOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcActivePowerOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcActivePowerOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcActivePowerOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130478,6 +142907,11 @@ class SubscribeAttributeElectricalMeasurementAcActivePowerOverload : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcActivePowerOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130512,8 +142946,11 @@ class ReadElectricalMeasurementAcReactivePowerOverload : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcReactivePowerOverloadWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcReactivePowerOverload response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcReactivePowerOverload read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130557,6 +142994,11 @@ class SubscribeAttributeElectricalMeasurementAcReactivePowerOverload : public Su } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcReactivePowerOverload response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130590,8 +143032,11 @@ class ReadElectricalMeasurementAverageRmsOverVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAverageRmsOverVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsOverVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130635,6 +143080,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsOverVoltage : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130669,8 +143119,11 @@ class ReadElectricalMeasurementAverageRmsUnderVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAverageRmsUnderVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsUnderVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130714,6 +143167,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltage : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130747,8 +143205,11 @@ class ReadElectricalMeasurementRmsExtremeOverVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsExtremeOverVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeOverVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130792,6 +143253,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltage : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130826,8 +143292,11 @@ class ReadElectricalMeasurementRmsExtremeUnderVoltage : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsExtremeUnderVoltageWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltage response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeUnderVoltage read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130871,6 +143340,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltage : public Sub } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltage response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130904,8 +143378,11 @@ class ReadElectricalMeasurementRmsVoltageSag : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageSagWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSag response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSag read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -130949,6 +143426,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSag : public SubscribeAtt } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSag response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -130982,8 +143464,11 @@ class ReadElectricalMeasurementRmsVoltageSwell : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageSwellWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwell response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSwell read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131027,6 +143512,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSwell : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwell response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131060,8 +143550,11 @@ class ReadElectricalMeasurementLineCurrentPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLineCurrentPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.LineCurrentPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement LineCurrentPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131105,6 +143598,11 @@ class SubscribeAttributeElectricalMeasurementLineCurrentPhaseB : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.LineCurrentPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131138,8 +143636,11 @@ class ReadElectricalMeasurementActiveCurrentPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveCurrentPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActiveCurrentPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131183,6 +143684,11 @@ class SubscribeAttributeElectricalMeasurementActiveCurrentPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131216,8 +143722,11 @@ class ReadElectricalMeasurementReactiveCurrentPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactiveCurrentPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactiveCurrentPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131261,6 +143770,11 @@ class SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseB : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131294,8 +143808,11 @@ class ReadElectricalMeasurementRmsVoltagePhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltagePhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltagePhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltagePhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131339,6 +143856,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltagePhaseB : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltagePhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131372,8 +143894,11 @@ class ReadElectricalMeasurementRmsVoltageMinPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMinPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMinPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131417,6 +143942,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131450,8 +143980,11 @@ class ReadElectricalMeasurementRmsVoltageMaxPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMaxPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMaxPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131495,6 +144028,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131528,8 +144066,11 @@ class ReadElectricalMeasurementRmsCurrentPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131573,6 +144114,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentPhaseB : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131606,8 +144152,11 @@ class ReadElectricalMeasurementRmsCurrentMinPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMinPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMinPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131651,6 +144200,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131684,8 +144238,11 @@ class ReadElectricalMeasurementRmsCurrentMaxPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMaxPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMaxPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131729,6 +144286,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131762,8 +144324,11 @@ class ReadElectricalMeasurementActivePowerPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131807,6 +144372,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerPhaseB : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131840,8 +144410,11 @@ class ReadElectricalMeasurementActivePowerMinPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMinPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMinPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131885,6 +144458,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMinPhaseB : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131918,8 +144496,11 @@ class ReadElectricalMeasurementActivePowerMaxPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMaxPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMaxPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -131963,6 +144544,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseB : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -131996,8 +144582,11 @@ class ReadElectricalMeasurementReactivePowerPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactivePowerPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePowerPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactivePowerPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132041,6 +144630,11 @@ class SubscribeAttributeElectricalMeasurementReactivePowerPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePowerPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132074,8 +144668,11 @@ class ReadElectricalMeasurementApparentPowerPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApparentPowerPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPowerPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ApparentPowerPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132119,6 +144716,11 @@ class SubscribeAttributeElectricalMeasurementApparentPowerPhaseB : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPowerPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132152,8 +144754,11 @@ class ReadElectricalMeasurementPowerFactorPhaseB : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerFactorPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactorPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerFactorPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132197,6 +144802,11 @@ class SubscribeAttributeElectricalMeasurementPowerFactorPhaseB : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactorPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132232,8 +144842,11 @@ class ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseB : public [cluster readAttributeAverageRmsVoltageMeasurementPeriodPhaseBWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsVoltageMeasurementPeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132278,6 +144891,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodP } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132313,8 +144931,11 @@ class ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseB : public ReadA [cluster readAttributeAverageRmsOverVoltageCounterPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsOverVoltageCounterPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132359,6 +144980,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseB } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132394,8 +145020,11 @@ class ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB : public Read [cluster readAttributeAverageRmsUnderVoltageCounterPhaseBWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsUnderVoltageCounterPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132440,6 +145069,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseB } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132475,8 +145109,11 @@ class ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB : public ReadAt [cluster readAttributeRmsExtremeOverVoltagePeriodPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeOverVoltagePeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132521,6 +145158,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseB : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132556,8 +145198,11 @@ class ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB : public ReadA [cluster readAttributeRmsExtremeUnderVoltagePeriodPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeUnderVoltagePeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132602,6 +145247,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseB } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132636,8 +145286,11 @@ class ReadElectricalMeasurementRmsVoltageSagPeriodPhaseB : public ReadAttribute queue:callbackQueue]; [cluster readAttributeRmsVoltageSagPeriodPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSagPeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132682,6 +145335,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseB : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132716,8 +145374,11 @@ class ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseB : public ReadAttribut queue:callbackQueue]; [cluster readAttributeRmsVoltageSwellPeriodPhaseBWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseB response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSwellPeriodPhaseB read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132762,6 +145423,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseB : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseB response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132795,8 +145461,11 @@ class ReadElectricalMeasurementLineCurrentPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLineCurrentPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.LineCurrentPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement LineCurrentPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132840,6 +145509,11 @@ class SubscribeAttributeElectricalMeasurementLineCurrentPhaseC : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.LineCurrentPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132873,8 +145547,11 @@ class ReadElectricalMeasurementActiveCurrentPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActiveCurrentPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActiveCurrentPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132918,6 +145595,11 @@ class SubscribeAttributeElectricalMeasurementActiveCurrentPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActiveCurrentPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -132951,8 +145633,11 @@ class ReadElectricalMeasurementReactiveCurrentPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactiveCurrentPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactiveCurrentPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -132996,6 +145681,11 @@ class SubscribeAttributeElectricalMeasurementReactiveCurrentPhaseC : public Subs } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactiveCurrentPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133029,8 +145719,11 @@ class ReadElectricalMeasurementRmsVoltagePhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltagePhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltagePhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltagePhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133074,6 +145767,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltagePhaseC : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltagePhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133107,8 +145805,11 @@ class ReadElectricalMeasurementRmsVoltageMinPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMinPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMinPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133152,6 +145853,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMinPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMinPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133185,8 +145891,11 @@ class ReadElectricalMeasurementRmsVoltageMaxPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsVoltageMaxPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageMaxPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133230,6 +145939,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageMaxPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageMaxPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133263,8 +145977,11 @@ class ReadElectricalMeasurementRmsCurrentPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133308,6 +146025,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentPhaseC : public Subscribe } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133341,8 +146063,11 @@ class ReadElectricalMeasurementRmsCurrentMinPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMinPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMinPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133386,6 +146111,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMinPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMinPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133419,8 +146149,11 @@ class ReadElectricalMeasurementRmsCurrentMaxPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRmsCurrentMaxPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsCurrentMaxPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133464,6 +146197,11 @@ class SubscribeAttributeElectricalMeasurementRmsCurrentMaxPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsCurrentMaxPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133497,8 +146235,11 @@ class ReadElectricalMeasurementActivePowerPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133542,6 +146283,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerPhaseC : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133575,8 +146321,11 @@ class ReadElectricalMeasurementActivePowerMinPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMinPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMinPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133620,6 +146369,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMinPhaseC : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMinPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133653,8 +146407,11 @@ class ReadElectricalMeasurementActivePowerMaxPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeActivePowerMaxPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ActivePowerMaxPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133698,6 +146455,11 @@ class SubscribeAttributeElectricalMeasurementActivePowerMaxPhaseC : public Subsc } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ActivePowerMaxPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133731,8 +146493,11 @@ class ReadElectricalMeasurementReactivePowerPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeReactivePowerPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePowerPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ReactivePowerPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133776,6 +146541,11 @@ class SubscribeAttributeElectricalMeasurementReactivePowerPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ReactivePowerPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133809,8 +146579,11 @@ class ReadElectricalMeasurementApparentPowerPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeApparentPowerPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPowerPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ApparentPowerPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133854,6 +146627,11 @@ class SubscribeAttributeElectricalMeasurementApparentPowerPhaseC : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ApparentPowerPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133887,8 +146665,11 @@ class ReadElectricalMeasurementPowerFactorPhaseC : public ReadAttribute { queue:callbackQueue]; [cluster readAttributePowerFactorPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactorPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement PowerFactorPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -133932,6 +146713,11 @@ class SubscribeAttributeElectricalMeasurementPowerFactorPhaseC : public Subscrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.PowerFactorPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -133967,8 +146753,11 @@ class ReadElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseC : public [cluster readAttributeAverageRmsVoltageMeasurementPeriodPhaseCWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsVoltageMeasurementPeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134013,6 +146802,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsVoltageMeasurementPeriodP } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsVoltageMeasurementPeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134048,8 +146842,11 @@ class ReadElectricalMeasurementAverageRmsOverVoltageCounterPhaseC : public ReadA [cluster readAttributeAverageRmsOverVoltageCounterPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsOverVoltageCounterPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134094,6 +146891,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsOverVoltageCounterPhaseC } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsOverVoltageCounterPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134129,8 +146931,11 @@ class ReadElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC : public Read [cluster readAttributeAverageRmsUnderVoltageCounterPhaseCWithCompletion:^( NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AverageRmsUnderVoltageCounterPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134175,6 +146980,11 @@ class SubscribeAttributeElectricalMeasurementAverageRmsUnderVoltageCounterPhaseC } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AverageRmsUnderVoltageCounterPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134210,8 +147020,11 @@ class ReadElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC : public ReadAt [cluster readAttributeRmsExtremeOverVoltagePeriodPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeOverVoltagePeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134256,6 +147069,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseC : } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeOverVoltagePeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134291,8 +147109,11 @@ class ReadElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC : public ReadA [cluster readAttributeRmsExtremeUnderVoltagePeriodPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsExtremeUnderVoltagePeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134337,6 +147158,11 @@ class SubscribeAttributeElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseC } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsExtremeUnderVoltagePeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134371,8 +147197,11 @@ class ReadElectricalMeasurementRmsVoltageSagPeriodPhaseC : public ReadAttribute queue:callbackQueue]; [cluster readAttributeRmsVoltageSagPeriodPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSagPeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134417,6 +147246,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSagPeriodPhaseC : public } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSagPeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134451,8 +147285,11 @@ class ReadElectricalMeasurementRmsVoltageSwellPeriodPhaseC : public ReadAttribut queue:callbackQueue]; [cluster readAttributeRmsVoltageSwellPeriodPhaseCWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseC response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement RmsVoltageSwellPeriodPhaseC read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134497,6 +147334,11 @@ class SubscribeAttributeElectricalMeasurementRmsVoltageSwellPeriodPhaseC : publi } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.RmsVoltageSwellPeriodPhaseC response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134530,8 +147372,11 @@ class ReadElectricalMeasurementGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134575,6 +147420,11 @@ class SubscribeAttributeElectricalMeasurementGeneratedCommandList : public Subsc } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134608,8 +147458,11 @@ class ReadElectricalMeasurementAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134653,6 +147506,11 @@ class SubscribeAttributeElectricalMeasurementAcceptedCommandList : public Subscr } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134688,8 +147546,11 @@ class ReadElectricalMeasurementEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134733,6 +147594,11 @@ class SubscribeAttributeElectricalMeasurementEventList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134768,8 +147634,11 @@ class ReadElectricalMeasurementAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134813,6 +147682,11 @@ class SubscribeAttributeElectricalMeasurementAttributeList : public SubscribeAtt } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134846,8 +147720,11 @@ class ReadElectricalMeasurementFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134891,6 +147768,11 @@ class SubscribeAttributeElectricalMeasurementFeatureMap : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -134924,8 +147806,11 @@ class ReadElectricalMeasurementClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("ElectricalMeasurement ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -134969,6 +147854,11 @@ class SubscribeAttributeElectricalMeasurementClusterRevision : public SubscribeA } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"ElectricalMeasurement.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -135133,6 +148023,7 @@ class UnitTestingTest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135180,6 +148071,8 @@ class UnitTestingTestNotHandled : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135221,19 +148114,28 @@ class UnitTestingTestSpecific : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testSpecificWithParams:params - completion:^(MTRUnitTestingClusterTestSpecificResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testSpecificWithParams:params + completion:^( + MTRUnitTestingClusterTestSpecificResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -135276,6 +148178,8 @@ class UnitTestingTestUnknownCommand : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135321,19 +148225,29 @@ class UnitTestingTestAddArguments : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testAddArgumentsWithParams:params - completion:^(MTRUnitTestingClusterTestAddArgumentsResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testAddArgumentsWithParams:params + completion:^(MTRUnitTestingClusterTestAddArgumentsResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestAddArgumentsResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -135373,19 +148287,30 @@ class UnitTestingTestSimpleArgumentRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testSimpleArgumentRequestWithParams:params - completion:^(MTRUnitTestingClusterTestSimpleArgumentResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testSimpleArgumentRequestWithParams:params + completion:^(MTRUnitTestingClusterTestSimpleArgumentResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestSimpleArgumentResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -135546,10 +148471,20 @@ class UnitTestingTestStructArrayArgumentRequest : public ClusterCommand { MTRUnitTestingClusterTestStructArrayArgumentResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestStructArrayArgumentResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestStructArrayArgumentResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135615,10 +148550,20 @@ class UnitTestingTestStructArgumentRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135682,10 +148627,20 @@ class UnitTestingTestNestedStructArgumentRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135754,10 +148709,20 @@ class UnitTestingTestListStructArgumentRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135817,10 +148782,20 @@ class UnitTestingTestListInt8UArgumentRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -135926,19 +148901,30 @@ class UnitTestingTestNestedStructListArgumentRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testNestedStructListArgumentRequestWithParams:params - completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testNestedStructListArgumentRequestWithParams:params + completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -136053,10 +149039,20 @@ class UnitTestingTestListNestedStructListArgumentRequest : public ClusterCommand completion:^(MTRUnitTestingClusterBooleanResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters:: + UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters:: + UnitTesting::Commands::BooleanResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136117,10 +149113,20 @@ class UnitTestingTestListInt8UReverseRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterTestListInt8UReverseResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestListInt8UReverseResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestListInt8UReverseResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136168,19 +149174,29 @@ class UnitTestingTestEnumsRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testEnumsRequestWithParams:params - completion:^(MTRUnitTestingClusterTestEnumsResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testEnumsRequestWithParams:params + completion:^( + MTRUnitTestingClusterTestEnumsResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestEnumsResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -136233,10 +149249,20 @@ class UnitTestingTestNullableOptionalRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterTestNullableOptionalResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestNullableOptionalResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestNullableOptionalResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136447,10 +149473,20 @@ class UnitTestingTestComplexNullableOptionalRequest : public ClusterCommand { MTRUnitTestingClusterTestComplexNullableOptionalResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestComplexNullableOptionalResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::UnitTesting:: + Commands::TestComplexNullableOptionalResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136524,10 +149560,20 @@ class UnitTestingSimpleStructEchoRequest : public ClusterCommand { completion:^(MTRUnitTestingClusterSimpleStructResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::SimpleStructResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136577,6 +149623,8 @@ class UnitTestingTimedInvokeRequest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136630,6 +149678,8 @@ class UnitTestingTestSimpleOptionalArgumentRequest : public ClusterCommand { if (error != nil) { mError = error; LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(commandId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136678,19 +149728,30 @@ class UnitTestingTestEmitTestEventRequest : public ClusterCommand { uint16_t repeatCount = mRepeatCount.ValueOr(1); uint16_t __block responsesNeeded = repeatCount; while (repeatCount--) { - [cluster testEmitTestEventRequestWithParams:params - completion:^(MTRUnitTestingClusterTestEmitTestEventResponseParams * _Nullable values, - NSError * _Nullable error) { - NSLog(@"Values: %@", values); - responsesNeeded--; - if (error != nil) { - mError = error; - LogNSError("Error", error); - } - if (responsesNeeded == 0) { - SetCommandExitStatus(mError); - } - }]; + [cluster + testEmitTestEventRequestWithParams:params + completion:^(MTRUnitTestingClusterTestEmitTestEventResponseParams * _Nullable values, + NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } @@ -136736,10 +149797,20 @@ class UnitTestingTestEmitTestFabricScopedEventRequest : public ClusterCommand { MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseParams * _Nullable values, NSError * _Nullable error) { NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters:: + UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON( + @(endpointId), @(clusterId), @(responseId), values); + } responsesNeeded--; if (error != nil) { mError = error; LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters:: + UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON( + @(endpointId), @(clusterId), @(responseId), error); } if (responsesNeeded == 0) { SetCommandExitStatus(mError); @@ -136779,8 +149850,11 @@ class ReadUnitTestingBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Boolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Boolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -136822,6 +149896,8 @@ class WriteUnitTestingBoolean : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Boolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -136868,6 +149944,11 @@ class SubscribeAttributeUnitTestingBoolean : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Boolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -136901,8 +149982,11 @@ class ReadUnitTestingBitmap8 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap8 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Bitmap8 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -136944,6 +150028,8 @@ class WriteUnitTestingBitmap8 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Bitmap8 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -136990,6 +150076,11 @@ class SubscribeAttributeUnitTestingBitmap8 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap8 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137023,8 +150114,11 @@ class ReadUnitTestingBitmap16 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBitmap16WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap16 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Bitmap16 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137066,6 +150160,8 @@ class WriteUnitTestingBitmap16 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Bitmap16 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137112,6 +150208,11 @@ class SubscribeAttributeUnitTestingBitmap16 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap16 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137145,8 +150246,11 @@ class ReadUnitTestingBitmap32 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBitmap32WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap32 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Bitmap32 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137188,6 +150292,8 @@ class WriteUnitTestingBitmap32 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Bitmap32 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137234,6 +150340,11 @@ class SubscribeAttributeUnitTestingBitmap32 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap32 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137267,8 +150378,11 @@ class ReadUnitTestingBitmap64 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeBitmap64WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap64 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Bitmap64 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137310,6 +150424,8 @@ class WriteUnitTestingBitmap64 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Bitmap64 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137356,6 +150472,11 @@ class SubscribeAttributeUnitTestingBitmap64 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Bitmap64 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137389,8 +150510,11 @@ class ReadUnitTestingInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137432,6 +150556,8 @@ class WriteUnitTestingInt8u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137478,6 +150604,11 @@ class SubscribeAttributeUnitTestingInt8u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137511,8 +150642,11 @@ class ReadUnitTestingInt16u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt16uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int16u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int16u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137554,6 +150688,8 @@ class WriteUnitTestingInt16u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int16u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137600,6 +150736,11 @@ class SubscribeAttributeUnitTestingInt16u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int16u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137633,8 +150774,11 @@ class ReadUnitTestingInt24u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt24uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int24u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int24u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137676,6 +150820,8 @@ class WriteUnitTestingInt24u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int24u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137722,6 +150868,11 @@ class SubscribeAttributeUnitTestingInt24u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int24u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137755,8 +150906,11 @@ class ReadUnitTestingInt32u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt32uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int32u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int32u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137798,6 +150952,8 @@ class WriteUnitTestingInt32u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int32u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137844,6 +151000,11 @@ class SubscribeAttributeUnitTestingInt32u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int32u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137877,8 +151038,11 @@ class ReadUnitTestingInt40u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt40uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int40u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int40u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137920,6 +151084,8 @@ class WriteUnitTestingInt40u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int40u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -137966,6 +151132,11 @@ class SubscribeAttributeUnitTestingInt40u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int40u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -137999,8 +151170,11 @@ class ReadUnitTestingInt48u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt48uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int48u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int48u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138042,6 +151216,8 @@ class WriteUnitTestingInt48u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int48u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138088,6 +151264,11 @@ class SubscribeAttributeUnitTestingInt48u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int48u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138121,8 +151302,11 @@ class ReadUnitTestingInt56u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt56uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int56u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int56u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138164,6 +151348,8 @@ class WriteUnitTestingInt56u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int56u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138210,6 +151396,11 @@ class SubscribeAttributeUnitTestingInt56u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int56u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138243,8 +151434,11 @@ class ReadUnitTestingInt64u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt64uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int64u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int64u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138286,6 +151480,8 @@ class WriteUnitTestingInt64u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int64u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138332,6 +151528,11 @@ class SubscribeAttributeUnitTestingInt64u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int64u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138365,8 +151566,11 @@ class ReadUnitTestingInt8s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt8sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int8s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int8s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138408,6 +151612,8 @@ class WriteUnitTestingInt8s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int8s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138454,6 +151660,11 @@ class SubscribeAttributeUnitTestingInt8s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int8s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138487,8 +151698,11 @@ class ReadUnitTestingInt16s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt16sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int16s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int16s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138530,6 +151744,8 @@ class WriteUnitTestingInt16s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int16s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138576,6 +151792,11 @@ class SubscribeAttributeUnitTestingInt16s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int16s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138609,8 +151830,11 @@ class ReadUnitTestingInt24s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt24sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int24s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int24s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138652,6 +151876,8 @@ class WriteUnitTestingInt24s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int24s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138698,6 +151924,11 @@ class SubscribeAttributeUnitTestingInt24s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int24s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138731,8 +151962,11 @@ class ReadUnitTestingInt32s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt32sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int32s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int32s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138774,6 +152008,8 @@ class WriteUnitTestingInt32s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int32s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138820,6 +152056,11 @@ class SubscribeAttributeUnitTestingInt32s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int32s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138853,8 +152094,11 @@ class ReadUnitTestingInt40s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt40sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int40s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int40s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138896,6 +152140,8 @@ class WriteUnitTestingInt40s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int40s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -138942,6 +152188,11 @@ class SubscribeAttributeUnitTestingInt40s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int40s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -138975,8 +152226,11 @@ class ReadUnitTestingInt48s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt48sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int48s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int48s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139018,6 +152272,8 @@ class WriteUnitTestingInt48s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int48s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139064,6 +152320,11 @@ class SubscribeAttributeUnitTestingInt48s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int48s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139097,8 +152358,11 @@ class ReadUnitTestingInt56s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt56sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int56s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int56s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139140,6 +152404,8 @@ class WriteUnitTestingInt56s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int56s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139186,6 +152452,11 @@ class SubscribeAttributeUnitTestingInt56s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int56s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139219,8 +152490,11 @@ class ReadUnitTestingInt64s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeInt64sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int64s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Int64s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139262,6 +152536,8 @@ class WriteUnitTestingInt64s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Int64s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139308,6 +152584,11 @@ class SubscribeAttributeUnitTestingInt64s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Int64s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139341,8 +152622,11 @@ class ReadUnitTestingEnum8 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnum8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Enum8 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Enum8 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139384,6 +152668,8 @@ class WriteUnitTestingEnum8 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Enum8 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139430,6 +152716,11 @@ class SubscribeAttributeUnitTestingEnum8 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Enum8 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139463,8 +152754,11 @@ class ReadUnitTestingEnum16 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnum16WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Enum16 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Enum16 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139506,6 +152800,8 @@ class WriteUnitTestingEnum16 : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Enum16 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139552,6 +152848,11 @@ class SubscribeAttributeUnitTestingEnum16 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Enum16 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139585,8 +152886,11 @@ class ReadUnitTestingFloatSingle : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFloatSingleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FloatSingle response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting FloatSingle read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139628,6 +152932,8 @@ class WriteUnitTestingFloatSingle : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting FloatSingle write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139674,6 +152980,11 @@ class SubscribeAttributeUnitTestingFloatSingle : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FloatSingle response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139707,8 +153018,11 @@ class ReadUnitTestingFloatDouble : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFloatDoubleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FloatDouble response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting FloatDouble read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139750,6 +153064,8 @@ class WriteUnitTestingFloatDouble : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting FloatDouble write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139796,6 +153112,11 @@ class SubscribeAttributeUnitTestingFloatDouble : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FloatDouble response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139829,8 +153150,11 @@ class ReadUnitTestingOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeOctetStringWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.OctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting OctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139872,6 +153196,8 @@ class WriteUnitTestingOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting OctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -139918,6 +153244,11 @@ class SubscribeAttributeUnitTestingOctetString : public SubscribeAttribute { } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.OctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -139951,8 +153282,11 @@ class ReadUnitTestingListInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeListInt8uWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140004,6 +153338,8 @@ class WriteUnitTestingListInt8u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140051,6 +153387,11 @@ class SubscribeAttributeUnitTestingListInt8u : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140084,8 +153425,11 @@ class ReadUnitTestingListOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeListOctetStringWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140137,6 +153481,8 @@ class WriteUnitTestingListOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140184,6 +153530,11 @@ class SubscribeAttributeUnitTestingListOctetString : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140217,8 +153568,11 @@ class ReadUnitTestingListStructOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeListStructOctetStringWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListStructOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListStructOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140272,6 +153626,8 @@ class WriteUnitTestingListStructOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListStructOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140320,6 +153676,11 @@ class SubscribeAttributeUnitTestingListStructOctetString : public SubscribeAttri } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListStructOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140353,8 +153714,11 @@ class ReadUnitTestingLongOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLongOctetStringWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.LongOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting LongOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140396,6 +153760,8 @@ class WriteUnitTestingLongOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting LongOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140442,6 +153808,11 @@ class SubscribeAttributeUnitTestingLongOctetString : public SubscribeAttribute { } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.LongOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140475,8 +153846,11 @@ class ReadUnitTestingCharString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.CharString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting CharString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140520,6 +153894,8 @@ class WriteUnitTestingCharString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting CharString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140566,6 +153942,11 @@ class SubscribeAttributeUnitTestingCharString : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.CharString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140599,8 +153980,11 @@ class ReadUnitTestingLongCharString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeLongCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.LongCharString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting LongCharString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140644,6 +154028,8 @@ class WriteUnitTestingLongCharString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting LongCharString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140690,6 +154076,11 @@ class SubscribeAttributeUnitTestingLongCharString : public SubscribeAttribute { } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.LongCharString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140723,8 +154114,11 @@ class ReadUnitTestingEpochUs : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEpochUsWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EpochUs response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting EpochUs read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140766,6 +154160,8 @@ class WriteUnitTestingEpochUs : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting EpochUs write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140812,6 +154208,11 @@ class SubscribeAttributeUnitTestingEpochUs : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EpochUs response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140845,8 +154246,11 @@ class ReadUnitTestingEpochS : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEpochSWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EpochS response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting EpochS read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140888,6 +154292,8 @@ class WriteUnitTestingEpochS : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting EpochS write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -140934,6 +154340,11 @@ class SubscribeAttributeUnitTestingEpochS : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EpochS response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -140967,8 +154378,11 @@ class ReadUnitTestingVendorId : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeVendorIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.VendorId response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting VendorId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141010,6 +154424,8 @@ class WriteUnitTestingVendorId : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting VendorId write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141056,6 +154472,11 @@ class SubscribeAttributeUnitTestingVendorId : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.VendorId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141090,8 +154511,11 @@ class ReadUnitTestingListNullablesAndOptionalsStruct : public ReadAttribute { [cluster readAttributeListNullablesAndOptionalsStructWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListNullablesAndOptionalsStruct response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListNullablesAndOptionalsStruct read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141296,6 +154720,8 @@ class WriteUnitTestingListNullablesAndOptionalsStruct : public WriteAttribute { LogNSError( "UnitTesting ListNullablesAndOptionalsStruct write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141345,6 +154771,11 @@ class SubscribeAttributeUnitTestingListNullablesAndOptionalsStruct : public Subs } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListNullablesAndOptionalsStruct response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141378,8 +154809,11 @@ class ReadUnitTestingEnumAttr : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEnumAttrWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EnumAttr response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting EnumAttr read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141421,6 +154855,8 @@ class WriteUnitTestingEnumAttr : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting EnumAttr write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141467,6 +154903,11 @@ class SubscribeAttributeUnitTestingEnumAttr : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EnumAttr response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141501,8 +154942,11 @@ class ReadUnitTestingStructAttr : public ReadAttribute { [cluster readAttributeStructAttrWithCompletion:^( MTRUnitTestingClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.StructAttr response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting StructAttr read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141554,6 +154998,8 @@ class WriteUnitTestingStructAttr : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting StructAttr write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141601,6 +155047,11 @@ class SubscribeAttributeUnitTestingStructAttr : public SubscribeAttribute { } reportHandler:^(MTRUnitTestingClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.StructAttr response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141634,8 +155085,11 @@ class ReadUnitTestingRangeRestrictedInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRangeRestrictedInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting RangeRestrictedInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141677,6 +155131,8 @@ class WriteUnitTestingRangeRestrictedInt8u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting RangeRestrictedInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141723,6 +155179,11 @@ class SubscribeAttributeUnitTestingRangeRestrictedInt8u : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141756,8 +155217,11 @@ class ReadUnitTestingRangeRestrictedInt8s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRangeRestrictedInt8sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt8s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting RangeRestrictedInt8s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141799,6 +155263,8 @@ class WriteUnitTestingRangeRestrictedInt8s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting RangeRestrictedInt8s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141845,6 +155311,11 @@ class SubscribeAttributeUnitTestingRangeRestrictedInt8s : public SubscribeAttrib } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt8s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -141878,8 +155349,11 @@ class ReadUnitTestingRangeRestrictedInt16u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRangeRestrictedInt16uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt16u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting RangeRestrictedInt16u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141921,6 +155395,8 @@ class WriteUnitTestingRangeRestrictedInt16u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting RangeRestrictedInt16u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -141967,6 +155443,11 @@ class SubscribeAttributeUnitTestingRangeRestrictedInt16u : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt16u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142000,8 +155481,11 @@ class ReadUnitTestingRangeRestrictedInt16s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeRangeRestrictedInt16sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt16s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting RangeRestrictedInt16s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142043,6 +155527,8 @@ class WriteUnitTestingRangeRestrictedInt16s : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting RangeRestrictedInt16s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142089,6 +155575,11 @@ class SubscribeAttributeUnitTestingRangeRestrictedInt16s : public SubscribeAttri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.RangeRestrictedInt16s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142122,8 +155613,11 @@ class ReadUnitTestingListLongOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeListLongOctetStringWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListLongOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListLongOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142175,6 +155669,8 @@ class WriteUnitTestingListLongOctetString : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListLongOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142222,6 +155718,11 @@ class SubscribeAttributeUnitTestingListLongOctetString : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListLongOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142260,8 +155761,13 @@ class ReadUnitTestingListFabricScoped : public ReadAttribute { [cluster readAttributeListFabricScopedWithParams:params completion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListFabricScoped response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON( + @(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ListFabricScoped read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142362,6 +155868,8 @@ class WriteUnitTestingListFabricScoped : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ListFabricScoped write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142410,6 +155918,11 @@ class SubscribeAttributeUnitTestingListFabricScoped : public SubscribeAttribute } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ListFabricScoped response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142443,8 +155956,11 @@ class ReadUnitTestingTimedWriteBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeTimedWriteBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.TimedWriteBoolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting TimedWriteBoolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142486,6 +156002,8 @@ class WriteUnitTestingTimedWriteBoolean : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting TimedWriteBoolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142532,6 +156050,11 @@ class SubscribeAttributeUnitTestingTimedWriteBoolean : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.TimedWriteBoolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142565,8 +156088,11 @@ class ReadUnitTestingGeneralErrorBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneralErrorBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.GeneralErrorBoolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting GeneralErrorBoolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142608,6 +156134,8 @@ class WriteUnitTestingGeneralErrorBoolean : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting GeneralErrorBoolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142654,6 +156182,11 @@ class SubscribeAttributeUnitTestingGeneralErrorBoolean : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.GeneralErrorBoolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142687,8 +156220,11 @@ class ReadUnitTestingClusterErrorBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterErrorBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ClusterErrorBoolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ClusterErrorBoolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142730,6 +156266,8 @@ class WriteUnitTestingClusterErrorBoolean : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting ClusterErrorBoolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142776,6 +156314,11 @@ class SubscribeAttributeUnitTestingClusterErrorBoolean : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ClusterErrorBoolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142809,8 +156352,11 @@ class ReadUnitTestingUnsupported : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeUnsupportedWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Unsupported response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting Unsupported read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142852,6 +156398,8 @@ class WriteUnitTestingUnsupported : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting Unsupported write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142898,6 +156446,11 @@ class SubscribeAttributeUnitTestingUnsupported : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.Unsupported response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -142931,8 +156484,11 @@ class ReadUnitTestingNullableBoolean : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBoolean response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBoolean read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142967,13 +156523,18 @@ class WriteUnitTestingNullableBoolean : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithBool:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithBool:mValue.Value()]; + } [cluster writeAttributeNullableBooleanWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBoolean write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -142981,7 +156542,7 @@ class WriteUnitTestingNullableBoolean : public WriteAttribute { } private: - bool mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBoolean : public SubscribeAttribute { @@ -143020,6 +156581,11 @@ class SubscribeAttributeUnitTestingNullableBoolean : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBoolean response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143053,8 +156619,11 @@ class ReadUnitTestingNullableBitmap8 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBitmap8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap8 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBitmap8 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143089,13 +156658,18 @@ class WriteUnitTestingNullableBitmap8 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableBitmap8WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBitmap8 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143103,7 +156677,7 @@ class WriteUnitTestingNullableBitmap8 : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBitmap8 : public SubscribeAttribute { @@ -143142,6 +156716,11 @@ class SubscribeAttributeUnitTestingNullableBitmap8 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap8 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143175,8 +156754,11 @@ class ReadUnitTestingNullableBitmap16 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBitmap16WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap16 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBitmap16 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143211,13 +156793,18 @@ class WriteUnitTestingNullableBitmap16 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeNullableBitmap16WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBitmap16 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143225,7 +156812,7 @@ class WriteUnitTestingNullableBitmap16 : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBitmap16 : public SubscribeAttribute { @@ -143264,6 +156851,11 @@ class SubscribeAttributeUnitTestingNullableBitmap16 : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap16 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143297,8 +156889,11 @@ class ReadUnitTestingNullableBitmap32 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBitmap32WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap32 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBitmap32 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143333,13 +156928,18 @@ class WriteUnitTestingNullableBitmap32 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeNullableBitmap32WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBitmap32 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143347,7 +156947,7 @@ class WriteUnitTestingNullableBitmap32 : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBitmap32 : public SubscribeAttribute { @@ -143386,6 +156986,11 @@ class SubscribeAttributeUnitTestingNullableBitmap32 : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap32 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143419,8 +157024,11 @@ class ReadUnitTestingNullableBitmap64 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableBitmap64WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap64 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableBitmap64 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143455,13 +157063,18 @@ class WriteUnitTestingNullableBitmap64 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableBitmap64WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableBitmap64 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143469,7 +157082,7 @@ class WriteUnitTestingNullableBitmap64 : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableBitmap64 : public SubscribeAttribute { @@ -143508,6 +157121,11 @@ class SubscribeAttributeUnitTestingNullableBitmap64 : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableBitmap64 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143541,8 +157159,11 @@ class ReadUnitTestingNullableInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143577,13 +157198,18 @@ class WriteUnitTestingNullableInt8u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableInt8uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143591,7 +157217,7 @@ class WriteUnitTestingNullableInt8u : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt8u : public SubscribeAttribute { @@ -143630,6 +157256,11 @@ class SubscribeAttributeUnitTestingNullableInt8u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143663,8 +157294,11 @@ class ReadUnitTestingNullableInt16u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt16uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt16u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt16u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143699,13 +157333,18 @@ class WriteUnitTestingNullableInt16u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeNullableInt16uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt16u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143713,7 +157352,7 @@ class WriteUnitTestingNullableInt16u : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt16u : public SubscribeAttribute { @@ -143752,6 +157391,11 @@ class SubscribeAttributeUnitTestingNullableInt16u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt16u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143785,8 +157429,11 @@ class ReadUnitTestingNullableInt24u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt24uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt24u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt24u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143821,13 +157468,18 @@ class WriteUnitTestingNullableInt24u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeNullableInt24uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt24u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143835,7 +157487,7 @@ class WriteUnitTestingNullableInt24u : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt24u : public SubscribeAttribute { @@ -143874,6 +157526,11 @@ class SubscribeAttributeUnitTestingNullableInt24u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt24u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -143907,8 +157564,11 @@ class ReadUnitTestingNullableInt32u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt32uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt32u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt32u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143943,13 +157603,18 @@ class WriteUnitTestingNullableInt32u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedInt:mValue.Value()]; + } [cluster writeAttributeNullableInt32uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt32u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -143957,7 +157622,7 @@ class WriteUnitTestingNullableInt32u : public WriteAttribute { } private: - uint32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt32u : public SubscribeAttribute { @@ -143996,6 +157661,11 @@ class SubscribeAttributeUnitTestingNullableInt32u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt32u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144029,8 +157699,11 @@ class ReadUnitTestingNullableInt40u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt40uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt40u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt40u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144065,13 +157738,18 @@ class WriteUnitTestingNullableInt40u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt40uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt40u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144079,7 +157757,7 @@ class WriteUnitTestingNullableInt40u : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt40u : public SubscribeAttribute { @@ -144118,6 +157796,11 @@ class SubscribeAttributeUnitTestingNullableInt40u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt40u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144151,8 +157834,11 @@ class ReadUnitTestingNullableInt48u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt48uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt48u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt48u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144187,13 +157873,18 @@ class WriteUnitTestingNullableInt48u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt48uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt48u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144201,7 +157892,7 @@ class WriteUnitTestingNullableInt48u : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt48u : public SubscribeAttribute { @@ -144240,6 +157931,11 @@ class SubscribeAttributeUnitTestingNullableInt48u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt48u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144273,8 +157969,11 @@ class ReadUnitTestingNullableInt56u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt56uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt56u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt56u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144309,13 +158008,18 @@ class WriteUnitTestingNullableInt56u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt56uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt56u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144323,7 +158027,7 @@ class WriteUnitTestingNullableInt56u : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt56u : public SubscribeAttribute { @@ -144362,6 +158066,11 @@ class SubscribeAttributeUnitTestingNullableInt56u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt56u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144395,8 +158104,11 @@ class ReadUnitTestingNullableInt64u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt64uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt64u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt64u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144431,13 +158143,18 @@ class WriteUnitTestingNullableInt64u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt64uWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt64u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144445,7 +158162,7 @@ class WriteUnitTestingNullableInt64u : public WriteAttribute { } private: - uint64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt64u : public SubscribeAttribute { @@ -144484,6 +158201,11 @@ class SubscribeAttributeUnitTestingNullableInt64u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt64u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144517,8 +158239,11 @@ class ReadUnitTestingNullableInt8s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt8sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt8s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt8s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144553,13 +158278,18 @@ class WriteUnitTestingNullableInt8s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithChar:mValue.Value()]; + } [cluster writeAttributeNullableInt8sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt8s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144567,7 +158297,7 @@ class WriteUnitTestingNullableInt8s : public WriteAttribute { } private: - int8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt8s : public SubscribeAttribute { @@ -144606,6 +158336,11 @@ class SubscribeAttributeUnitTestingNullableInt8s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt8s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144639,8 +158374,11 @@ class ReadUnitTestingNullableInt16s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt16sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt16s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt16s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144675,13 +158413,18 @@ class WriteUnitTestingNullableInt16s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithShort:mValue.Value()]; + } [cluster writeAttributeNullableInt16sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt16s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144689,7 +158432,7 @@ class WriteUnitTestingNullableInt16s : public WriteAttribute { } private: - int16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt16s : public SubscribeAttribute { @@ -144728,6 +158471,11 @@ class SubscribeAttributeUnitTestingNullableInt16s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt16s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144761,8 +158509,11 @@ class ReadUnitTestingNullableInt24s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt24sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt24s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt24s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144797,13 +158548,18 @@ class WriteUnitTestingNullableInt24s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithInt:mValue.Value()]; + } [cluster writeAttributeNullableInt24sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt24s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144811,7 +158567,7 @@ class WriteUnitTestingNullableInt24s : public WriteAttribute { } private: - int32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt24s : public SubscribeAttribute { @@ -144850,6 +158606,11 @@ class SubscribeAttributeUnitTestingNullableInt24s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt24s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -144883,8 +158644,11 @@ class ReadUnitTestingNullableInt32s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt32sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt32s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt32s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144919,13 +158683,18 @@ class WriteUnitTestingNullableInt32s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithInt:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithInt:mValue.Value()]; + } [cluster writeAttributeNullableInt32sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt32s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -144933,7 +158702,7 @@ class WriteUnitTestingNullableInt32s : public WriteAttribute { } private: - int32_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt32s : public SubscribeAttribute { @@ -144972,6 +158741,11 @@ class SubscribeAttributeUnitTestingNullableInt32s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt32s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145005,8 +158779,11 @@ class ReadUnitTestingNullableInt40s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt40sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt40s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt40s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145041,13 +158818,18 @@ class WriteUnitTestingNullableInt40s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt40sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt40s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145055,7 +158837,7 @@ class WriteUnitTestingNullableInt40s : public WriteAttribute { } private: - int64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt40s : public SubscribeAttribute { @@ -145094,6 +158876,11 @@ class SubscribeAttributeUnitTestingNullableInt40s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt40s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145127,8 +158914,11 @@ class ReadUnitTestingNullableInt48s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt48sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt48s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt48s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145163,13 +158953,18 @@ class WriteUnitTestingNullableInt48s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt48sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt48s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145177,7 +158972,7 @@ class WriteUnitTestingNullableInt48s : public WriteAttribute { } private: - int64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt48s : public SubscribeAttribute { @@ -145216,6 +159011,11 @@ class SubscribeAttributeUnitTestingNullableInt48s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt48s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145249,8 +159049,11 @@ class ReadUnitTestingNullableInt56s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt56sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt56s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt56s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145285,13 +159088,18 @@ class WriteUnitTestingNullableInt56s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt56sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt56s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145299,7 +159107,7 @@ class WriteUnitTestingNullableInt56s : public WriteAttribute { } private: - int64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt56s : public SubscribeAttribute { @@ -145338,6 +159146,11 @@ class SubscribeAttributeUnitTestingNullableInt56s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt56s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145371,8 +159184,11 @@ class ReadUnitTestingNullableInt64s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableInt64sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt64s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableInt64s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145407,13 +159223,18 @@ class WriteUnitTestingNullableInt64s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithLongLong:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithLongLong:mValue.Value()]; + } [cluster writeAttributeNullableInt64sWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableInt64s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145421,7 +159242,7 @@ class WriteUnitTestingNullableInt64s : public WriteAttribute { } private: - int64_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableInt64s : public SubscribeAttribute { @@ -145460,6 +159281,11 @@ class SubscribeAttributeUnitTestingNullableInt64s : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableInt64s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145493,8 +159319,11 @@ class ReadUnitTestingNullableEnum8 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableEnum8WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnum8 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableEnum8 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145529,13 +159358,18 @@ class WriteUnitTestingNullableEnum8 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableEnum8WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableEnum8 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145543,7 +159377,7 @@ class WriteUnitTestingNullableEnum8 : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableEnum8 : public SubscribeAttribute { @@ -145582,6 +159416,11 @@ class SubscribeAttributeUnitTestingNullableEnum8 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnum8 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145615,8 +159454,11 @@ class ReadUnitTestingNullableEnum16 : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableEnum16WithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnum16 response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableEnum16 read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145651,13 +159493,18 @@ class WriteUnitTestingNullableEnum16 : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeNullableEnum16WithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableEnum16 write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145665,7 +159512,7 @@ class WriteUnitTestingNullableEnum16 : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableEnum16 : public SubscribeAttribute { @@ -145704,6 +159551,11 @@ class SubscribeAttributeUnitTestingNullableEnum16 : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnum16 response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145737,8 +159589,11 @@ class ReadUnitTestingNullableFloatSingle : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableFloatSingleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableFloatSingle response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableFloatSingle read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145773,13 +159628,18 @@ class WriteUnitTestingNullableFloatSingle : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithFloat:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithFloat:mValue.Value()]; + } [cluster writeAttributeNullableFloatSingleWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableFloatSingle write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145787,7 +159647,7 @@ class WriteUnitTestingNullableFloatSingle : public WriteAttribute { } private: - float mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableFloatSingle : public SubscribeAttribute { @@ -145826,6 +159686,11 @@ class SubscribeAttributeUnitTestingNullableFloatSingle : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableFloatSingle response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145859,8 +159724,11 @@ class ReadUnitTestingNullableFloatDouble : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableFloatDoubleWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableFloatDouble response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableFloatDouble read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145895,13 +159763,18 @@ class WriteUnitTestingNullableFloatDouble : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithDouble:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithDouble:mValue.Value()]; + } [cluster writeAttributeNullableFloatDoubleWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableFloatDouble write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -145909,7 +159782,7 @@ class WriteUnitTestingNullableFloatDouble : public WriteAttribute { } private: - double mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableFloatDouble : public SubscribeAttribute { @@ -145948,6 +159821,11 @@ class SubscribeAttributeUnitTestingNullableFloatDouble : public SubscribeAttribu } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableFloatDouble response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -145981,8 +159859,11 @@ class ReadUnitTestingNullableOctetString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableOctetStringWithCompletion:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableOctetString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableOctetString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146017,13 +159898,18 @@ class WriteUnitTestingNullableOctetString : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSData * _Nullable value = [[NSData alloc] initWithBytes:mValue.data() length:mValue.size()]; + NSData * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [[NSData alloc] initWithBytes:mValue.Value().data() length:mValue.Value().size()]; + } [cluster writeAttributeNullableOctetStringWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableOctetString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146031,7 +159917,7 @@ class WriteUnitTestingNullableOctetString : public WriteAttribute { } private: - chip::ByteSpan mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableOctetString : public SubscribeAttribute { @@ -146070,6 +159956,11 @@ class SubscribeAttributeUnitTestingNullableOctetString : public SubscribeAttribu } reportHandler:^(NSData * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableOctetString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146103,8 +159994,11 @@ class ReadUnitTestingNullableCharString : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableCharStringWithCompletion:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableCharString response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableCharString read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146139,15 +160033,20 @@ class WriteUnitTestingNullableCharString : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSString * _Nullable value = [[NSString alloc] initWithBytes:mValue.data() - length:mValue.size() - encoding:NSUTF8StringEncoding]; + NSString * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [[NSString alloc] initWithBytes:mValue.Value().data() + length:mValue.Value().size() + encoding:NSUTF8StringEncoding]; + } [cluster writeAttributeNullableCharStringWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableCharString write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146155,7 +160054,7 @@ class WriteUnitTestingNullableCharString : public WriteAttribute { } private: - chip::ByteSpan mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableCharString : public SubscribeAttribute { @@ -146194,6 +160093,11 @@ class SubscribeAttributeUnitTestingNullableCharString : public SubscribeAttribut } reportHandler:^(NSString * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableCharString response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146227,8 +160131,11 @@ class ReadUnitTestingNullableEnumAttr : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableEnumAttrWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnumAttr response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableEnumAttr read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146263,13 +160170,18 @@ class WriteUnitTestingNullableEnumAttr : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableEnumAttrWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableEnumAttr write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146277,7 +160189,7 @@ class WriteUnitTestingNullableEnumAttr : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableEnumAttr : public SubscribeAttribute { @@ -146316,6 +160228,11 @@ class SubscribeAttributeUnitTestingNullableEnumAttr : public SubscribeAttribute } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableEnumAttr response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146350,8 +160267,11 @@ class ReadUnitTestingNullableStruct : public ReadAttribute { [cluster readAttributeNullableStructWithCompletion:^( MTRUnitTestingClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableStruct response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableStruct read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146409,6 +160329,8 @@ class WriteUnitTestingNullableStruct : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting NullableStruct write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146456,6 +160378,11 @@ class SubscribeAttributeUnitTestingNullableStruct : public SubscribeAttribute { } reportHandler:^(MTRUnitTestingClusterSimpleStruct * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableStruct response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146489,8 +160416,11 @@ class ReadUnitTestingNullableRangeRestrictedInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableRangeRestrictedInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableRangeRestrictedInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146525,7 +160455,10 @@ class WriteUnitTestingNullableRangeRestrictedInt8u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedChar:mValue.Value()]; + } [cluster writeAttributeNullableRangeRestrictedInt8uWithValue:value params:params @@ -146533,6 +160466,8 @@ class WriteUnitTestingNullableRangeRestrictedInt8u : public WriteAttribute { if (error != nil) { LogNSError("UnitTesting NullableRangeRestrictedInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146540,7 +160475,7 @@ class WriteUnitTestingNullableRangeRestrictedInt8u : public WriteAttribute { } private: - uint8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableRangeRestrictedInt8u : public SubscribeAttribute { @@ -146579,6 +160514,11 @@ class SubscribeAttributeUnitTestingNullableRangeRestrictedInt8u : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146612,8 +160552,11 @@ class ReadUnitTestingNullableRangeRestrictedInt8s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableRangeRestrictedInt8sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt8s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableRangeRestrictedInt8s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146648,7 +160591,10 @@ class WriteUnitTestingNullableRangeRestrictedInt8s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithChar:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithChar:mValue.Value()]; + } [cluster writeAttributeNullableRangeRestrictedInt8sWithValue:value params:params @@ -146656,6 +160602,8 @@ class WriteUnitTestingNullableRangeRestrictedInt8s : public WriteAttribute { if (error != nil) { LogNSError("UnitTesting NullableRangeRestrictedInt8s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146663,7 +160611,7 @@ class WriteUnitTestingNullableRangeRestrictedInt8s : public WriteAttribute { } private: - int8_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableRangeRestrictedInt8s : public SubscribeAttribute { @@ -146702,6 +160650,11 @@ class SubscribeAttributeUnitTestingNullableRangeRestrictedInt8s : public Subscri } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt8s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146735,8 +160688,11 @@ class ReadUnitTestingNullableRangeRestrictedInt16u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableRangeRestrictedInt16uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt16u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableRangeRestrictedInt16u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146771,7 +160727,10 @@ class WriteUnitTestingNullableRangeRestrictedInt16u : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithUnsignedShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithUnsignedShort:mValue.Value()]; + } [cluster writeAttributeNullableRangeRestrictedInt16uWithValue:value @@ -146780,6 +160739,8 @@ class WriteUnitTestingNullableRangeRestrictedInt16u : public WriteAttribute { if (error != nil) { LogNSError( "UnitTesting NullableRangeRestrictedInt16u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146787,7 +160748,7 @@ class WriteUnitTestingNullableRangeRestrictedInt16u : public WriteAttribute { } private: - uint16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableRangeRestrictedInt16u : public SubscribeAttribute { @@ -146826,6 +160787,11 @@ class SubscribeAttributeUnitTestingNullableRangeRestrictedInt16u : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt16u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146859,8 +160825,11 @@ class ReadUnitTestingNullableRangeRestrictedInt16s : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeNullableRangeRestrictedInt16sWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt16s response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting NullableRangeRestrictedInt16s read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146895,7 +160864,10 @@ class WriteUnitTestingNullableRangeRestrictedInt16s : public WriteAttribute { params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; - NSNumber * _Nullable value = [NSNumber numberWithShort:mValue]; + NSNumber * _Nullable value = nil; + if (!mValue.IsNull()) { + value = [NSNumber numberWithShort:mValue.Value()]; + } [cluster writeAttributeNullableRangeRestrictedInt16sWithValue:value @@ -146904,6 +160876,8 @@ class WriteUnitTestingNullableRangeRestrictedInt16s : public WriteAttribute { if (error != nil) { LogNSError( "UnitTesting NullableRangeRestrictedInt16s write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -146911,7 +160885,7 @@ class WriteUnitTestingNullableRangeRestrictedInt16s : public WriteAttribute { } private: - int16_t mValue; + chip::app::DataModel::Nullable mValue; }; class SubscribeAttributeUnitTestingNullableRangeRestrictedInt16s : public SubscribeAttribute { @@ -146950,6 +160924,11 @@ class SubscribeAttributeUnitTestingNullableRangeRestrictedInt16s : public Subscr } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.NullableRangeRestrictedInt16s response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -146983,8 +160962,11 @@ class ReadUnitTestingWriteOnlyInt8u : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeWriteOnlyInt8uWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.WriteOnlyInt8u response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting WriteOnlyInt8u read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147026,6 +161008,8 @@ class WriteUnitTestingWriteOnlyInt8u : public WriteAttribute { completion:^(NSError * _Nullable error) { if (error != nil) { LogNSError("UnitTesting WriteOnlyInt8u write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147072,6 +161056,11 @@ class SubscribeAttributeUnitTestingWriteOnlyInt8u : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.WriteOnlyInt8u response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147105,8 +161094,11 @@ class ReadUnitTestingGeneratedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.GeneratedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147150,6 +161142,11 @@ class SubscribeAttributeUnitTestingGeneratedCommandList : public SubscribeAttrib } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147183,8 +161180,11 @@ class ReadUnitTestingAcceptedCommandList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.AcceptedCommandList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147228,6 +161228,11 @@ class SubscribeAttributeUnitTestingAcceptedCommandList : public SubscribeAttribu } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147263,8 +161268,11 @@ class ReadUnitTestingEventList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EventList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147308,6 +161316,11 @@ class SubscribeAttributeUnitTestingEventList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147343,8 +161356,11 @@ class ReadUnitTestingAttributeList : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.AttributeList response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147388,6 +161404,11 @@ class SubscribeAttributeUnitTestingAttributeList : public SubscribeAttribute { } reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147421,8 +161442,11 @@ class ReadUnitTestingFeatureMap : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FeatureMap response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147466,6 +161490,11 @@ class SubscribeAttributeUnitTestingFeatureMap : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; @@ -147499,8 +161528,11 @@ class ReadUnitTestingClusterRevision : public ReadAttribute { queue:callbackQueue]; [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ClusterRevision response %@", [value description]); - if (error != nil) { + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { LogNSError("UnitTesting ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); }]; @@ -147544,6 +161576,11 @@ class SubscribeAttributeUnitTestingClusterRevision : public SubscribeAttribute { } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { NSLog(@"UnitTesting.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } SetCommandExitStatus(error); }]; From 4197b3e94cf062ce836cc185be45163a0b5d74f5 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 7 Sep 2023 14:37:14 -0400 Subject: [PATCH 039/134] Silence warnings about descriptions not being handled when running YAML tests. (#29111) We kept getting these warnings: TEST ERR : WARNING:root:TAG configurator::cluster::description was not handled/recognized at src/app/zap-templates/zcl/data-model/chip/fixed-label-cluster.xml:33:7 TEST ERR : WARNING:root:TAG configurator::cluster::command::description was not handled/recognized at src/app/zap-templates/zcl/data-model/chip/dishwasher-mode-cluster.xml:47:6 TEST ERR : WARNING:root:TAG configurator::clusterExtension::command::description was not handled/recognized at src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml:21:104 The fix is to change DescriptionHandler to note that it's handling the tag. This also lets us switch events to also use DescriptionHandler. --- scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py index 966d875c3355ed..9545d5ce8b51db 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py @@ -110,7 +110,7 @@ def GetNextProcessor(self, name: str, attrs): self._event.readacl = AttrsToAccessPrivilege(attrs) return BaseHandler(self.context, handled=HandledDepth.SINGLE_TAG) elif name.lower() == 'description': - return BaseHandler(self.context, handled=HandledDepth.ENTIRE_TREE) + return DescriptionHandler(self.context, self._event) else: return BaseHandler(self.context) @@ -347,7 +347,7 @@ class DescriptionHandler(BaseHandler): """ def __init__(self, context: Context, target: Any): - super().__init__(context) + super().__init__(context, handled=HandledDepth.ENTIRE_TREE) self.target = target def HandleContent(self, content): From 416bc51d269c37be364794d8311bd73d48ab17af Mon Sep 17 00:00:00 2001 From: Matt Hazley Date: Thu, 7 Sep 2023 21:25:22 +0100 Subject: [PATCH 040/134] Setting the feature map of all concentration clusters to 0 in zapfile so that we don't accidentally pass CI if the cluster fails to encode it (#29104) --- .../all-clusters-app.matter | 20 +++++++++---------- .../all-clusters-common/all-clusters-app.zap | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 705324367f39e9..0350bdc758adcd 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -7233,7 +7233,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7252,7 +7252,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7271,7 +7271,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7290,7 +7290,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7309,7 +7309,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7328,7 +7328,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7347,7 +7347,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7366,7 +7366,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7385,7 +7385,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } @@ -7404,7 +7404,7 @@ endpoint 1 { callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; - ram attribute featureMap default = 63; + ram attribute featureMap default = 0; ram attribute clusterRevision default = 3; } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 191519900a4990..6d4e6c60c4fec4 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -24162,7 +24162,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24486,7 +24486,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -24810,7 +24810,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -25134,7 +25134,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -25458,7 +25458,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -25782,7 +25782,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -26106,7 +26106,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -26430,7 +26430,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -26754,7 +26754,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -27078,7 +27078,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "63", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, From 9d95c4f8acfd44eee293d3c082a8d95ff12fd607 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 7 Sep 2023 13:36:33 -0700 Subject: [PATCH 041/134] Typo fix in the API documentation (#29112) --- src/app/WriteClient.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/WriteClient.h b/src/app/WriteClient.h index 99c8682605c569..2323adc8a337e9 100644 --- a/src/app/WriteClient.h +++ b/src/app/WriteClient.h @@ -46,10 +46,10 @@ namespace app { class InteractionModelEngine; /** - * @brief The read client represents the initiator side of a Write Interaction, and is responsible + * @brief The write client represents the initiator side of a Write Interaction, and is responsible * for generating one Write Request for a particular set of attributes, and handling the Write response. - * Consumer can allocate one write client, then call PrepareAttribute, insert attribute value, followed by FinishAttribute for - * every attribute it wants to insert in write request, then call SendWriteRequest + * Consumer can allocate one write client, then call PrepareAttribute, insert attribute value, followed + * by FinishAttribute for every attribute it wants to insert in write request, then call SendWriteRequest * * Note: When writing lists, you may receive multiple write status responses for a single list. * Please see ChunkedWriteCallback.h for a high level API which will merge status codes for From 94b71b1f97549f6a6622e1775a43100633789a60 Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:11:55 -0400 Subject: [PATCH 042/134] Added unit test for Early firing timers in the report scheduler (#29113) --- src/app/reporting/ReportScheduler.h | 1 + src/app/tests/TestReadInteraction.cpp | 143 ++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) diff --git a/src/app/reporting/ReportScheduler.h b/src/app/reporting/ReportScheduler.h index 54b0bb5062286f..43441be73bddf5 100644 --- a/src/app/reporting/ReportScheduler.h +++ b/src/app/reporting/ReportScheduler.h @@ -171,6 +171,7 @@ class ReportScheduler : public ReadHandler::Observer, public ICDStateObserver ReadHandlerNode * node = FindReadHandlerNode(aReadHandler); return node->GetMaxTimestamp(); } + ReadHandlerNode * GetReadHandlerNode(const ReadHandler * aReadHandler) { return FindReadHandlerNode(aReadHandler); } #endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST protected: diff --git a/src/app/tests/TestReadInteraction.cpp b/src/app/tests/TestReadInteraction.cpp index ea464c3d9471b0..7a6c88d2f04341 100644 --- a/src/app/tests/TestReadInteraction.cpp +++ b/src/app/tests/TestReadInteraction.cpp @@ -321,6 +321,9 @@ bool IsDeviceTypeOnEndpoint(DeviceTypeId deviceType, EndpointId endpoint) class TestReadInteraction { + using Seconds16 = System::Clock::Seconds16; + using Milliseconds32 = System::Clock::Milliseconds32; + public: static void TestReadClient(nlTestSuite * apSuite, void * apContext); static void TestReadUnexpectedSubscriptionId(nlTestSuite * apSuite, void * apContext); @@ -349,6 +352,7 @@ class TestReadInteraction static void TestReadChunking(nlTestSuite * apSuite, void * apContext); static void TestSetDirtyBetweenChunks(nlTestSuite * apSuite, void * apContext); static void TestSubscribeRoundtrip(nlTestSuite * apSuite, void * apContext); + static void TestSubscribeEarlyReport(nlTestSuite * apSuite, void * apContext); static void TestSubscribeUrgentWildcardEvent(nlTestSuite * apSuite, void * apContext); static void TestSubscribeWildcard(nlTestSuite * apSuite, void * apContext); static void TestSubscribePartialOverlap(nlTestSuite * apSuite, void * apContext); @@ -2099,6 +2103,144 @@ void TestReadInteraction::TestSubscribeRoundtrip(nlTestSuite * apSuite, void * a NL_TEST_ASSERT(apSuite, ctx.GetExchangeManager().GetNumActiveExchanges() == 0); } +void TestReadInteraction::TestSubscribeEarlyReport(nlTestSuite * apSuite, void * apContext) +{ + TestContext & ctx = *static_cast(apContext); + CHIP_ERROR err = CHIP_NO_ERROR; + + Messaging::ReliableMessageMgr * rm = ctx.GetExchangeManager().GetReliableMessageMgr(); + // Shouldn't have anything in the retransmit table when starting the test. + NL_TEST_ASSERT(apSuite, rm->TestGetCountRetransTable() == 0); + + MockInteractionModelApp delegate; + auto * engine = chip::app::InteractionModelEngine::GetInstance(); + ReportSchedulerImpl * reportScheduler = app::reporting::GetDefaultReportScheduler(); + err = engine->Init(&ctx.GetExchangeManager(), &ctx.GetFabricTable(), reportScheduler); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + NL_TEST_ASSERT(apSuite, !delegate.mGotEventResponse); + + ReadPrepareParams readPrepareParams(ctx.GetSessionBobToAlice()); + chip::app::EventPathParams eventPathParams[1]; + readPrepareParams.mpEventPathParamsList = eventPathParams; + readPrepareParams.mpEventPathParamsList[0].mEndpointId = kTestEventEndpointId; + readPrepareParams.mpEventPathParamsList[0].mClusterId = kTestEventClusterId; + + readPrepareParams.mEventPathParamsListSize = 1; + + readPrepareParams.mpAttributePathParamsList = nullptr; + readPrepareParams.mAttributePathParamsListSize = 0; + + readPrepareParams.mMinIntervalFloorSeconds = 1; + readPrepareParams.mMaxIntervalCeilingSeconds = 5; + + readPrepareParams.mKeepSubscriptions = true; + + { + app::ReadClient readClient(chip::app::InteractionModelEngine::GetInstance(), &ctx.GetExchangeManager(), delegate, + chip::app::ReadClient::InteractionType::Subscribe); + readPrepareParams.mpEventPathParamsList[0].mIsUrgentEvent = true; + delegate.mGotEventResponse = false; + err = readClient.SendRequest(readPrepareParams); + NL_TEST_ASSERT(apSuite, err == CHIP_NO_ERROR); + + ctx.DrainAndServiceIO(); + System::Clock::Timestamp startTime = gMockClock.GetMonotonicTimestamp(); + + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers() == 1); + NL_TEST_ASSERT(apSuite, engine->ActiveHandlerAt(0) != nullptr); + delegate.mpReadHandler = engine->ActiveHandlerAt(0); + + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); + NL_TEST_ASSERT(apSuite, engine->GetNumActiveReadHandlers(ReadHandler::InteractionType::Subscribe) == 1); + + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMinIntervalFloorSeconds)); + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMaxTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMaxIntervalCeilingSeconds)); + + // Confirm that the node is scheduled to run + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportScheduled(delegate.mpReadHandler)); + ReportScheduler::ReadHandlerNode * node = reportScheduler->GetReadHandlerNode(delegate.mpReadHandler); + NL_TEST_ASSERT(apSuite, node != nullptr); + + GenerateEvents(apSuite, apContext); + + // modify the node's min timestamp to be 50ms later than the timer expiration time + node->SetIntervalTimeStamps(delegate.mpReadHandler, startTime + Milliseconds32(50)); + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMinIntervalFloorSeconds) + + Milliseconds32(50)); + + NL_TEST_ASSERT(apSuite, reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) > startTime); + NL_TEST_ASSERT(apSuite, delegate.mpReadHandler->IsDirty()); + + // Advance monotonic timestamp for min interval to elapse + gMockClock.AdvanceMonotonic(Seconds16(readPrepareParams.mMinIntervalFloorSeconds)); + NL_TEST_ASSERT(apSuite, !InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + // Service Timer expired event + ctx.GetIOContext().DriveIO(); + + // Verify the ReadHandler is considered as reportable even if its node's min timestamp has not expired + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) > gMockClock.GetMonotonicTimestamp()); + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportableNow(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + + // Service Engine Run + ctx.GetIOContext().DriveIO(); + // Service EventManagement event + ctx.GetIOContext().DriveIO(); + ctx.GetIOContext().DriveIO(); + NL_TEST_ASSERT(apSuite, delegate.mGotEventResponse); + + // Check the logic works for timer expiring at maximum as well + NL_TEST_ASSERT(apSuite, !delegate.mpReadHandler->IsDirty()); + delegate.mGotEventResponse = false; + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMinTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMinIntervalFloorSeconds)); + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMaxTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMaxIntervalCeilingSeconds)); + + // Confirm that the node is scheduled to run + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportScheduled(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, node != nullptr); + + // modify the node's max timestamp to be 50ms later than the timer expiration time + node->SetIntervalTimeStamps(delegate.mpReadHandler, gMockClock.GetMonotonicTimestamp() + Milliseconds32(50)); + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMaxTimestampForHandler(delegate.mpReadHandler) == + gMockClock.GetMonotonicTimestamp() + Seconds16(readPrepareParams.mMaxIntervalCeilingSeconds) + + Milliseconds32(50)); + + // Advance monotonic timestamp for min interval to elapse + gMockClock.AdvanceMonotonic(Seconds16(readPrepareParams.mMaxIntervalCeilingSeconds)); + + NL_TEST_ASSERT(apSuite, !InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + // Service Timer expired event + ctx.GetIOContext().DriveIO(); + + // Verify the ReadHandler is considered as reportable even if its node's min timestamp has not expired + NL_TEST_ASSERT(apSuite, + reportScheduler->GetMaxTimestampForHandler(delegate.mpReadHandler) > gMockClock.GetMonotonicTimestamp()); + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportableNow(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, !reportScheduler->IsReportScheduled(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, !delegate.mpReadHandler->IsDirty()); + NL_TEST_ASSERT(apSuite, InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + // Service Engine Run + ctx.GetIOContext().DriveIO(); + // Service EventManagement event + ctx.GetIOContext().DriveIO(); + ctx.GetIOContext().DriveIO(); + NL_TEST_ASSERT(apSuite, reportScheduler->IsReportScheduled(delegate.mpReadHandler)); + NL_TEST_ASSERT(apSuite, !InteractionModelEngine::GetInstance()->GetReportingEngine().IsRunScheduled()); + } +} + void TestReadInteraction::TestSubscribeUrgentWildcardEvent(nlTestSuite * apSuite, void * apContext) { TestContext & ctx = *static_cast(apContext); @@ -4796,6 +4938,7 @@ const nlTest sTests[] = NL_TEST_DEF("TestICDProcessSubscribeRequestInvalidIdleModeInterval", chip::app::TestReadInteraction::TestICDProcessSubscribeRequestInvalidIdleModeInterval), #endif // #if CHIP_CONFIG_ENABLE_ICD_SERVER NL_TEST_DEF("TestSubscribeRoundtrip", chip::app::TestReadInteraction::TestSubscribeRoundtrip), + NL_TEST_DEF("TestSubscribeEarlyReport", chip::app::TestReadInteraction::TestSubscribeEarlyReport), NL_TEST_DEF("TestPostSubscribeRoundtripChunkReport", chip::app::TestReadInteraction::TestPostSubscribeRoundtripChunkReport), NL_TEST_DEF("TestReadClientReceiveInvalidMessage", chip::app::TestReadInteraction::TestReadClientReceiveInvalidMessage), NL_TEST_DEF("TestSubscribeClientReceiveInvalidStatusResponse", chip::app::TestReadInteraction::TestSubscribeClientReceiveInvalidStatusResponse), From 9384bf66288674285ca2ae7c3195deead82c9efc Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 7 Sep 2023 19:44:26 -0400 Subject: [PATCH 043/134] Update description tag handling in xml (#29114) * Update description tag handling in xml * enable description on events * Fix test --- scripts/py_matter_idl/matter_idl/matter_idl_types.py | 1 + scripts/py_matter_idl/matter_idl/test_xml_parser.py | 1 + scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/py_matter_idl/matter_idl/matter_idl_types.py b/scripts/py_matter_idl/matter_idl/matter_idl_types.py index eb86e3ec4b99fc..3a680058c5e24d 100644 --- a/scripts/py_matter_idl/matter_idl/matter_idl_types.py +++ b/scripts/py_matter_idl/matter_idl/matter_idl_types.py @@ -166,6 +166,7 @@ class Event: fields: List[Field] readacl: AccessPrivilege = AccessPrivilege.VIEW qualities: EventQuality = EventQuality.NONE + description: Optional[str] = None @property def is_fabric_sensitive(self): diff --git a/scripts/py_matter_idl/matter_idl/test_xml_parser.py b/scripts/py_matter_idl/matter_idl/test_xml_parser.py index d8c7bb0a6c5dc1..6f42ca3c71d6b7 100755 --- a/scripts/py_matter_idl/matter_idl/test_xml_parser.py +++ b/scripts/py_matter_idl/matter_idl/test_xml_parser.py @@ -212,6 +212,7 @@ def testFabricScopedAndSensitive(self): events=[Event(priority=EventPriority.INFO, name='FabricEvent', code=0x1234, + description="This is a test event", fields=[Field(data_type=DataType(name='node_id'), code=1, name='AdminNodeID', diff --git a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py index 9545d5ce8b51db..8150924efe1c4c 100644 --- a/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py +++ b/scripts/py_matter_idl/matter_idl/zapxml/handlers/handlers.py @@ -347,7 +347,7 @@ class DescriptionHandler(BaseHandler): """ def __init__(self, context: Context, target: Any): - super().__init__(context, handled=HandledDepth.ENTIRE_TREE) + super().__init__(context, handled=HandledDepth.SINGLE_TAG) self.target = target def HandleContent(self, content): From 013412713049332f886f589ca004fee31df49072 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 8 Sep 2023 00:10:45 -0400 Subject: [PATCH 044/134] Update ZAP to v2023.09.05-nightly. (#29095) This should fix UI issues around enabling/disabling events. The .zap changes are from ZAP files that were last edited/generated with a too-old version of ZAP (from before v2023.08.30-nightly). --- .../rootnode_dishwasher_cc105034fe.zap | 3 +- .../rootnode_laundrywasher_fb10d238c8.zap | 3 +- .../chef/devices/rootnode_pump_5f904818cc.zap | 39 +++++++------------ ...emperaturecontrolledcabinet_ffdb696680.zap | 3 +- .../refrigerator-common/refrigerator-app.zap | 33 +++------------- .../resource-monitoring-app.zap | 15 ++++--- scripts/setup/zap.json | 4 +- scripts/setup/zap.version | 2 +- scripts/tools/zap/zap_execution.py | 2 +- 9 files changed, 34 insertions(+), 70 deletions(-) diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index bdd388535f5020..df18b2b1ff5e45 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -10833,6 +10833,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 185729bcbfc1e3..85c94b1a55186b 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -11081,6 +11081,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.zap b/examples/chef/devices/rootnode_pump_5f904818cc.zap index bd00cd5534b9fa..6966139ba33d50 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.zap +++ b/examples/chef/devices/rootnode_pump_5f904818cc.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6244,7 +6239,6 @@ "id": 2, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", @@ -6252,16 +6246,12 @@ }, "deviceTypes": [ { - "id": 14, "code": 771, "profileId": 2457, "label": "MA-pump", "name": "MA-pump" } ], - "deviceTypeRefs": [ - 14 - ], "deviceVersions": [ 1 ], @@ -7689,7 +7679,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7705,7 +7695,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7721,7 +7711,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7737,7 +7727,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7981,7 +7971,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -7997,7 +7987,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8013,7 +8003,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8029,7 +8019,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8193,7 +8183,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8209,7 +8199,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8225,7 +8215,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8241,7 +8231,7 @@ "side": "server", "type": "array", "included": 1, - "storageOption": "RAM", + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": "", @@ -8302,6 +8292,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index c41e00c3ca48d6..449ce9ef3cd474 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -12727,6 +12727,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap index feb4bcca1dda01..5752fd943abbd9 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -33,10 +33,9 @@ ], "endpointTypes": [ { - "id": 8, + "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -6252,10 +6247,9 @@ ] }, { - "id": 7, + "id": 2, "name": "MA-refrigerator", "deviceTypeRef": { - "id": 48, "code": 112, "profileId": 259, "label": "MA-refrigerator", @@ -6263,16 +6257,12 @@ }, "deviceTypes": [ { - "id": 48, "code": 112, "profileId": 259, "label": "MA-refrigerator", "name": "MA-refrigerator" } ], - "deviceTypeRefs": [ - 48 - ], "deviceVersions": [ 1 ], @@ -11686,10 +11676,9 @@ ] }, { - "id": 5, + "id": 3, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", @@ -11697,16 +11686,12 @@ }, "deviceTypes": [ { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", "name": "MA-temperature-controlled-cabinet" } ], - "deviceTypeRefs": [ - 51 - ], "deviceVersions": [ 1 ], @@ -12202,10 +12187,9 @@ ] }, { - "id": 6, + "id": 4, "name": "Anonymous Endpoint Type", "deviceTypeRef": { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", @@ -12213,16 +12197,12 @@ }, "deviceTypes": [ { - "id": 51, "code": 113, "profileId": 259, "label": "MA-temperature-controlled-cabinet", "name": "MA-temperature-controlled-cabinet" } ], - "deviceTypeRefs": [ - 51 - ], "deviceVersions": [ 1 ], @@ -12747,6 +12727,5 @@ "endpointId": 3, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index 60857f16ab28e3..1124e42b5cc5f2 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -16,12 +16,6 @@ } ], "package": [ - { - "pathRelativity": "relativeToZap", - "path": "../../../src/app/zap-templates/app-templates.json", - "type": "gen-templates-json", - "version": "chip-v1" - }, { "pathRelativity": "relativeToZap", "path": "../../../src/app/zap-templates/zcl/zcl.json", @@ -29,6 +23,12 @@ "category": "matter", "version": 1, "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" } ], "endpointTypes": [ @@ -6993,6 +6993,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index d763e123ff712b..3b1253b9ee0045 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2023.09.01-nightly.1"] + "tags": ["version:2@v2023.09.05-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2023.09.01-nightly.1"] + "tags": ["version:2@v2023.09.05-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index 5af16d0daf37f9..f3a4acca4e93d2 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.09.01-nightly +v2023.09.05-nightly diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index 5dbff86656cd17..bd5f609d4164d5 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.9.1' +MIN_ZAP_VERSION = '2023.9.5' class ZapTool: From ce66c4da38ac20070c0ab0e8701a3621d79fa831 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 8 Sep 2023 00:59:45 -0400 Subject: [PATCH 045/134] Make MatterReportingAttributeChangeCallback calls in operational state server a bit smaller. (#29028) Having the path creation be inside the common out-of-line callee saves some codesize. --- .../operational-state-server.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/app/clusters/operational-state-server/operational-state-server.cpp b/src/app/clusters/operational-state-server/operational-state-server.cpp index ea8ecd3df1f06f..0c8c4f907b1ab8 100644 --- a/src/app/clusters/operational-state-server/operational-state-server.cpp +++ b/src/app/clusters/operational-state-server/operational-state-server.cpp @@ -78,8 +78,7 @@ CHIP_ERROR Instance::SetCurrentPhase(const DataModel::Nullable & aPhase mCurrentPhase = aPhase; if (mCurrentPhase != oldPhase) { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::CurrentPhase::Id); - MatterReportingAttributeChangeCallback(path); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::CurrentPhase::Id); } return CHIP_NO_ERROR; } @@ -95,16 +94,14 @@ CHIP_ERROR Instance::SetOperationalState(uint8_t aOpState) if (mOperationalError.errorStateID != to_underlying(ErrorStateEnum::kNoError)) { mOperationalError.Set(to_underlying(ErrorStateEnum::kNoError)); - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::OperationalError::Id); - MatterReportingAttributeChangeCallback(path); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::OperationalError::Id); } uint8_t oldState = mOperationalState; mOperationalState = aOpState; if (mOperationalState != oldState) { - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::OperationalState::Id); - MatterReportingAttributeChangeCallback(path); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::OperationalState::Id); } return CHIP_NO_ERROR; } @@ -130,17 +127,15 @@ void Instance::OnOperationalErrorDetected(const Structs::ErrorStateStruct::Type // Set the OperationalState attribute to Error if (mOperationalState != to_underlying(OperationalStateEnum::kError)) { - mOperationalState = to_underlying(OperationalStateEnum::kError); - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::OperationalState::Id); - MatterReportingAttributeChangeCallback(path); + mOperationalState = to_underlying(OperationalStateEnum::kError); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::OperationalState::Id); } // Set the OperationalError attribute if (!mOperationalError.IsEqual(aError)) { mOperationalError.Set(aError.errorStateID, aError.errorStateLabel, aError.errorStateDetails); - ConcreteAttributePath path = ConcreteAttributePath(mEndpointId, mClusterId, Attributes::OperationalError::Id); - MatterReportingAttributeChangeCallback(path); + MatterReportingAttributeChangeCallback(mEndpointId, mClusterId, Attributes::OperationalError::Id); } // Generate an ErrorDetected event From ecc0d63cf7eb91f4017bf8c264b53cf690420eb5 Mon Sep 17 00:00:00 2001 From: PSONALl <77670766+PSONALl@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:30:44 +0530 Subject: [PATCH 046/134] Add rule for esp-insights component (#29123) --- config/esp32/components/chip/CMakeLists.txt | 7 ++++++- config/esp32/components/chip/idf_component.yml | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 2f8655b81130ee..61920102605cba 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -484,8 +484,13 @@ foreach(phy_blob ${phy_blobs}) endforeach() set(components_to_link esp_event hal esp_system soc efuse vfs driver esp_coex freertos) +idf_build_get_property(build_components BUILD_COMPONENTS) foreach(component ${components_to_link}) - idf_component_get_property(lib_name ${component} COMPONENT_LIB) + # Some of the components are not present in IDF v4.x + # So, Check if the component is in the list of build components + if("${component}" IN_LIST build_components) + idf_component_get_property(lib_name ${component} COMPONENT_LIB) + endif() list(APPEND chip_libraries $) endforeach() diff --git a/config/esp32/components/chip/idf_component.yml b/config/esp32/components/chip/idf_component.yml index d613993afff206..9b888d269c166e 100644 --- a/config/esp32/components/chip/idf_component.yml +++ b/config/esp32/components/chip/idf_component.yml @@ -20,3 +20,7 @@ dependencies: espressif/esp_insights: version: "1.0.1" require: public + # There is an issue with IDF-Component-Manager when ESP Insights is included. + # Issue: https://github.com/project-chip/connectedhomeip/issues/29125 + rules: + - if: "idf_version >=5.0" From 5ae3c657a8f17582d1af0c8abc9a8642c7185ad2 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 8 Sep 2023 13:19:40 -0400 Subject: [PATCH 047/134] Actually enable our YAML tests in the python-calls-chip-tool runner. (#29096) * Actually enable our YAML tests in the python-calls-chip-tool runner. We were now getting the right test list, but for each test we were not finding the test file. And the harness did not treat that as an error. * Address review comments. * Fix chip-repl CI --- .github/workflows/tests.yaml | 1 + scripts/tests/chiptest/__init__.py | 37 ++++++- scripts/tests/chiptest/test_definition.py | 1 + scripts/tests/run_test_suite.py | 1 + scripts/tests/yaml/runner.py | 6 +- .../tests/suites/TestClusterMultiFabric.yaml | 98 +++++++------------ src/app/tests/suites/TestEventsById.yaml | 18 ++-- 7 files changed, 87 insertions(+), 75 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 15057ec27b2b4d..ce0881ae6c1cec 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -223,6 +223,7 @@ jobs: --exclude-tags MANUAL \ --exclude-tags FLAKY \ --exclude-tags IN_DEVELOPMENT \ + --exclude-tags EXTRA_SLOW \ --exclude-tags SLOW \ run \ --iterations 1 \ diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index ce312d492beabd..6267ee037db863 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -47,6 +47,9 @@ class ManualTest: "PICS_Example.yaml", "Response_Example.yaml", "Test_Example.yaml", + "Test_Example_1.yaml", + "Test_Example_2.yaml", + "Test_Example_3.yaml", } @@ -127,6 +130,16 @@ def _GetSlowTests() -> Set[str]: } +def _GetExtraSlowTests() -> Set[str]: + """Generally tests using sleep() so much they should never run in CI. + + 1 minute seems like a good threshold to consider something extra slow + """ + return { + "Test_TC_DGGEN_2_1.yaml", # > 2 hours + } + + def _GetInDevelopmentTests() -> Set[str]: """Tests that fail in YAML for some reason.""" return { @@ -145,6 +158,8 @@ def _GetInDevelopmentTests() -> Set[str]: # TestEventTriggersEnabled is true, which it's not in CI. "Test_TC_SMOKECO_2_6.yaml", # chip-repl does not support local timeout (07/20/2023) and test assumes # TestEventTriggersEnabled is true, which it's not in CI. + "Test_TC_IDM_1_2.yaml", # Broken harness: https://github.com/project-chip/connectedhomeip/issues/29115 + "Test_TC_S_2_4.yaml", # https://github.com/project-chip/connectedhomeip/issues/29117 } @@ -177,6 +192,8 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_G_2_4.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_RVCRUNM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_RVCCLEANM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + # chip-repl and chip-tool disagree on what the YAML here should look like: https://github.com/project-chip/connectedhomeip/issues/29110 + "TestClusterMultiFabric.yaml", } @@ -243,10 +260,14 @@ def tests_with_command(chip_tool: str, is_manual: bool): ) -def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool): +def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short_run_name: bool): + """ + use_short_run_name should be true if we want the run_name to be "Test_ABC" instead of "some/path/Test_ABC.yaml" + """ manual_tests = _GetManualTests() flaky_tests = _GetFlakyTests() slow_tests = _GetSlowTests() + extra_slow_tests = _GetExtraSlowTests() in_development_tests = _GetInDevelopmentTests() chip_repl_unsupported_tests = _GetChipReplUnsupportedTests() @@ -264,14 +285,22 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool): if path.name in slow_tests: tags.add(TestTag.SLOW) + if path.name in extra_slow_tests: + tags.add(TestTag.EXTRA_SLOW) + if path.name in in_development_tests: tags.add(TestTag.IN_DEVELOPMENT) if treat_repl_unsupported_as_in_development and path.name in chip_repl_unsupported_tests: tags.add(TestTag.IN_DEVELOPMENT) + if use_short_run_name: + run_name = path.stem # `path.stem` converts "some/path/Test_ABC_1.2.yaml" to "Test_ABC.1.2" + else: + run_name = str(path) + yield TestDefinition( - run_name=str(path), + run_name=run_name, name=path.stem, # `path.stem` converts "some/path/Test_ABC_1.2.yaml" to "Test_ABC.1.2" target=target_for_name(path.name), tags=tags, @@ -279,12 +308,12 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool): def AllReplYamlTests(): - for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=True): + for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=True, use_short_run_name=False): yield test def AllChipToolYamlTests(): - for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False): + for test in _AllFoundYamlTests(treat_repl_unsupported_as_in_development=False, use_short_run_name=True): yield test diff --git a/scripts/tests/chiptest/test_definition.py b/scripts/tests/chiptest/test_definition.py index 08f97c98a2ea4e..68f2323a3302fc 100644 --- a/scripts/tests/chiptest/test_definition.py +++ b/scripts/tests/chiptest/test_definition.py @@ -218,6 +218,7 @@ class TestTag(Enum): FLAKY = auto() # test is considered flaky (usually a bug/time dependent issue) IN_DEVELOPMENT = auto() # test may not pass or undergoes changes CHIP_TOOL_PYTHON_ONLY = auto() # test uses YAML features only supported by the CHIP_TOOL_PYTHON runner. + EXTRA_SLOW = auto() # test uses Sleep and is generally _very_ slow (>= 60s is a typical threshold) def to_s(self): for (k, v) in TestTag.__members__.items(): diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index 643f13ce4d92af..ae5e569b36dd59 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -174,6 +174,7 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, TestTag.MANUAL, TestTag.IN_DEVELOPMENT, TestTag.FLAKY, + TestTag.EXTRA_SLOW } if runtime != TestRunTime.CHIP_TOOL_PYTHON: diff --git a/scripts/tests/yaml/runner.py b/scripts/tests/yaml/runner.py index 073726fa7e4813..746fc01656f135 100755 --- a/scripts/tests/yaml/runner.py +++ b/scripts/tests/yaml/runner.py @@ -260,8 +260,12 @@ def runner_base(ctx, configuration_directory: str, test_name: str, configuration specifications = SpecDefinitionsFromPaths(specifications_paths.split(','), pseudo_clusters) tests_finder = TestsFinder(configuration_directory, configuration_name) + test_list = tests_finder.get(test_name) + if len(test_list) == 0: + raise Exception(f"No tests found for test name '{test_name}'") + parser_config = TestParserConfig(pics, specifications, kwargs) - parser_builder_config = TestParserBuilderConfig(tests_finder.get(test_name), parser_config, hooks=TestParserLogger()) + parser_builder_config = TestParserBuilderConfig(test_list, parser_config, hooks=TestParserLogger()) parser_builder_config.options.stop_on_error = stop_on_error while ctx: ctx.obj = ParserGroup(parser_builder_config, pseudo_clusters) diff --git a/src/app/tests/suites/TestClusterMultiFabric.yaml b/src/app/tests/suites/TestClusterMultiFabric.yaml index 97b38ee103df85..8d3febcf410034 100644 --- a/src/app/tests/suites/TestClusterMultiFabric.yaml +++ b/src/app/tests/suites/TestClusterMultiFabric.yaml @@ -284,8 +284,7 @@ tests: # # TODO: This can be fixed using the `saveAs` function. # - value: - [ + value: [ { FabricIndex: 1, fabricSensitiveInt8u: 33, @@ -328,39 +327,29 @@ tests: }, { FabricIndex: 2, - fabricSensitiveInt8u: 0, + # These should actually be missing, not null, but right + # now our harness treats those the same, and we have no + # way to indicate "missing" in the YAML. + # https://github.com/project-chip/connectedhomeip/issues/29110 + fabricSensitiveInt8u: null, + optionalFabricSensitiveInt8u: null, nullableFabricSensitiveInt8u: null, - fabricSensitiveCharString: "", - fabricSensitiveStruct: - { - a: 0, - b: false, - c: 0, - d: "", - e: "", - f: 0, - g: 0, - h: 0, - }, - fabricSensitiveInt8uList: [], + fabricSensitiveCharString: null, + fabricSensitiveStruct: null, + fabricSensitiveInt8uList: null, }, { FabricIndex: 2, - fabricSensitiveInt8u: 0, + # These should actually be missing, not null, but right + # now our harness treats those the same, and we have no + # way to indicate "missing" in the YAML. + # https://github.com/project-chip/connectedhomeip/issues/29110 + fabricSensitiveInt8u: null, + optionalFabricSensitiveInt8u: null, nullableFabricSensitiveInt8u: null, - fabricSensitiveCharString: "", - fabricSensitiveStruct: - { - a: 0, - b: false, - c: 0, - d: "", - e: "", - f: 0, - g: 0, - h: 0, - }, - fabricSensitiveInt8uList: [], + fabricSensitiveCharString: null, + fabricSensitiveStruct: null, + fabricSensitiveInt8uList: null, }, ] @@ -371,43 +360,32 @@ tests: fabricFiltered: false attribute: "list_fabric_scoped" response: - value: - [ + value: [ { FabricIndex: 1, - fabricSensitiveInt8u: 0, + # These should actually be missing, not null, but right + # now our harness treats those the same, and we have no + # way to indicate "missing" in the YAML. + # https://github.com/project-chip/connectedhomeip/issues/29110 + fabricSensitiveInt8u: null, + optionalFabricSensitiveInt8u: null, nullableFabricSensitiveInt8u: null, - fabricSensitiveCharString: "", - fabricSensitiveStruct: - { - a: 0, - b: false, - c: 0, - d: "", - e: "", - f: 0, - g: 0, - h: 0, - }, - fabricSensitiveInt8uList: [], + fabricSensitiveCharString: null, + fabricSensitiveStruct: null, + fabricSensitiveInt8uList: null, }, { FabricIndex: 1, - fabricSensitiveInt8u: 0, + # These should actually be missing, not null, but right + # now our harness treats those the same, and we have no + # way to indicate "missing" in the YAML. + # https://github.com/project-chip/connectedhomeip/issues/29110 + fabricSensitiveInt8u: null, + optionalFabricSensitiveInt8u: null, nullableFabricSensitiveInt8u: null, - fabricSensitiveCharString: "", - fabricSensitiveStruct: - { - a: 0, - b: false, - c: 0, - d: "", - e: "", - f: 0, - g: 0, - h: 0, - }, - fabricSensitiveInt8uList: [], + fabricSensitiveCharString: null, + fabricSensitiveStruct: null, + fabricSensitiveInt8uList: null, }, { FabricIndex: 2, diff --git a/src/app/tests/suites/TestEventsById.yaml b/src/app/tests/suites/TestEventsById.yaml index 29224f92e3e7ac..fa772eacb1d56e 100644 --- a/src/app/tests/suites/TestEventsById.yaml +++ b/src/app/tests/suites/TestEventsById.yaml @@ -48,7 +48,8 @@ tests: value: ReadRequestMessage.Cluster - name: "EventId" value: ReadRequestMessage.Event - response: [] + response: + error: UNSUPPORTED_ENDPOINT - label: "Read Request Message with a path that indicates a specific cluster @@ -62,11 +63,12 @@ tests: value: UnsupportedCluster - name: "EventId" value: ReadRequestMessage.Event - response: [] + response: + error: UNSUPPORTED_CLUSTER - label: - "Read Request Message with a path that indicates a specific endpoint - that is unsupported" + "Read Request Message with a path that indicates a specific event that + is unsupported" cluster: "AnyCommands" command: "ReadEventById" endpoint: ReadRequestMessage.EndPoint @@ -256,9 +258,5 @@ tests: - name: "EventId" value: ReadRequestMessage.EndPoint response: - - values: - - value: { arg1: 1, arg2: 2, arg3: true } - - values: - - value: { arg1: 3, arg2: 1, arg3: false } - - values: - - value: { arg1: 4, arg2: 3, arg3: true } + # Not a valid event request path. + error: FAILURE From b043fae1d2a5c411029d6cf893ccf9abca0de048 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 8 Sep 2023 20:37:02 -0400 Subject: [PATCH 048/134] Add CI testing for purposeful YAML failures. (#29099) This should catch cases when for some reason we are _not_ running the YAML tests right, and tests that should fail do not fail. --- .github/workflows/tests.yaml | 31 +++++++++++++ scripts/tests/chiptest/__init__.py | 11 +++++ scripts/tests/chiptest/test_definition.py | 1 + scripts/tests/run_test_suite.py | 33 +++++++++++--- .../TestPurposefulFailureEqualities.yaml | 44 +++++++++++++++++++ 5 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 src/app/tests/suites/TestPurposefulFailureEqualities.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ce0881ae6c1cec..aa54505bbae9ab 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -214,6 +214,21 @@ jobs: --bridge-app ./out/linux-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ " + - name: Run purposeful failure tests using the python parser sending commands to chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --runner chip_tool_python \ + --include-tags PURPOSEFUL_FAILURE \ + --chip-tool ./out/linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ + run \ + --iterations 1 \ + --expected-failures 1 \ + --keep-going \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/linux-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + " + - name: Run Tests using chip-repl (skip slow) if: github.event_name == 'pull_request' run: | @@ -225,6 +240,7 @@ jobs: --exclude-tags IN_DEVELOPMENT \ --exclude-tags EXTRA_SLOW \ --exclude-tags SLOW \ + --exclude-tags PURPOSEFUL_FAILURE \ run \ --iterations 1 \ --test-timeout-seconds 120 \ @@ -337,6 +353,21 @@ jobs: --bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ " + - name: Run purposeful failure tests using the python parser sending commands to chip-tool + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --runner chip_tool_python \ + --include-tags PURPOSEFUL_FAILURE \ + --chip-tool ./out/darwin-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ + run \ + --iterations 1 \ + --expected-failures 1 \ + --keep-going \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + " + - name: Uploading core files uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 6267ee037db863..eda65d58438abe 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -197,6 +197,13 @@ def _GetChipReplUnsupportedTests() -> Set[str]: } +def _GetPurposefulFailureTests() -> Set[str]: + """Tests that fail in YAML on purpose.""" + return { + "TestPurposefulFailureEqualities.yaml" + } + + def _AllYamlTests(): yaml_test_suite_path = Path(_YAML_TEST_SUITE_PATH) @@ -270,6 +277,7 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short extra_slow_tests = _GetExtraSlowTests() in_development_tests = _GetInDevelopmentTests() chip_repl_unsupported_tests = _GetChipReplUnsupportedTests() + purposeful_failure_tests = _GetPurposefulFailureTests() for path in _AllYamlTests(): if not _IsValidYamlTest(path.name): @@ -291,6 +299,9 @@ def _AllFoundYamlTests(treat_repl_unsupported_as_in_development: bool, use_short if path.name in in_development_tests: tags.add(TestTag.IN_DEVELOPMENT) + if path.name in purposeful_failure_tests: + tags.add(TestTag.PURPOSEFUL_FAILURE) + if treat_repl_unsupported_as_in_development and path.name in chip_repl_unsupported_tests: tags.add(TestTag.IN_DEVELOPMENT) diff --git a/scripts/tests/chiptest/test_definition.py b/scripts/tests/chiptest/test_definition.py index 68f2323a3302fc..694f8c7e75feb1 100644 --- a/scripts/tests/chiptest/test_definition.py +++ b/scripts/tests/chiptest/test_definition.py @@ -219,6 +219,7 @@ class TestTag(Enum): IN_DEVELOPMENT = auto() # test may not pass or undergoes changes CHIP_TOOL_PYTHON_ONLY = auto() # test uses YAML features only supported by the CHIP_TOOL_PYTHON runner. EXTRA_SLOW = auto() # test uses Sleep and is generally _very_ slow (>= 60s is a typical threshold) + PURPOSEFUL_FAILURE = auto() # test fails on purpose def to_s(self): for (k, v) in TestTag.__members__.items(): diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index ae5e569b36dd59..17124a6d9b24c1 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -174,7 +174,8 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, TestTag.MANUAL, TestTag.IN_DEVELOPMENT, TestTag.FLAKY, - TestTag.EXTRA_SLOW + TestTag.EXTRA_SLOW, + TestTag.PURPOSEFUL_FAILURE, } if runtime != TestRunTime.CHIP_TOOL_PYTHON: @@ -273,9 +274,19 @@ def cmd_list(context): default=None, type=int, help='If provided, fail if a test runs for longer than this time') +@click.option( + '--expected-failures', + type=int, + default=0, + show_default=True, + help='Number of tests that are expected to fail in each iteration. Overall test will pass if the number of failures matches this. Nonzero values require --keep-going') @click.pass_context def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, ota_requestor_app, - tv_app, bridge_app, chip_repl_yaml_tester, chip_tool_with_python, pics_file, keep_going, test_timeout_seconds): + tv_app, bridge_app, chip_repl_yaml_tester, chip_tool_with_python, pics_file, keep_going, test_timeout_seconds, expected_failures): + if expected_failures != 0 and not keep_going: + logging.exception(f"'--expected-failures {expected_failures}' used without '--keep-going'") + sys.exit(2) + runner = chiptest.runner.Runner() paths_finder = PathsFinder() @@ -327,8 +338,14 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o apps_register = AppsRegister() apps_register.init() + def cleanup(): + apps_register.uninit() + if sys.platform == 'linux': + chiptest.linux.ShutdownNamespaceForTestExecution() + for i in range(iterations): logging.info("Starting iteration %d" % (i+1)) + observed_failures = 0 for test in context.obj.tests: if context.obj.include_tags: if not (test.tags & context.obj.include_tags): @@ -357,13 +374,17 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o test_end = time.monotonic() logging.exception('%-30s - FAILED in %0.2f seconds' % (test.name, (test_end - test_start))) + observed_failures += 1 if not keep_going: - apps_register.uninit() + cleanup() sys.exit(2) - apps_register.uninit() - if sys.platform == 'linux': - chiptest.linux.ShutdownNamespaceForTestExecution() + if observed_failures != expected_failures: + logging.exception(f'Iteration {i}: expected failure count {expected_failures}, but got {observed_failures}') + cleanup() + sys.exit(2) + + cleanup() # On linux, allow an execution shell to be prepared diff --git a/src/app/tests/suites/TestPurposefulFailureEqualities.yaml b/src/app/tests/suites/TestPurposefulFailureEqualities.yaml new file mode 100644 index 00000000000000..14e886437d678e --- /dev/null +++ b/src/app/tests/suites/TestPurposefulFailureEqualities.yaml @@ -0,0 +1,44 @@ +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Test that purposefully fails in EqualityCommands + +config: + nodeId: 0x12344321 + cluster: "EqualityCommands" + endpoint: 1 + +tests: + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: + "Compute the result of comparing 0 to 1 and claim that they are equal" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: 0 + - name: "Value2" + value: 1 + response: + - values: + - name: "Equals" + # This is the wrong value on purpose, so this test will fail. + value: true From ecba41d5fd1f7c3d7476693e54b8f64140731425 Mon Sep 17 00:00:00 2001 From: jrhees-cae <61466710+jrhees-cae@users.noreply.github.com> Date: Fri, 8 Sep 2023 21:41:04 -0400 Subject: [PATCH 049/134] Fix partial revert of https://github.com/project-chip/connectedhomeip/commit/94c3882388c77e214f502aad94a518a340bb7f24 (#29144) caused by subsequent PR https://github.com/project-chip/connectedhomeip/commit/76848fe25811fbf55a9c6b92da5d0b77a46221b4 : - Allow SupportedOperatingModes attribute to be any of the valid combinations --- .../tests/suites/certification/Test_TC_DRLK_2_1.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml index cc67a0908626ac..e54dbd3b2af7f0 100755 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_1.yaml @@ -945,10 +945,20 @@ tests: command: "readAttribute" attribute: "SupportedOperatingModes" response: - value: 0xFFF6 saveAs: Current_Supported constraints: type: enum16 + anyOf: + [ + 0xFFF6, + 0xFFF4, + 0xFFF2, + 0xFFF0, + 0xFFE6, + 0xFFE4, + 0xFFE2, + 0xFFE0, + ] - label: "Step 23b: TH writes Supported OperatingModes attribute as bit 0 is From fba066dd784b8f84babad2736b589ac889850b62 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 11 Sep 2023 13:01:39 +0800 Subject: [PATCH 050/134] Fix esp32 platform bluedroid, should send indication instead of notification. (#28923) * Fix esp32 platform bluedroid implementation, should send indication instead of notification * Add comments * Restyled by clang-format --------- Co-authored-by: Ryan Ma --- src/platform/ESP32/bluedroid/BLEManagerImpl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp index ef9cbece6f5fd4..b18ca5d9e7b997 100644 --- a/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp +++ b/src/platform/ESP32/bluedroid/BLEManagerImpl.cpp @@ -852,7 +852,9 @@ bool BLEManagerImpl::SendIndication(BLE_CONNECTION_OBJECT conId, const ChipBleUU ChipLogDetail(Ble, "Sending indication for CHIPoBLE TX characteristic (con %u, len %u)", conId, data->DataLength()); #endif - err = MapBLEError(esp_ble_gatts_send_indicate(mAppIf, conId, mTXCharAttrHandle, data->DataLength(), data->Start(), false)); + // Set param need_confirm as false will send notification, otherwise indication. + err = MapBLEError( + esp_ble_gatts_send_indicate(mAppIf, conId, mTXCharAttrHandle, data->DataLength(), data->Start(), true /* need_confirm */)); if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "esp_ble_gatts_send_indicate() failed: %s", ErrorStr(err)); From e29cd6ab2f15553888de34f621ae2bb04c197129 Mon Sep 17 00:00:00 2001 From: Jaehoon-You <55170115+Jaehoon-You@users.noreply.github.com> Date: Mon, 11 Sep 2023 15:09:04 +0900 Subject: [PATCH 051/134] virtual-device-app: Add Doorlock/PowerSource repository (#29127) Signed-off-by: Jaehoon You Signed-off-by: Charles Kim --- .../device/app/core/data/di/DataModule.kt | 13 ++++++++++ .../cluster/DoorLockManagerRepository.kt | 11 +++++++++ .../cluster/DoorLockManagerRepositoryImpl.kt | 24 +++++++++++++++++++ .../cluster/PowerSourceManagerRepository.kt | 9 +++++++ .../PowerSourceManagerRepositoryImpl.kt | 19 +++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepository.kt create mode 100644 examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepositoryImpl.kt create mode 100644 examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepository.kt create mode 100644 examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepositoryImpl.kt diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/di/DataModule.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/di/DataModule.kt index 8168f632c10275..d6dadd00f2cb87 100644 --- a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/di/DataModule.kt +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/di/DataModule.kt @@ -1,8 +1,12 @@ package com.matter.virtual.device.app.core.data.di import com.matter.virtual.device.app.core.data.repository.* +import com.matter.virtual.device.app.core.data.repository.cluster.DoorLockManagerRepository +import com.matter.virtual.device.app.core.data.repository.cluster.DoorLockManagerRepositoryImpl import com.matter.virtual.device.app.core.data.repository.cluster.OnOffManagerRepository import com.matter.virtual.device.app.core.data.repository.cluster.OnOffManagerRepositoryImpl +import com.matter.virtual.device.app.core.data.repository.cluster.PowerSourceManagerRepository +import com.matter.virtual.device.app.core.data.repository.cluster.PowerSourceManagerRepositoryImpl import dagger.Binds import dagger.Module import dagger.hilt.InstallIn @@ -11,12 +15,21 @@ import dagger.hilt.components.SingletonComponent @InstallIn(SingletonComponent::class) @Module internal abstract class DataModule { + @Binds + abstract fun bindDoorLockManagerRepository( + repository: DoorLockManagerRepositoryImpl + ): DoorLockManagerRepository @Binds abstract fun bindOnOffManagerRepository( repository: OnOffManagerRepositoryImpl ): OnOffManagerRepository + @Binds + abstract fun bindPowerSourceManagerRepository( + repository: PowerSourceManagerRepositoryImpl + ): PowerSourceManagerRepository + @Binds abstract fun bindMatterRepository(repository: MatterRepositoryImpl): MatterRepository @Binds abstract fun bindNetworkRepository(repository: NetworkRepositoryImpl): NetworkRepository diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepository.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepository.kt new file mode 100644 index 00000000000000..cdc7e380a94699 --- /dev/null +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepository.kt @@ -0,0 +1,11 @@ +package com.matter.virtual.device.app.core.data.repository.cluster + +import kotlinx.coroutines.flow.StateFlow + +interface DoorLockManagerRepository { + fun getLockStateFlow(): StateFlow + + suspend fun setLockState(value: Boolean) + + suspend fun sendLockAlarmEvent() +} diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepositoryImpl.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepositoryImpl.kt new file mode 100644 index 00000000000000..4dfa15a01717e3 --- /dev/null +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/DoorLockManagerRepositoryImpl.kt @@ -0,0 +1,24 @@ +package com.matter.virtual.device.app.core.data.repository.cluster + +import com.matter.virtual.device.app.core.matter.manager.DoorLockManagerStub +import javax.inject.Inject +import kotlinx.coroutines.flow.StateFlow +import timber.log.Timber + +internal class DoorLockManagerRepositoryImpl +@Inject +constructor(private val doorLockManagerStub: DoorLockManagerStub) : DoorLockManagerRepository { + + override fun getLockStateFlow(): StateFlow { + return doorLockManagerStub.lockState + } + + override suspend fun setLockState(value: Boolean) { + Timber.d("setLockState():$value") + doorLockManagerStub.setLockState(value) + } + + override suspend fun sendLockAlarmEvent() { + doorLockManagerStub.sendLockAlarmEvent() + } +} diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepository.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepository.kt new file mode 100644 index 00000000000000..3948f797e622a5 --- /dev/null +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepository.kt @@ -0,0 +1,9 @@ +package com.matter.virtual.device.app.core.data.repository.cluster + +import kotlinx.coroutines.flow.StateFlow + +interface PowerSourceManagerRepository { + fun getBatPercent(): StateFlow + + suspend fun setBatPercentRemaining(batteryPercentRemaining: Int) +} diff --git a/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepositoryImpl.kt b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepositoryImpl.kt new file mode 100644 index 00000000000000..d180e182b89853 --- /dev/null +++ b/examples/virtual-device-app/android/App/core/data/src/main/java/com/matter/virtual/device/app/core/data/repository/cluster/PowerSourceManagerRepositoryImpl.kt @@ -0,0 +1,19 @@ +package com.matter.virtual.device.app.core.data.repository.cluster + +import com.matter.virtual.device.app.core.matter.manager.PowerSourceManagerStub +import javax.inject.Inject +import kotlinx.coroutines.flow.StateFlow + +internal class PowerSourceManagerRepositoryImpl +@Inject +constructor(private val powerSourceManagerStub: PowerSourceManagerStub) : + PowerSourceManagerRepository { + + override fun getBatPercent(): StateFlow { + return powerSourceManagerStub.batPercent + } + + override suspend fun setBatPercentRemaining(batteryPercentRemaining: Int) { + powerSourceManagerStub.setBatPercentRemaining(batteryPercentRemaining) + } +} From 458ffe212ab42c4df6ddbe9b7c2b0321ee5595de Mon Sep 17 00:00:00 2001 From: EricZijian_SiterWell Date: Mon, 11 Sep 2023 19:46:50 +0800 Subject: [PATCH 052/134] Fix Smoke CO Alarm Cluster SDK (#28961) * Remove redundant pics values * Avoid unsupported attributes affecting other --------- Co-authored-by: Hare --- .../smoke-co-alarm-server.cpp | 60 +++++++++++-------- src/app/tests/suites/certification/PICS.yaml | 11 +--- .../tests/suites/certification/ci-pics-values | 41 +------------ 3 files changed, 37 insertions(+), 75 deletions(-) diff --git a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp index 67c927c202730d..2d5ae5fe2a2480 100644 --- a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp +++ b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.cpp @@ -46,43 +46,44 @@ SmokeCoAlarmServer & SmokeCoAlarmServer::Instance() void SmokeCoAlarmServer::SetExpressedStateByPriority(EndpointId endpointId, const std::array & priorityOrder) { - AlarmStateEnum alarmState = AlarmStateEnum::kNormal; - EndOfServiceEnum endOfServiceState = EndOfServiceEnum::kNormal; - bool active = false; - for (ExpressedStateEnum priority : priorityOrder) { + AlarmStateEnum alarmState = AlarmStateEnum::kNormal; + EndOfServiceEnum endOfServiceState = EndOfServiceEnum::kNormal; + bool active = false; + bool success = false; + switch (priority) { case ExpressedStateEnum::kSmokeAlarm: - VerifyOrReturn(GetSmokeState(endpointId, alarmState)); + success = GetSmokeState(endpointId, alarmState); break; case ExpressedStateEnum::kCOAlarm: - VerifyOrReturn(GetCOState(endpointId, alarmState)); + success = GetCOState(endpointId, alarmState); break; case ExpressedStateEnum::kBatteryAlert: - VerifyOrReturn(GetBatteryAlert(endpointId, alarmState)); + success = GetBatteryAlert(endpointId, alarmState); break; case ExpressedStateEnum::kTesting: - VerifyOrReturn(GetTestInProgress(endpointId, active)); + success = GetTestInProgress(endpointId, active); break; case ExpressedStateEnum::kHardwareFault: - VerifyOrReturn(GetHardwareFaultAlert(endpointId, active)); + success = GetHardwareFaultAlert(endpointId, active); break; case ExpressedStateEnum::kEndOfService: - VerifyOrReturn(GetEndOfServiceAlert(endpointId, endOfServiceState)); + success = GetEndOfServiceAlert(endpointId, endOfServiceState); break; case ExpressedStateEnum::kInterconnectSmoke: - VerifyOrReturn(GetInterconnectSmokeAlarm(endpointId, alarmState)); + success = GetInterconnectSmokeAlarm(endpointId, alarmState); break; case ExpressedStateEnum::kInterconnectCO: - VerifyOrReturn(GetInterconnectCOAlarm(endpointId, alarmState)); + success = GetInterconnectCOAlarm(endpointId, alarmState); break; default: break; } - if ((alarmState != AlarmStateEnum::kNormal) || (endOfServiceState != EndOfServiceEnum::kNormal) || active) + if (success && ((alarmState != AlarmStateEnum::kNormal) || (endOfServiceState != EndOfServiceEnum::kNormal) || active)) { SetExpressedState(endpointId, priority); return; @@ -186,20 +187,22 @@ bool SmokeCoAlarmServer::SetDeviceMuted(EndpointId endpointId, MuteStateEnum new { AlarmStateEnum alarmState; - VerifyOrReturnValue(GetAttribute(endpointId, SmokeState::Id, SmokeState::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + // If the attribute has been read and the attribute is Critical, return false - VerifyOrReturnValue(GetAttribute(endpointId, COState::Id, COState::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + bool success = GetSmokeState(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); - VerifyOrReturnValue(GetAttribute(endpointId, BatteryAlert::Id, BatteryAlert::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + success = GetCOState(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); - VerifyOrReturnValue(GetAttribute(endpointId, InterconnectSmokeAlarm::Id, InterconnectSmokeAlarm::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + success = GetBatteryAlert(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); - VerifyOrReturnValue(GetAttribute(endpointId, InterconnectCOAlarm::Id, InterconnectCOAlarm::Get, alarmState), false); - VerifyOrReturnValue(alarmState != AlarmStateEnum::kCritical, false); + success = GetInterconnectSmokeAlarm(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); + + success = GetInterconnectCOAlarm(endpointId, alarmState); + VerifyOrReturnValue(!success || alarmState != AlarmStateEnum::kCritical, false); } VerifyOrReturnValue(SetAttribute(endpointId, DeviceMuted::Id, DeviceMuted::Set, newDeviceMuted), false); @@ -466,10 +469,15 @@ template bool SmokeCoAlarmServer::GetAttribute(EndpointId endpointId, AttributeId attributeId, EmberAfStatus (*getFn)(EndpointId endpointId, T * value), T & value) const { - EmberAfStatus status = getFn(endpointId, &value); - bool success = (EMBER_ZCL_STATUS_SUCCESS == status); + EmberAfStatus status = getFn(endpointId, &value); + bool success = (EMBER_ZCL_STATUS_SUCCESS == status); + bool unsupportedStatus = (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status); - if (!success) + if (unsupportedStatus) + { + ChipLogProgress(Zcl, "Read unsupported SmokeCOAlarm attribute: attribute=" ChipLogFormatMEI, ChipLogValueMEI(attributeId)); + } + else if (!success) { ChipLogError(Zcl, "Failed to read SmokeCOAlarm attribute: attribute=" ChipLogFormatMEI ", status=0x%x", ChipLogValueMEI(attributeId), to_underlying(status)); diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index b3d8e330b10113..d26d399904833e 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -8901,15 +8901,6 @@ PICS: - label: "Does the device implement the InterconnectCOAlarm attribute?" id: SMOKECO.S.A0009 - - label: "Does the device implement the ContaminationState attribute?" - id: SMOKECO.S.A0010 - - - label: "Does the device implement the SensitivityLevel attribute?" - id: SMOKECO.S.A0011 - - - label: "Does the device implement the ExpiryDate attribute?" - id: SMOKECO.S.A0012 - - label: "Does the device implement the ContaminationState attribute?" id: SMOKECO.S.A000a @@ -8953,7 +8944,7 @@ PICS: id: SMOKECO.S.E09 - label: "Does the device implement the AllClear event?" - id: SMOKECO.S.E10 + id: SMOKECO.S.E0a # # server / manually diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 66b40dbe81572d..d709e8f55d907b 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -700,40 +700,6 @@ S.C.AM-WRITE=0 S.C.AO-READ=0 S.C.AO-WRITE=0 -# Smoke CO Alarm Cluster -SMOKECO.S=1 -SMOKECO.S.F00=1 -SMOKECO.S.F01=1 -SMOKECO.S.A0000=1 -SMOKECO.S.A0001=1 -SMOKECO.S.A0002=1 -SMOKECO.S.A0003=1 -SMOKECO.S.A0004=1 -SMOKECO.S.A0005=1 -SMOKECO.S.A0006=1 -SMOKECO.S.A0007=1 -SMOKECO.S.A0008=1 -SMOKECO.S.A0009=1 -SMOKECO.S.A000a=1 -SMOKECO.S.A000b=1 -SMOKECO.S.A000c=1 -SMOKECO.S.E00=1 -SMOKECO.S.E01=1 -SMOKECO.S.E02=1 -SMOKECO.S.E03=1 -SMOKECO.S.E04=1 -SMOKECO.S.E05=1 -SMOKECO.S.E06=1 -SMOKECO.S.E07=1 -SMOKECO.S.E08=1 -SMOKECO.S.E09=1 -SMOKECO.S.E0a=1 -SMOKECO.M.ManuallyControlledTest=1 -SMOKECO.M.ManuallyControlledMute=1 -SMOKECO.S.C00.Rsp=1 - -SMOKECO.C=1 - # Switch Cluster SWTCH.S=1 SWTCH.S.F00=1 @@ -2607,6 +2573,7 @@ ICDM.S.C01.Tx=1 # Smoke CO Alarm Cluster SMOKECO.S=1 +SMOKECO.C=1 SMOKECO.S.F00=1 SMOKECO.S.F01=1 SMOKECO.S.A0000=1 @@ -2619,9 +2586,6 @@ SMOKECO.S.A0006=1 SMOKECO.S.A0007=1 SMOKECO.S.A0008=1 SMOKECO.S.A0009=1 -SMOKECO.S.A0010=1 -SMOKECO.S.A0011=1 -SMOKECO.S.A0012=1 SMOKECO.S.A000a=1 SMOKECO.S.A000b=1 SMOKECO.S.A000c=1 @@ -2635,11 +2599,10 @@ SMOKECO.S.E06=1 SMOKECO.S.E07=1 SMOKECO.S.E08=1 SMOKECO.S.E09=1 -SMOKECO.S.E10=1 +SMOKECO.S.E0a=1 SMOKECO.M.ManuallyControlledTest=1 SMOKECO.M.ManuallyControlledMute=1 SMOKECO.S.C00.Rsp=1 -SMOKECO.C=1 #Temperature Controlled Cabinet Mode Cluster TCCM.S=1 From 771d55c1cd60b17beb74d3daf66835bd21b640d0 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 11 Sep 2023 13:40:31 +0100 Subject: [PATCH 053/134] Add rvc example app (#29103) * Added an RVC app example containg the RvcRunMode and RvcClean clusters. * Regenerated zap code. * Added the RvcRunMode and RvcClean clusters' logic to the RVC app example. * Added the RvcOpState cluster's logic to the RVC app example. * Added documentation about the RVC example app. * Added an implementation for the GetCoutdownTime virtual function. * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Added constants for the Cluster's endpoints. Adde vendor mode tags for the mapping mode. * Restyled by clang-format * Fixed the feature value for the RvcRun and RvcClean clusters. * Restyled by clang-format * zap regen after pull. * Removed unused clusters form the zap and matter files. * RVC App: Removed unneccissary error checking. * RVC App: Changed how the RVC cluster endpoint IDs are set. * RVC App: refactored method parameter names. * Update examples/rvc-app/linux/include/CHIPProjectAppConfig.h Co-authored-by: Boris Zbarsky --------- Co-authored-by: Restyled.io Co-authored-by: Matt Hazley Co-authored-by: Boris Zbarsky --- .../rvc-app/RVC_app_state_diagram_drawio.xml | 2 + examples/rvc-app/linux/.gn | 25 + examples/rvc-app/linux/BUILD.gn | 53 + examples/rvc-app/linux/args.gni | 25 + examples/rvc-app/linux/build_overrides | 1 + .../linux/include/CHIPProjectAppConfig.h | 34 + examples/rvc-app/linux/main.cpp | 48 + .../rvc-app/linux/third_party/connectedhomeip | 1 + examples/rvc-app/rvc-common/BUILD.gn | 27 + .../rvc-app/rvc-common/include/rvc-device.h | 75 + .../rvc-common/include/rvc-mode-delegates.h | 159 + .../include/rvc-operational-state-delegate.h | 137 + examples/rvc-app/rvc-common/rvc-app.matter | 1202 ++ examples/rvc-app/rvc-common/rvc-app.zap | 10896 ++++++++++++++++ .../rvc-app/rvc-common/src/rvc-device.cpp | 83 + .../rvc-common/src/rvc-mode-delegates.cpp | 123 + .../src/rvc-operational-state-delegate.cpp | 55 + 17 files changed, 12946 insertions(+) create mode 100644 examples/rvc-app/RVC_app_state_diagram_drawio.xml create mode 100644 examples/rvc-app/linux/.gn create mode 100644 examples/rvc-app/linux/BUILD.gn create mode 100644 examples/rvc-app/linux/args.gni create mode 120000 examples/rvc-app/linux/build_overrides create mode 100644 examples/rvc-app/linux/include/CHIPProjectAppConfig.h create mode 100644 examples/rvc-app/linux/main.cpp create mode 120000 examples/rvc-app/linux/third_party/connectedhomeip create mode 100644 examples/rvc-app/rvc-common/BUILD.gn create mode 100644 examples/rvc-app/rvc-common/include/rvc-device.h create mode 100644 examples/rvc-app/rvc-common/include/rvc-mode-delegates.h create mode 100644 examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h create mode 100644 examples/rvc-app/rvc-common/rvc-app.matter create mode 100644 examples/rvc-app/rvc-common/rvc-app.zap create mode 100644 examples/rvc-app/rvc-common/src/rvc-device.cpp create mode 100644 examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp create mode 100644 examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp diff --git a/examples/rvc-app/RVC_app_state_diagram_drawio.xml b/examples/rvc-app/RVC_app_state_diagram_drawio.xml new file mode 100644 index 00000000000000..590f1db1d542bd --- /dev/null +++ b/examples/rvc-app/RVC_app_state_diagram_drawio.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/examples/rvc-app/linux/.gn b/examples/rvc-app/linux/.gn new file mode 100644 index 00000000000000..5d1ce757507582 --- /dev/null +++ b/examples/rvc-app/linux/.gn @@ -0,0 +1,25 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") + +# The location of the build configuration file. +buildconfig = "${build_root}/config/BUILDCONFIG.gn" + +# CHIP uses angle bracket includes. +check_system_includes = true + +default_args = { + import("//args.gni") +} diff --git a/examples/rvc-app/linux/BUILD.gn b/examples/rvc-app/linux/BUILD.gn new file mode 100644 index 00000000000000..7c865a380c9a9c --- /dev/null +++ b/examples/rvc-app/linux/BUILD.gn @@ -0,0 +1,53 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/build.gni") +import("//build_overrides/chip.gni") + +config("includes") { + include_dirs = [ + ".", + "include", + ] +} + +executable("chip-rvc-app") { + sources = [ + "${chip_root}/examples/rvc-app/rvc-common/src/rvc-device.cpp", + "${chip_root}/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp", + "${chip_root}/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp", + "include/CHIPProjectAppConfig.h", + "main.cpp", + ] + + deps = [ + "${chip_root}/examples/platform/linux:app-main", + "${chip_root}/examples/rvc-app/rvc-common", + "${chip_root}/src/lib", + ] + + include_dirs = [ + "include", + "${chip_root}/examples/rvc-app/rvc-common/include", + ] + output_dir = root_out_dir +} + +group("linux") { + deps = [ ":chip-rvc-app" ] +} + +group("default") { + deps = [ ":linux" ] +} diff --git a/examples/rvc-app/linux/args.gni b/examples/rvc-app/linux/args.gni new file mode 100644 index 00000000000000..a94a8482760fbc --- /dev/null +++ b/examples/rvc-app/linux/args.gni @@ -0,0 +1,25 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") + +import("${chip_root}/config/standalone/args.gni") + +chip_device_project_config_include = "" +chip_project_config_include = "" +chip_system_project_config_include = "" + +chip_project_config_include_dirs = + [ "${chip_root}/examples/rvc-app/linux/include" ] +chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] diff --git a/examples/rvc-app/linux/build_overrides b/examples/rvc-app/linux/build_overrides new file mode 120000 index 00000000000000..e578e73312ebd1 --- /dev/null +++ b/examples/rvc-app/linux/build_overrides @@ -0,0 +1 @@ +../../build_overrides \ No newline at end of file diff --git a/examples/rvc-app/linux/include/CHIPProjectAppConfig.h b/examples/rvc-app/linux/include/CHIPProjectAppConfig.h new file mode 100644 index 00000000000000..d6d0e5146b144b --- /dev/null +++ b/examples/rvc-app/linux/include/CHIPProjectAppConfig.h @@ -0,0 +1,34 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// include the CHIPProjectConfig from config/standalone +#include + +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 116 // 0x0074 = 116 = Matter Robotic Vacuum Cleaner +#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Test RVC" diff --git a/examples/rvc-app/linux/main.cpp b/examples/rvc-app/linux/main.cpp new file mode 100644 index 00000000000000..462bc6febfec29 --- /dev/null +++ b/examples/rvc-app/linux/main.cpp @@ -0,0 +1,48 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "rvc-device.h" +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +RvcDevice * rvcDevice = nullptr; + +void ApplicationInit() +{ + rvcDevice = new RvcDevice(1); + rvcDevice->Init(); +} + +void ApplicationShutdown() +{ + delete rvcDevice; + rvcDevice = nullptr; +} + +int main(int argc, char * argv[]) +{ + if (ChipLinuxAppInit(argc, argv) != 0) + { + return -1; + } + + ChipLinuxAppMainLoop(); + return 0; +} diff --git a/examples/rvc-app/linux/third_party/connectedhomeip b/examples/rvc-app/linux/third_party/connectedhomeip new file mode 120000 index 00000000000000..11a54ed360106c --- /dev/null +++ b/examples/rvc-app/linux/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../../ \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/BUILD.gn b/examples/rvc-app/rvc-common/BUILD.gn new file mode 100644 index 00000000000000..d567043f3ee346 --- /dev/null +++ b/examples/rvc-app/rvc-common/BUILD.gn @@ -0,0 +1,27 @@ +# Copyright (c) 2020 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build_overrides/chip.gni") +import("${chip_root}/src/app/chip_data_model.gni") + +config("config") { + include_dirs = [ "include" ] +} + +chip_data_model("rvc-common") { + zap_file = "rvc-app.zap" + + zap_pregenerated_dir = "${chip_root}/zzz_generated/rvc-app/zap-generated" + is_server = true +} diff --git a/examples/rvc-app/rvc-common/include/rvc-device.h b/examples/rvc-app/rvc-common/include/rvc-device.h new file mode 100644 index 00000000000000..9ded6e76b8fbee --- /dev/null +++ b/examples/rvc-app/rvc-common/include/rvc-device.h @@ -0,0 +1,75 @@ +#pragma once + +#include "rvc-mode-delegates.h" +#include "rvc-operational-state-delegate.h" +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +class RvcDevice +{ +private: + RvcRunMode::RvcRunModeDelegate mRunModeDelegate; + ModeBase::Instance mRunModeInstance; + + RvcCleanMode::RvcCleanModeDelegate mCleanModeDelegate; + ModeBase::Instance mCleanModeInstance; + + RvcOperationalState::RvcOperationalStateDelegate mOperationalStateDelegate; + OperationalState::Instance mOperationalStateInstance; + +public: + /** + * This class is responsible for initialising all the RVC clusters and manging the interactions between them as required by + * the specific "business logic". See the state machine diagram. + * @param aRvcClustersEndpoint The endpoint ID where all the RVC clusters exist. + */ + explicit RvcDevice(EndpointId aRvcClustersEndpoint) : + mRunModeDelegate(), mRunModeInstance(&mRunModeDelegate, aRvcClustersEndpoint, RvcRunMode::Id, 0), mCleanModeDelegate(), + mCleanModeInstance(&mCleanModeDelegate, aRvcClustersEndpoint, RvcCleanMode::Id, 0), mOperationalStateDelegate(), + mOperationalStateInstance(&mOperationalStateDelegate, aRvcClustersEndpoint, RvcOperationalState::Id) + { + // set the current-mode at start-up + mRunModeInstance.UpdateCurrentMode(RvcRunMode::ModeIdle); + // Assume that the device is not docked. + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + + // set callback functions + mRunModeDelegate.SetHandleChangeToMode(&RvcDevice::HandleRvcRunChangeToMode, this); + mCleanModeDelegate.SetHandleChangeToMode(&RvcDevice::HandleRvcCleanChangeToMode, this); + mOperationalStateDelegate.SetPauseCallback(&RvcDevice::HandleOpStatePauseCallback, this); + mOperationalStateDelegate.SetResumeCallback(&RvcDevice::HandleOpStateResumeCallback, this); + } + + /** + * Init all the clusters used by this device. + */ + void Init(); + + /** + * Handles the RvcRunMode command requesting a mode change. + */ + void HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response); + + /** + * Handles the RvcCleanMode command requesting a mode change. + */ + void HandleRvcCleanChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response); + + /** + * Handles the RvcOperationalState pause command. + */ + void HandleOpStatePauseCallback(Clusters::OperationalState::GenericOperationalError & err); + + /** + * Handles the RvcOperationalState resume command. + */ + void HandleOpStateResumeCallback(Clusters::OperationalState::GenericOperationalError & err); +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h b/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h new file mode 100644 index 00000000000000..f1c3d7b22586a7 --- /dev/null +++ b/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h @@ -0,0 +1,159 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +class RvcDevice; + +typedef void (RvcDevice::*HandleChangeToModeA)(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response); + +namespace RvcRunMode { + +const uint8_t ModeIdle = 0; +const uint8_t ModeCleaning = 1; +const uint8_t ModeMapping = 2; + +/// This is an application level delegate to handle RvcRun commands according to the specific business logic. +class RvcRunModeDelegate : public ModeBase::Delegate +{ +private: + using ModeTagStructType = detail::Structs::ModeTagStruct::Type; + ModeTagStructType ModeTagsIdle[1] = { { .value = to_underlying(ModeTag::kIdle) } }; + ModeTagStructType ModeTagsCleaning[1] = { { .value = to_underlying(ModeTag::kCleaning) } }; + ModeTagStructType ModeTagsMapping[1] = { { .mfgCode = MakeOptional(TestVendor1), .value = 0x8001 } }; + + const detail::Structs::ModeOptionStruct::Type kModeOptions[3] = { + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Idle"), + .mode = ModeIdle, + .modeTags = DataModel::List(ModeTagsIdle) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Cleaning"), + .mode = ModeCleaning, + .modeTags = DataModel::List(ModeTagsCleaning) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Mapping"), + .mode = ModeMapping, + .modeTags = DataModel::List(ModeTagsMapping) }, + }; + + CHIP_ERROR Init() override; + void HandleChangeToMode(uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override; + + CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label) override; + CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) override; + CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List & tags) override; + + RvcDevice * mRvcDeviceInstance; + HandleChangeToModeA mCallback; + +public: + void SetHandleChangeToMode(HandleChangeToModeA aCallback, RvcDevice * aInstance) + { + mCallback = aCallback; + mRvcDeviceInstance = aInstance; + }; + + ~RvcRunModeDelegate() override = default; +}; + +void Shutdown(); + +} // namespace RvcRunMode + +namespace RvcCleanMode { + +const uint8_t ModeQuick = 0; +const uint8_t ModeAuto = 1; +const uint8_t ModeDeepClean = 2; +const uint8_t ModeQuiet = 3; +const uint8_t ModeMaxVac = 4; + +/// This is an application level delegate to handle RvcClean commands according to the specific business logic. +class RvcCleanModeDelegate : public ModeBase::Delegate +{ +private: + using ModeTagStructType = detail::Structs::ModeTagStruct::Type; + ModeTagStructType modeTagsQuick[2] = { { .value = to_underlying(ModeTag::kVacuum) }, + { .value = to_underlying(ModeBase::ModeTag::kQuick) } }; + + ModeTagStructType modeTagsAuto[2] = { { .value = to_underlying(ModeBase::ModeTag::kAuto) }, + { .value = to_underlying(ModeTag::kVacuum) } }; + + ModeTagStructType modeTagsDeepClean[3] = { { .value = to_underlying(ModeTag::kMop) }, + { .value = to_underlying(ModeTag::kDeepClean) }, + { .value = to_underlying(ModeTag::kVacuum) } }; + + ModeTagStructType modeTagsQuiet[2] = { { .value = to_underlying(ModeBase::ModeTag::kQuiet) }, + { .value = to_underlying(ModeTag::kVacuum) } }; + + ModeTagStructType modeTagsMaxVac[2] = { { .value = to_underlying(ModeTag::kVacuum) }, + { .value = to_underlying(ModeTag::kDeepClean) } }; + + const detail::Structs::ModeOptionStruct::Type kModeOptions[5] = { + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Quick"), + .mode = ModeQuick, + .modeTags = DataModel::List(modeTagsQuick) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Auto"), + .mode = ModeAuto, + .modeTags = DataModel::List(modeTagsAuto) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Deep Clean"), + .mode = ModeDeepClean, + .modeTags = DataModel::List(modeTagsDeepClean) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Quiet"), + .mode = ModeQuiet, + .modeTags = DataModel::List(modeTagsQuiet) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Max Vac"), + .mode = ModeMaxVac, + .modeTags = DataModel::List(modeTagsMaxVac) }, + }; + + CHIP_ERROR Init() override; + void HandleChangeToMode(uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override; + + CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label) override; + CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) override; + CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List & tags) override; + + RvcDevice * mRvcDeviceInstance; + HandleChangeToModeA mCallback; + +public: + void SetHandleChangeToMode(HandleChangeToModeA aCallback, RvcDevice * aInstance) + { + mCallback = aCallback; + mRvcDeviceInstance = aInstance; + }; + + ~RvcCleanModeDelegate() override = default; +}; + +void Shutdown(); + +} // namespace RvcCleanMode + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h new file mode 100644 index 00000000000000..b2737a0c34b27f --- /dev/null +++ b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h @@ -0,0 +1,137 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { + +class RvcDevice; + +typedef void (RvcDevice::*HandleOpStateCommand)(Clusters::OperationalState::GenericOperationalError & err); + +namespace RvcOperationalState { + +// This is an application level delegate to handle operational state commands according to the specific business logic. +class RvcOperationalStateDelegate : public OperationalState::Delegate +{ +private: + const Clusters::OperationalState::GenericOperationalState mOperationalStateList[7] = { + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)), + OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kError)), + OperationalState::GenericOperationalState( + to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kSeekingCharger)), + OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kCharging)), + OperationalState::GenericOperationalState(to_underlying(Clusters::RvcOperationalState::OperationalStateEnum::kDocked)), + }; + + const Clusters::OperationalState::GenericOperationalPhase mOperationalPhaseList[1] = { + // Phase List is null + OperationalState::GenericOperationalPhase(DataModel::Nullable()), + }; + + RvcDevice * mPauseRvcDeviceInstance; + HandleOpStateCommand mPauseCallback; + RvcDevice * mResumeRvcDeviceInstance; + HandleOpStateCommand mResumeCallback; + +public: + /** + * Get the countdown time. This attribute is not supported in our example RVC app. + * @return Null. + */ + DataModel::Nullable GetCountdownTime() override { return {}; }; + + /** + * Fills in the provided GenericOperationalState with the state at index `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of states. + * Note: This is used by the SDK to populate the operational state list attribute. If the contents of this list changes, + * the device SHALL call the Instance's ReportOperationalStateListChange method to report that this attribute has changed. + * @param index The index of the state, with 0 representing the first state. + * @param operationalState The GenericOperationalState is filled. + */ + CHIP_ERROR GetOperationalStateAtIndex(size_t index, + Clusters::OperationalState::GenericOperationalState & operationalState) override; + + /** + * Fills in the provided GenericOperationalPhase with the phase at index `index` if there is one, + * or returns CHIP_ERROR_NOT_FOUND if the index is out of range for the list of phases. + * Note: This is used by the SDK to populate the phase list attribute. If the contents of this list changes, the + * device SHALL call the Instance's ReportPhaseListChange method to report that this attribute has changed. + * @param index The index of the phase, with 0 representing the first phase. + * @param operationalPhase The GenericOperationalPhase is filled. + */ + CHIP_ERROR GetOperationalPhaseAtIndex(size_t index, + Clusters::OperationalState::GenericOperationalPhase & operationalPhase) override; + + // command callback + /** + * Handle Command Callback in application: Pause + * @param[out] get operational error after callback. + */ + void HandlePauseStateCallback(Clusters::OperationalState::GenericOperationalError & err) override; + + /** + * Handle Command Callback in application: Resume + * @param[out] get operational error after callback. + */ + void HandleResumeStateCallback(Clusters::OperationalState::GenericOperationalError & err) override; + + /** + * Handle Command Callback in application: Start + * @param[out] get operational error after callback. + */ + void HandleStartStateCallback(Clusters::OperationalState::GenericOperationalError & err) override{ + // This command in not supported. + }; + + /** + * Handle Command Callback in application: Stop + * @param[out] get operational error after callback. + */ + void HandleStopStateCallback(Clusters::OperationalState::GenericOperationalError & err) override{ + // This command in not supported. + }; + + void SetPauseCallback(HandleOpStateCommand aCallback, RvcDevice * aInstance) + { + mPauseCallback = aCallback; + mPauseRvcDeviceInstance = aInstance; + }; + + void SetResumeCallback(HandleOpStateCommand aCallback, RvcDevice * aInstance) + { + mResumeCallback = aCallback; + mResumeRvcDeviceInstance = aInstance; + }; +}; + +void Shutdown(); + +} // namespace RvcOperationalState +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter new file mode 100644 index 00000000000000..fae920d56cafae --- /dev/null +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -0,0 +1,1202 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; +} + +struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; +} + +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : ENUM8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : ENUM8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : ENUM8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + INT16U identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : BITMAP32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute CLUSTER_ID serverList[] = 1; + readonly attribute CLUSTER_ID clientList[] = 2; + readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : ENUM8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : ENUM8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : ENUM8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : ENUM8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + INT32U softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; + attribute access(write: manage) boolean localConfigDisabled = 16; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : ENUM8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : ENUM8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + INT16U expiryLengthSeconds = 0; + INT64U breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + CHAR_STRING countryCode = 1; + INT64U breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : ENUM8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : ENUM8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : BITMAP32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap WiFiSecurityBitmap : BITMAP8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable OCTET_STRING<32> ssid = 0; + optional INT64U breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + OCTET_STRING<32> ssid = 0; + OCTET_STRING<64> credentials = 1; + optional INT64U breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + OCTET_STRING<254> operationalDataset = 0; + optional INT64U breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING<512> debugText = 1; + optional INT8U networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +server cluster DiagnosticLogs = 50 { + enum IntentEnum : ENUM8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : ENUM8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : ENUM8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional CHAR_STRING<32> transferFileDesignator = 2; + } + + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : ENUM8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : ENUM8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : ENUM8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : ENUM8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : ENUM8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; + readonly attribute int32u totalOperationalHours = 3; + readonly attribute BootReasonEnum bootReason = 4; + readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + OCTET_STRING<16> enableKey = 0; + INT64U eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : ENUM8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : ENUM8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + OCTET_STRING PAKEPasscodeVerifier = 1; + INT16U discriminator = 2; + INT32U iterations = 3; + OCTET_STRING salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : ENUM8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : ENUM8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute OCTET_STRING trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + OCTET_STRING attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + OCTET_STRING CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + OCTET_STRING IPKValue = 2; + Int64u caseAdminSubject = 3; + VENDOR_ID adminVendorId = 4; + } + + request struct UpdateNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + CHAR_STRING<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + OCTET_STRING rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : ENUM8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : BITMAP32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + INT16U groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + INT16U groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + INT16U groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +server cluster RvcRunMode = 84 { + enum ModeTag : ENUM16 { + kIdle = 16384; + kCleaning = 16385; + } + + enum StatusCode : ENUM8 { + kStuck = 65; + kDustBinMissing = 66; + kDustBinFull = 67; + kWaterTankEmpty = 68; + kWaterTankMissing = 69; + kWaterTankLidOpen = 70; + kMopCleaningPadMissing = 71; + kBatteryLow = 72; + } + + bitmap Feature : BITMAP32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + INT8U newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + ENUM8 status = 0; + optional CHAR_STRING statusText = 1; + } + + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +server cluster RvcCleanMode = 85 { + enum ModeTag : ENUM16 { + kDeepClean = 16384; + kVacuum = 16385; + kMop = 16386; + } + + enum StatusCode : ENUM8 { + kCleaningInProgress = 64; + } + + bitmap Feature : BITMAP32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + INT8U newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + ENUM8 status = 0; + optional CHAR_STRING statusText = 1; + } + + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** This cluster supports remotely monitoring and, where supported, changing the operational state of a Robotic Vacuum. */ +server cluster RvcOperationalState = 97 { + enum ErrorStateEnum : ENUM8 { + kFailedToFindChargingDock = 64; + kStuck = 65; + kDustBinMissing = 66; + kDustBinFull = 67; + kWaterTankEmpty = 68; + kWaterTankMissing = 69; + kWaterTankLidOpen = 70; + kMopCleaningPadMissing = 71; + } + + enum OperationalStateEnum : ENUM8 { + kSeekingCharger = 64; + kCharging = 65; + kDocked = 66; + } + + struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; + } + + struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; + } + + critical event OperationalError = 0 { + ErrorStateStruct errorState = 0; + } + + info event OperationCompletion = 1 { + ENUM8 completionErrorCode = 0; + optional nullable elapsed_s totalOperationalTime = 1; + optional nullable elapsed_s pausedTime = 2; + } + + readonly attribute nullable CHAR_STRING phaseList[] = 0; + readonly attribute nullable int8u currentPhase = 1; + readonly attribute OperationalStateStruct operationalStateList[] = 3; + readonly attribute enum8 operationalState = 4; + readonly attribute ErrorStateStruct operationalError = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct OperationalCommandResponse = 4 { + ErrorStateStruct commandResponseState = 0; + } + + command Pause(): OperationalCommandResponse = 0; + command Resume(): OperationalCommandResponse = 3; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision default = 10; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 0x0001; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; + callback attribute totalOperationalHours default = 0x00000000; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_robotic_vacuum_cleaner = 116, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute eventList; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster Descriptor { + callback attribute deviceTypeList default = 0; + callback attribute serverList default = 0; + callback attribute clientList default = 0; + callback attribute partsList default = 0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute eventList; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster RvcRunMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster RvcCleanMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster RvcOperationalState { + emits event OperationalError; + emits event OperationCompletion; + callback attribute phaseList; + callback attribute currentPhase; + callback attribute operationalStateList; + callback attribute operationalState; + callback attribute operationalError; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} + + diff --git a/examples/rvc-app/rvc-common/rvc-app.zap b/examples/rvc-app/rvc-common/rvc-app.zap new file mode 100644 index 00000000000000..34580f98854834 --- /dev/null +++ b/examples/rvc-app/rvc-common/rvc-app.zap @@ -0,0 +1,10896 @@ +{ + "featureLevel": 97, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 12, + "name": "MA-rootdevice", + "deviceTypeRef": { + "id": 177, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "id": 177, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceTypeRefs": [ + 177 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "switch type", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "switch actions", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OTAUpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StateTransition", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "VersionApplied", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "DownloadError", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "PHYRate", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PHYRateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FullDuplex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketRxCount", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketTxCount", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCount", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CollisionCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CarrierDetect", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TimeSinceReset", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NumberOfPositions", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPosition", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 11, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "id": 225, + "code": 116, + "profileId": 259, + "label": "MA-robotic-vacuum-cleaner", + "name": "MA-robotic-vacuum-cleaner" + }, + "deviceTypes": [ + { + "id": 225, + "code": 116, + "profileId": 259, + "label": "MA-robotic-vacuum-cleaner", + "name": "MA-robotic-vacuum-cleaner" + } + ], + "deviceTypeRefs": [ + 225 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 116 + ], + "deviceTypeName": "MA-robotic-vacuum-cleaner", + "deviceTypeCode": 116, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConfiguredBy", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "node_id", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SceneTableSize", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingCapacity", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GlobalSceneControl", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTime", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffWaitTime", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpOnOff", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "OnOffStartUpOnOff", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinLevel", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxLevel", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentFrequency", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinFrequency", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxFrequency", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "LevelControlOptions", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnOffTransitionTime", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnLevel", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTransitionTime", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffTransitionTime", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultMoveRate", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpCurrentLevel", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TagList", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Binding", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Run Mode", + "code": 84, + "mfgCode": null, + "define": "RVC_RUN_MODE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Run Mode", + "code": 84, + "mfgCode": null, + "define": "RVC_RUN_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Clean Mode", + "code": 85, + "mfgCode": null, + "define": "RVC_CLEAN_MODE_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Clean Mode", + "code": 85, + "mfgCode": null, + "define": "RVC_CLEAN_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpMode", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnMode", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "RVC Operational State", + "code": 97, + "mfgCode": null, + "define": "OPERATIONAL_STATE_RVC_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CountdownTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalStateList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalState", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperationalError", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "ErrorStateStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "OperationalError", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "OperationCompletion", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Door Lock", + "code": 257, + "mfgCode": null, + "define": "DOOR_LOCK_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "LockDoor", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UnlockDoor", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetUser", + "code": 26, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetUser", + "code": 27, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearUser", + "code": 29, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetCredential", + "code": 34, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ClearCredential", + "code": 38, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "7", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Door Lock", + "code": 257, + "mfgCode": null, + "define": "DOOR_LOCK_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "GetUserResponse", + "code": 28, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetCredentialResponse", + "code": 35, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "LockState", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "DlLockState", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LockType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "DlLockType", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActuatorEnabled", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DoorState", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "DoorStateEnum", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DoorOpenEvents", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DoorClosedEvents", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OpenPeriod", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfTotalUsersSupported", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfPINUsersSupported", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfRFIDUsersSupported", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfWeekDaySchedulesSupportedPerUser", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfYearDaySchedulesSupportedPerUser", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfHolidaySchedulesSupported", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxPINCodeLength", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinPINCodeLength", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxRFIDCodeLength", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinRFIDCodeLength", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CredentialRulesSupport", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "DlCredentialRuleMask", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfCredentialsSupportedPerUser", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Language", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LEDSettings", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AutoRelockTime", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SoundVolume", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OperatingMode", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "OperatingModeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedOperatingModes", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "DlSupportedOperatingModes", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFFF6", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultConfigurationRegister", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "DlDefaultConfigurationRegister", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableLocalProgramming", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableOneTouchLocking", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnableInsideStatusLED", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnablePrivacyModeButton", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocalProgrammingFeatures", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "DlLocalProgrammingFeatures", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WrongCodeEntryLimit", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UserCodeTemporaryDisableTime", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SendPINOverTheAir", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RequirePINforRemoteOperation", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ExpiringUserTimeout", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "7", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Barrier Control", + "code": 259, + "mfgCode": null, + "define": "BARRIER_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "BarrierControlGoToPercent", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "BarrierControlStop", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Barrier Control", + "code": 259, + "mfgCode": null, + "define": "BARRIER_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "barrier moving state", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier safety status", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "bitmap16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier capabilities", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier open events", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier close events", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier command open events", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier command close events", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier open period", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier close period", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "barrier position", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToHue", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveHue", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepHue", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToSaturation", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveSaturation", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepSaturation", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToHueAndSaturation", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColor", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveColor", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepColor", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColorTemperature", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StopMoveStep", + "code": 71, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveColorTemperature", + "code": 75, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepColorTemperature", + "code": 76, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentHue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentSaturation", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentX", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x616B", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentY", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x607D", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DriftCompensation", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CompensationText", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorTemperatureMireds", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00FA", + "reportable": 0, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorMode", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NumberOfPrimaries", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1X", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Y", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Intensity", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2X", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Y", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Intensity", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3X", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Y", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Intensity", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4X", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Y", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Intensity", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5X", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Y", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Intensity", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6X", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Y", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Intensity", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointX", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointY", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRX", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRY", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRIntensity", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGX", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGY", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGIntensity", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBX", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBY", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBIntensity", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnhancedCurrentHue", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnhancedColorMode", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopActive", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopDirection", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopTime", + "code": 16388, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0019", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopStartEnhancedHue", + "code": 16389, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x2300", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorLoopStoredEnhancedHue", + "code": 16390, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorCapabilities", + "code": 16394, + "mfgCode": null, + "side": "server", + "type": "bitmap16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMinMireds", + "code": 16395, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMaxMireds", + "code": 16396, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFEFF", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CoupleColorTempToLevelMinMireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpColorTemperatureMireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMPERATURE_MEASUREMENT_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Measurement", + "code": 1026, + "mfgCode": null, + "define": "TEMPERATURE_MEASUREMENT_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "MeasuredValue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinMeasuredValue", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxMeasuredValue", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x8000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Tolerance", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Occupancy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "OccupancyBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupancySensorType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupancySensorTypeBitmap", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PIROccupiedToUnoccupiedDelay", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PIRUnoccupiedToOccupiedDelay", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PIRUnoccupiedToOccupiedThreshold", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UltrasonicOccupiedToUnoccupiedDelay", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UltrasonicUnoccupiedToOccupiedDelay", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UltrasonicUnoccupiedToOccupiedThreshold", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalContactOccupiedToUnoccupiedDelay", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalContactUnoccupiedToOccupiedDelay", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalContactUnoccupiedToOccupiedThreshold", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/src/rvc-device.cpp b/examples/rvc-app/rvc-common/src/rvc-device.cpp new file mode 100644 index 00000000000000..f085e6dada9f1c --- /dev/null +++ b/examples/rvc-app/rvc-common/src/rvc-device.cpp @@ -0,0 +1,83 @@ +#include "rvc-device.h" + +using namespace chip::app::Clusters; + +void RvcDevice::Init() +{ + mRunModeInstance.Init(); + mCleanModeInstance.Init(); + mOperationalStateInstance.Init(); +} + +void RvcDevice::HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + uint8_t currentMode = mRunModeInstance.GetCurrentMode(); + + switch (newMode) + { + case RvcRunMode::ModeMapping: { + // change to mapping only allowed from the Idle state. + if (currentMode != RvcRunMode::ModeIdle) + { + response.status = to_underlying(ModeBase::StatusCode::kGenericFailure); + response.statusText.SetValue(chip::CharSpan::fromCharString("Change to the mapping mode is only allowed from idle")); + return; + } + + mRunModeInstance.UpdateCurrentMode(newMode); + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); + break; + } + case RvcRunMode::ModeCleaning: { + mRunModeInstance.UpdateCurrentMode(newMode); + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); + } + break; + case RvcRunMode::ModeIdle: { + mRunModeInstance.UpdateCurrentMode(newMode); + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + } + } + + response.status = to_underlying(ModeBase::StatusCode::kSuccess); +} + +void RvcDevice::HandleRvcCleanChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + uint8_t rvcRunCurrentMode = mRunModeInstance.GetCurrentMode(); + + if (rvcRunCurrentMode != RvcRunMode::ModeIdle) + { + response.status = to_underlying(RvcCleanMode::StatusCode::kCleaningInProgress); + response.statusText.SetValue(chip::CharSpan::fromCharString("Change of the cleaning mode is only allowed in Idle.")); + return; + } + + response.status = to_underlying(ModeBase::StatusCode::kSuccess); +} + +void RvcDevice::HandleOpStatePauseCallback(Clusters::OperationalState::GenericOperationalError & err) +{ + auto error = mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError)); + } + else + { + err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); + } +} + +void RvcDevice::HandleOpStateResumeCallback(Clusters::OperationalState::GenericOperationalError & err) +{ + auto error = mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); + if (error == CHIP_NO_ERROR) + { + err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError)); + } + else + { + err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); + } +} diff --git a/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp b/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp new file mode 100644 index 00000000000000..8757b5e1666f58 --- /dev/null +++ b/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp @@ -0,0 +1,123 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::RvcRunMode; +using namespace chip::app::Clusters::RvcCleanMode; +using chip::Protocols::InteractionModel::Status; +template +using List = chip::app::DataModel::List; + +// RVC Run +CHIP_ERROR RvcRunModeDelegate::Init() +{ + return CHIP_NO_ERROR; +} + +void RvcRunModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + (mRvcDeviceInstance->*mCallback)(NewMode, response); +} + +CHIP_ERROR RvcRunModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); +} + +CHIP_ERROR RvcRunModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + value = kModeOptions[modeIndex].mode; + return CHIP_NO_ERROR; +} + +CHIP_ERROR RvcRunModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List & tags) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + if (tags.size() < kModeOptions[modeIndex].modeTags.size()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); + tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); + + return CHIP_NO_ERROR; +} + +// RVC Clean + +CHIP_ERROR RvcCleanModeDelegate::Init() +{ + return CHIP_NO_ERROR; +} + +void RvcCleanModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + (mRvcDeviceInstance->*mCallback)(NewMode, response); +} + +CHIP_ERROR RvcCleanModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); +} + +CHIP_ERROR RvcCleanModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + value = kModeOptions[modeIndex].mode; + return CHIP_NO_ERROR; +} + +CHIP_ERROR RvcCleanModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List & tags) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + if (tags.size() < kModeOptions[modeIndex].modeTags.size()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); + tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); + + return CHIP_NO_ERROR; +} diff --git a/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp b/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp new file mode 100644 index 00000000000000..c94de8f231bbe4 --- /dev/null +++ b/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp @@ -0,0 +1,55 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::RvcOperationalState; + +CHIP_ERROR RvcOperationalStateDelegate::GetOperationalStateAtIndex(size_t index, + OperationalState::GenericOperationalState & operationalState) +{ + if (index >= ArraySize(mOperationalStateList)) + { + return CHIP_ERROR_NOT_FOUND; + } + operationalState = mOperationalStateList[index]; + return CHIP_NO_ERROR; +} + +CHIP_ERROR RvcOperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, + OperationalState::GenericOperationalPhase & operationalPhase) +{ + if (index >= ArraySize(mOperationalPhaseList)) + { + return CHIP_ERROR_NOT_FOUND; + } + operationalPhase = mOperationalPhaseList[index]; + return CHIP_NO_ERROR; +} + +void RvcOperationalStateDelegate::HandlePauseStateCallback(OperationalState::GenericOperationalError & err) +{ + (mPauseRvcDeviceInstance->*mPauseCallback)(err); +} + +void RvcOperationalStateDelegate::HandleResumeStateCallback(OperationalState::GenericOperationalError & err) +{ + (mResumeRvcDeviceInstance->*mResumeCallback)(err); +} From 8d15e0182f19c3d19229ea3380f4081537657e60 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 11 Sep 2023 10:56:53 -0400 Subject: [PATCH 054/134] Update Mode Select ClusterRevision to 2. (#29140) Fixes https://github.com/project-chip/connectedhomeip/issues/26445 --- .../all-clusters-common/all-clusters-app.matter | 2 +- .../all-clusters-common/all-clusters-app.zap | 7 +++---- .../all-clusters-minimal-app.matter | 2 +- .../all-clusters-minimal-app.zap | 4 ++-- .../devices/rootnode_dishwasher_cc105034fe.zap | 4 ++-- .../devices/rootnode_laundrywasher_fb10d238c8.zap | 4 ++-- ...et_temperaturecontrolledcabinet_ffdb696680.zap | 4 ++-- .../test_files/sample_zap_file.zap | 15 ++------------- .../dishwasher-common/dishwasher-app.zap | 4 ++-- .../placeholder/linux/apps/app1/config.matter | 2 +- examples/placeholder/linux/apps/app1/config.zap | 4 ++-- .../placeholder/linux/apps/app2/config.matter | 2 +- examples/placeholder/linux/apps/app2/config.zap | 4 ++-- .../refrigerator-common/refrigerator-app.zap | 4 ++-- .../tools/zap/tests/inputs/all-clusters-app.zap | 4 ++-- .../app-templates/endpoint_config.h | 2 +- .../zcl/data-model/chip/mode-select-cluster.xml | 3 +++ src/controller/data_model/controller-clusters.zap | 4 ++-- 18 files changed, 33 insertions(+), 42 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 0350bdc758adcd..f8619b6f400a60 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -6722,7 +6722,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 1; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; ram attribute manufacturerExtension default = 255; } diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index 6d4e6c60c4fec4..785e3aaef11fe8 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -14787,7 +14787,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14973,7 +14973,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -35392,6 +35392,5 @@ "endpointId": 65534, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index d7c370d760f689..d514d42061268a 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -4426,7 +4426,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; } server cluster TemperatureControl { diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index f2658e0fb018c8..083a0b4b543559 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -13821,7 +13821,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14007,7 +14007,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index df18b2b1ff5e45..e3343e5584a29a 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -8395,7 +8395,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8597,7 +8597,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap index 85c94b1a55186b..5a340b0e9a37a5 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.zap @@ -8411,7 +8411,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8613,7 +8613,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap index 449ce9ef3cd474..1fffb622c1af4a 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.zap @@ -8475,7 +8475,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8677,7 +8677,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/sample_app_util/test_files/sample_zap_file.zap b/examples/chef/sample_app_util/test_files/sample_zap_file.zap index fe32b0c929b0a7..7de53320310a9b 100644 --- a/examples/chef/sample_app_util/test_files/sample_zap_file.zap +++ b/examples/chef/sample_app_util/test_files/sample_zap_file.zap @@ -1,5 +1,5 @@ { - "featureLevel": 97, + "featureLevel": 98, "creator": "zap", "keyValuePairs": [ { @@ -36,7 +36,6 @@ "id": 1, "name": "MA-rootdevice", "deviceTypeRef": { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", @@ -44,16 +43,12 @@ }, "deviceTypes": [ { - "id": 2, "code": 22, "profileId": 259, "label": "MA-rootdevice", "name": "MA-rootdevice" } ], - "deviceTypeRefs": [ - 2 - ], "deviceVersions": [ 1 ], @@ -5372,7 +5367,6 @@ "id": 2, "name": "MA-dimmablelight", "deviceTypeRef": { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", @@ -5380,16 +5374,12 @@ }, "deviceTypes": [ { - "id": 9, "code": 257, "profileId": 259, "label": "MA-dimmablelight", "name": "MA-dimmablelight" } ], - "deviceTypeRefs": [ - 9 - ], "deviceVersions": [ 1 ], @@ -7782,6 +7772,5 @@ "endpointId": 1, "networkId": 0 } - ], - "log": [] + ] } \ No newline at end of file diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap index c07689aff2ef84..3832adf0bb7d01 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.zap @@ -8395,7 +8395,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8597,7 +8597,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index be49149c26e9dd..fa283c471267b3 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -6940,7 +6940,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; } server cluster DoorLock { diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index a6d4b3a1c028c9..d3c3fec0f6ff7a 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -6657,7 +6657,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6827,7 +6827,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 40f35329b7a5d2..78a45b3636cede 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -6906,7 +6906,7 @@ endpoint 0 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 2; } server cluster DoorLock { diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index abdf3ac2e318f4..a9abe620d374c6 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -6741,7 +6741,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -6911,7 +6911,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap index 5752fd943abbd9..733e241cdf1e6f 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.zap @@ -8475,7 +8475,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -8677,7 +8677,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index 9e73cd21902857..bd003251162fc8 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -14053,7 +14053,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -14239,7 +14239,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index f8834f17d60bc0..88401280135ed7 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -884,7 +884,7 @@ { ZAP_SIMPLE_DEFAULT(255), 0x00000005, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* OnMode */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ + { ZAP_SIMPLE_DEFAULT(2), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Door Lock (server) */ \ { ZAP_SIMPLE_DEFAULT(2), 0x00000000, 1, ZAP_TYPE(ENUM8), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LockState */ \ diff --git a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml index 7bf4c972972635..76b056acf50ea6 100644 --- a/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/mode-select-cluster.xml @@ -37,6 +37,9 @@ limitations under the License. MODE_SELECT_CLUSTER true true + + + Attributes and commands for selecting a mode from a list of supported options. Description diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 5a1c9afa03a6d6..77f9d90aa108f6 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -10532,7 +10532,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -10734,7 +10734,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, From 82a37e1fc03e46b2c9a37c29e0fe16186ad4bfca Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 11 Sep 2023 10:58:15 -0400 Subject: [PATCH 055/134] Update Interaction Model revision to spec. (#29135) Spec got stealth-bumped (no corresponding SDK issue) to 11 last month sometime. --- src/app/InteractionModelRevision.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/InteractionModelRevision.h b/src/app/InteractionModelRevision.h index 7e92d7c2d58aba..9cc9fc66de0796 100644 --- a/src/app/InteractionModelRevision.h +++ b/src/app/InteractionModelRevision.h @@ -29,7 +29,7 @@ * Specification" chapter of the core Matter specification. */ #ifndef CHIP_DEVICE_INTERACTION_MODEL_REVISION -#define CHIP_DEVICE_INTERACTION_MODEL_REVISION 10 +#define CHIP_DEVICE_INTERACTION_MODEL_REVISION 11 #endif constexpr uint8_t kInteractionModelRevisionTag = 0xFF; From b54c646f51f8a12ba8be093e405e1e87225d83f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 16:18:54 +0000 Subject: [PATCH 056/134] Bump third_party/openthread/repo from `d4155e4` to `0b269e1` (#29150) Bumps [third_party/openthread/repo](https://github.com/openthread/openthread) from `d4155e4` to `0b269e1`. - [Release notes](https://github.com/openthread/openthread/releases) - [Commits](https://github.com/openthread/openthread/compare/d4155e4e5f2a74cc50a545aa3dfb78f558dc117b...0b269e12b9c313d9453ad5017a7588cec3eea75b) --- updated-dependencies: - dependency-name: third_party/openthread/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/openthread/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/openthread/repo b/third_party/openthread/repo index d4155e4e5f2a74..0b269e12b9c313 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit d4155e4e5f2a74cc50a545aa3dfb78f558dc117b +Subproject commit 0b269e12b9c313d9453ad5017a7588cec3eea75b From b274b9ebe7ea9a89b9347b29b3be23ad2d18347c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 11 Sep 2023 12:20:00 -0400 Subject: [PATCH 057/134] Implement RebootCount storage on Darwin. (#29134) * Implement RebootCount storage on Darwin. Fixes https://github.com/project-chip/connectedhomeip/issues/29108 * Address review comment. --- src/platform/Darwin/DiagnosticDataProviderImpl.cpp | 11 +++++++++++ src/platform/Darwin/DiagnosticDataProviderImpl.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/platform/Darwin/DiagnosticDataProviderImpl.cpp b/src/platform/Darwin/DiagnosticDataProviderImpl.cpp index 640a8eca27cd58..62a20a8efdb777 100644 --- a/src/platform/Darwin/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Darwin/DiagnosticDataProviderImpl.cpp @@ -89,6 +89,17 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() return CHIP_NO_ERROR; } +CHIP_ERROR DiagnosticDataProviderImpl::GetRebootCount(uint16_t & rebootCount) +{ + uint32_t count = 0; + + ReturnErrorOnFailure(ConfigurationMgr().GetRebootCount(count)); + VerifyOrReturnError(count <= UINT16_MAX, CHIP_ERROR_INVALID_INTEGER_VALUE); + rebootCount = static_cast(count); + + return CHIP_NO_ERROR; +} + DiagnosticDataProvider & GetDiagnosticDataProviderImpl() { return DiagnosticDataProviderImpl::GetDefaultInstance(); diff --git a/src/platform/Darwin/DiagnosticDataProviderImpl.h b/src/platform/Darwin/DiagnosticDataProviderImpl.h index 3cfc31bc1f9678..b97aa30ad27074 100644 --- a/src/platform/Darwin/DiagnosticDataProviderImpl.h +++ b/src/platform/Darwin/DiagnosticDataProviderImpl.h @@ -43,6 +43,7 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider // ===== Methods that implement the DiagnosticDataProvider abstract interface. bool SupportsWatermarks() override { return true; } CHIP_ERROR ResetWatermarks() override; + CHIP_ERROR GetRebootCount(uint16_t & rebootCount) override; }; /** From a3496b81c75f0fbab8fecf06921b7f7a982814ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 18:04:15 +0000 Subject: [PATCH 058/134] Bump third_party/mbedtls/repo from `c10520f` to `06c466d` (#29153) Bumps [third_party/mbedtls/repo](https://github.com/ARMmbed/mbedtls) from `c10520f` to `06c466d`. - [Release notes](https://github.com/ARMmbed/mbedtls/releases) - [Commits](https://github.com/ARMmbed/mbedtls/compare/c10520f45f67807d438e8436d5dbe94aa10352b2...06c466d869094390e1d48cb05649ea118b273f61) --- updated-dependencies: - dependency-name: third_party/mbedtls/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/mbedtls/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/mbedtls/repo b/third_party/mbedtls/repo index c10520f45f6780..06c466d8690943 160000 --- a/third_party/mbedtls/repo +++ b/third_party/mbedtls/repo @@ -1 +1 @@ -Subproject commit c10520f45f67807d438e8436d5dbe94aa10352b2 +Subproject commit 06c466d869094390e1d48cb05649ea118b273f61 From ae6aa70c3f1c5784bda6a0d46932f9e4bbaf264e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 18:05:52 +0000 Subject: [PATCH 059/134] Bump third_party/ot-br-posix/repo from `8299da3` to `8a280e3` (#29148) Bumps [third_party/ot-br-posix/repo](https://github.com/openthread/ot-br-posix) from `8299da3` to `8a280e3`. - [Release notes](https://github.com/openthread/ot-br-posix/releases) - [Commits](https://github.com/openthread/ot-br-posix/compare/8299da302aebf807e76885e9f758df18100522d1...8a280e3516641f707324bbc83059736d02f68955) --- updated-dependencies: - dependency-name: third_party/ot-br-posix/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/ot-br-posix/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/ot-br-posix/repo b/third_party/ot-br-posix/repo index 8299da302aebf8..8a280e3516641f 160000 --- a/third_party/ot-br-posix/repo +++ b/third_party/ot-br-posix/repo @@ -1 +1 @@ -Subproject commit 8299da302aebf807e76885e9f758df18100522d1 +Subproject commit 8a280e3516641f707324bbc83059736d02f68955 From c6ef1aa59058035a20ef4652ca44401158ff0d29 Mon Sep 17 00:00:00 2001 From: wyhong <30567533+wy-hh@users.noreply.github.com> Date: Tue, 12 Sep 2023 03:37:54 +0800 Subject: [PATCH 060/134] [Bouffalolab] Don't factory reset device if reboot with a pending arm failsafe (#29146) --- .../bouffalolab/common/ConfigurationManagerImpl.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp b/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp index b9719b795d15c3..4d6a50e485fe11 100644 --- a/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp +++ b/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp @@ -48,7 +48,6 @@ bool ConfigurationManagerImpl::IsFullyProvisioned() CHIP_ERROR ConfigurationManagerImpl::Init() { CHIP_ERROR err; - bool failSafeArmed; uint32_t rebootCount = 0; err = Internal::GenericConfigurationManagerImpl::Init(); @@ -72,12 +71,6 @@ CHIP_ERROR ConfigurationManagerImpl::Init() SuccessOrExit(err); } - // If the fail-safe was armed when the device last shutdown, initiate a factory reset. - if (GetFailSafeArmed(failSafeArmed) == CHIP_NO_ERROR && failSafeArmed) - { - ChipLogProgress(DeviceLayer, "Detected fail-safe armed on reboot; initiating factory reset"); - InitiateFactoryReset(); - } err = CHIP_NO_ERROR; exit: From 8d0761d59e3b548a965ed7b8aaa398c991a90b4d Mon Sep 17 00:00:00 2001 From: Sergei Lissianoi <54454955+selissia@users.noreply.github.com> Date: Mon, 11 Sep 2023 15:51:14 -0400 Subject: [PATCH 061/134] [Silabs] Add hooks into the Silabs performance testing functionality (#29160) * Add hooks into the Silabs performance testing functionality * Documentation syntax corrections * Restyled by whitespace * Restyled by clang-format * Fix comment typo --------- Co-authored-by: Restyled.io --- docs/guides/silabs_efr32_software_update.md | 4 ++-- examples/light-switch-app/silabs/README.md | 2 +- examples/platform/silabs/BaseApplication.cpp | 8 ++++++++ examples/platform/silabs/FreeRTOSConfig.h | 10 ++++++++++ examples/platform/silabs/MatterConfig.cpp | 10 ++++++++++ 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/docs/guides/silabs_efr32_software_update.md b/docs/guides/silabs_efr32_software_update.md index 3d8649cf91511b..ec57cc4acaa372 100644 --- a/docs/guides/silabs_efr32_software_update.md +++ b/docs/guides/silabs_efr32_software_update.md @@ -42,8 +42,8 @@ all of the EFR32 example applications. - In a terminal start the Provider app passing to it the path to the Matter OTA file created in the previous step: - rm -r /tmp/chip_* - ./out/debug/chip-ota-provider-app -f chip-efr32-lighting-example.ota + rm -r /tmp/chip_kvs_provider + ./out/debug/chip-ota-provider-app --KVS /tmp/chip_kvs_provider -f chip-efr32-lighting-example.ota - In a separate terminal run the chip-tool commands to provision the Provider: diff --git a/examples/light-switch-app/silabs/README.md b/examples/light-switch-app/silabs/README.md index 03572a2b7b4e6f..a7e19ba18b2e98 100644 --- a/examples/light-switch-app/silabs/README.md +++ b/examples/light-switch-app/silabs/README.md @@ -312,7 +312,7 @@ combination with JLinkRTTClient as follows: ``` chip-tool pairing ble-thread 1 hex: 20202021 3840 - chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [], "targets": null }{"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [1], "targets": null }]' 0 + chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [], "targets": null },{"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [1], "targets": null }]' 0 chip-tool binding write binding '[{"fabricIndex": 1, "node": , "endpoint": 1, "cluster":6}]' 1 1 ``` diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp index f0760d901fda73..09556e899b79a3 100644 --- a/examples/platform/silabs/BaseApplication.cpp +++ b/examples/platform/silabs/BaseApplication.cpp @@ -65,6 +65,10 @@ #include "dic_control.h" #endif // DIC_ENABLE +#ifdef PERFORMANCE_TEST_ENABLED +#include +#endif // PERFORMANCE_TEST_ENABLED + /********************************************************** * Defines and Constants *********************************************************/ @@ -248,6 +252,10 @@ CHIP_ERROR BaseApplication::Init() OutputQrCode(true /*refreshLCD at init*/); +#ifdef PERFORMANCE_TEST_ENABLED + RegisterPerfTestCommands(); +#endif // PERFORMANCE_TEST_ENABLED + PlatformMgr().AddEventHandler(OnPlatformEvent, 0); #ifdef SL_WIFI sIsProvisioned = ConnectivityMgr().IsWiFiStationProvisioned(); diff --git a/examples/platform/silabs/FreeRTOSConfig.h b/examples/platform/silabs/FreeRTOSConfig.h index 3f438778276244..e904f1930a6a61 100644 --- a/examples/platform/silabs/FreeRTOSConfig.h +++ b/examples/platform/silabs/FreeRTOSConfig.h @@ -285,9 +285,19 @@ standard names. */ #define SysTick_Handler xPortSysTickHandler /* Thread local storage pointers used by the SDK */ +#ifdef PERFORMANCE_TEST_ENABLED +// ot_debug_channel component uses thread-local storage +#define configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS 2 +#ifndef configNUM_USER_THREAD_LOCAL_STORAGE_POINTERS +#define configNUM_USER_THREAD_LOCAL_STORAGE_POINTERS 0 +#define configNUM_THREAD_LOCAL_STORAGE_POINTERS \ + (configNUM_USER_THREAD_LOCAL_STORAGE_POINTERS + configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS) +#endif +#else /* PERFORMANCE_TEST_ENABLED */ #ifndef configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS #define configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS 0 #endif +#endif /* PERFORMANCE_TEST_ENABLED */ #if defined(__GNUC__) /* For the linker. */ diff --git a/examples/platform/silabs/MatterConfig.cpp b/examples/platform/silabs/MatterConfig.cpp index 59503db5e4e143..f9a1b7188beed9 100644 --- a/examples/platform/silabs/MatterConfig.cpp +++ b/examples/platform/silabs/MatterConfig.cpp @@ -70,6 +70,10 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys #include +#ifdef PERFORMANCE_TEST_ENABLED +#include +#endif + #if CHIP_ENABLE_OPENTHREAD #include #include @@ -226,6 +230,12 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName) initParams.operationalKeystore = &gOperationalKeystore; #endif +#ifdef PERFORMANCE_TEST_ENABLED + // Set up Test Event Trigger command of the General Diagnostics cluster. Used only in performance testing + static SilabsTestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) }; + initParams.testEventTriggerDelegate = &testEventTriggerDelegate; +#endif + // Initialize the remaining (not overridden) providers to the SDK example defaults (void) initParams.InitializeStaticResourcesBeforeServerInit(); From aed2bcd8e2d0442c02de045ebf73b4e064322d84 Mon Sep 17 00:00:00 2001 From: Kai Liao <140431279+kliao-csa@users.noreply.github.com> Date: Mon, 11 Sep 2023 21:40:50 -0600 Subject: [PATCH 062/134] Fail Summarize - Data on Pass/Fail Rate Per Workflow (#29170) * Update summarize_fail.py * Update recent_fail_summary.yaml * Update summarize_fail.py * Update summarize_fail.py * Update summarize_fail.py * Update summarize_fail.py * Update recent_fail_summary.yaml * Update summarize_fail.py * Update summarize_fail.py * Update summarize_fail.py * Restyled by autopep8 * Update summarize_fail.py * Update summarize_fail.py --------- Co-authored-by: Restyled.io --- .github/workflows/recent_fail_summary.yaml | 3 ++ scripts/tools/summarize_fail.py | 32 ++++++++++++++++++++-- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.github/workflows/recent_fail_summary.yaml b/.github/workflows/recent_fail_summary.yaml index a4f7eb931f1386..37080eee8005e7 100644 --- a/.github/workflows/recent_fail_summary.yaml +++ b/.github/workflows/recent_fail_summary.yaml @@ -40,6 +40,9 @@ jobs: run_list.json recent_fails.csv recent_fails_frequency.csv + failure_cause_summary.csv + workflow_fail_rate.csv recent_fails_logs + workflow_fail_rate retention-days: 5 diff --git a/scripts/tools/summarize_fail.py b/scripts/tools/summarize_fail.py index 7eca296ca201ad..85283784f9c50c 100644 --- a/scripts/tools/summarize_fail.py +++ b/scripts/tools/summarize_fail.py @@ -36,7 +36,7 @@ def process_fail(id, pr, start_time, workflow): - logging.info("Processing failure in {pr}, workflow {workflow} that started at {start_time}.") + logging.info(f"Processing failure in {pr}, workflow {workflow} that started at {start_time}.") logging.info("Building output file structure.") output_path = f"recent_fails_logs/{slugify(pr)}/{slugify(workflow)}/{slugify(start_time)}" @@ -56,6 +56,16 @@ def process_fail(id, pr, start_time, workflow): if error_message in fail_log: root_cause = error_catalog[workflow_category][error_message]["short"] break + + logging.info(f"Checking recent pass/fail rate of workflow {workflow}.") + workflow_fail_rate_output_path = f"workflow_pass_rate/{slugify(workflow)}" + if not os.path.exists(workflow_fail_rate_output_path): + os.makedirs(workflow_fail_rate_output_path) + subprocess.run( + f"gh run list -R project-chip/connectedhomeip -b master -w '{workflow}' --json conclusion > {workflow_fail_rate_output_path}/run_list.json", shell=True) + else: + logging.info("This workflow has already been processed.") + return [pr, workflow, root_cause] @@ -74,9 +84,9 @@ def main(): df.to_csv("recent_fails.csv", index=False) logging.info("Listing frequency of recent fails by workflow.") - frequency = df["Workflow"].value_counts(normalize=True).mul(100).astype( + frequency = df["Workflow"].value_counts(normalize=True).mul(100).round().astype( str).reset_index(name="Percentage") # Reformat this from "50.0" to "50%" - print("Percentage Frequency of Fails by Workflow:") + print("Share of Recent Fails by Workflow:") print(frequency.to_string(index=False)) print() frequency.to_csv("recent_workflow_fails_frequency.csv") @@ -87,6 +97,22 @@ def main(): root_causes.columns = ["Pull Request", "Workflow", "Cause of Failure"] print("Likely Root Cause of Recent Fails:") print(root_causes.to_string(index=False)) + print() + root_causes.to_csv("failure_cause_summary.csv") + + logging.info("Listing percent fail rate of recent fails by workflow.") + fail_rate = {} + for workflow in next(os.walk("workflow_pass_rate"))[1]: + try: + info = pd.read_json(f"workflow_pass_rate/{workflow}/run_list.json") + info = info[info["conclusion"].str.len() > 0] + fail_rate[workflow] = [info.value_counts(normalize=True).mul(100).round()["failure"]] + except Exception: + logging.exception(f"Recent runs info for {workflow} was not collected.") + fail_rate = pd.DataFrame.from_dict(fail_rate, 'index', columns=["Fail Rate"]) + print("Recent Fail Rate of Each Workflow:") + print(fail_rate.to_string()) + fail_rate.to_csv("workflow_fail_rate.csv") if __name__ == "__main__": From 054783217684cc5810c323a53e2d9dda3ae40e62 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Tue, 12 Sep 2023 08:46:21 +0100 Subject: [PATCH 063/134] CHIPCryptoPALmbedTLS: Include mbedtls/version.h (#29168) `MBEDTLS_VERSION_NUMBER` is defined in version.h, include explicitly. --- src/crypto/CHIPCryptoPALmbedTLS.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/crypto/CHIPCryptoPALmbedTLS.cpp b/src/crypto/CHIPCryptoPALmbedTLS.cpp index c903d984f57e08..0207e303bd9ba6 100644 --- a/src/crypto/CHIPCryptoPALmbedTLS.cpp +++ b/src/crypto/CHIPCryptoPALmbedTLS.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #if defined(MBEDTLS_X509_CRT_PARSE_C) #include #endif // defined(MBEDTLS_X509_CRT_PARSE_C) From d8480f1859dae0f543ed802f6e8cc701f4b98dc6 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Tue, 12 Sep 2023 09:16:30 +0100 Subject: [PATCH 064/134] Convert if __ZEPHYR__ to if defined(__ZEPHYR__) (#29172) Fix building with `-Wundef` on non-Zephyr platforms. --- src/system/SystemConfig.h | 16 ++++++++-------- src/system/SystemError.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/system/SystemConfig.h b/src/system/SystemConfig.h index dceac0f8a49479..fba85f5caafc4f 100644 --- a/src/system/SystemConfig.h +++ b/src/system/SystemConfig.h @@ -121,7 +121,7 @@ #error "FORBIDDEN: CHIP_SYSTEM_CONFIG_MULTICAST_HOMING CAN ONLY BE USED WITH SOCKET IMPL" #endif -#if CHIP_SYSTEM_CONFIG_MULTICAST_HOMING && CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__ +#if CHIP_SYSTEM_CONFIG_MULTICAST_HOMING && CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__) #error "FORBIDDEN: CHIP_SYSTEM_CONFIG_MULTICAST_HOMING WAS NOT TESTED WITH ZEPHYR" #endif @@ -639,7 +639,7 @@ struct LwIPEvent; * Defaults to enabled if the system is using sockets (except for Zephyr RTOS). */ #ifndef CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE -#if (CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK) && !__ZEPHYR__ && !__MBED__ +#if (CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK) && !defined(__ZEPHYR__) && !defined(__MBED__) #define CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE 1 #else #define CHIP_SYSTEM_CONFIG_USE_POSIX_PIPE 0 @@ -658,7 +658,7 @@ struct LwIPEvent; * Defaults to enabled on Zephyr platforms using sockets */ #ifndef CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__ +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__) #define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS 1 #else #define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKET_EXTENSIONS 0 @@ -679,7 +679,7 @@ struct LwIPEvent; * Defaults to enabled on Zephyr platforms using sockets */ #ifndef CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__ +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__) #define CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API 1 #else #define CHIP_SYSTEM_CONFIG_USE_PLATFORM_MULTICAST_API 0 @@ -695,7 +695,7 @@ struct LwIPEvent; * Defaults to enabled on Zephyr platforms using sockets */ #ifndef CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__ +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__) #define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF 1 #else #define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF 0 @@ -711,7 +711,7 @@ struct LwIPEvent; * Defaults to enabled on Unix/Linux platforms using sockets */ #ifndef CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS -#if (CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK) && !__ZEPHYR__ +#if (CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK) && !defined(__ZEPHYR__) #define CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS 1 #else #define CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS 0 @@ -727,7 +727,7 @@ struct LwIPEvent; * Defaults to enabled on Zephyr platforms that do not enable Zephyr POSIX layer. */ #ifndef CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKETS -#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && __ZEPHYR__ && CONFIG_NET_SOCKETS_POSIX_NAMES +#if CHIP_SYSTEM_CONFIG_USE_SOCKETS && defined(__ZEPHYR__) && CONFIG_NET_SOCKETS_POSIX_NAMES #define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKETS 1 #else #define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_SOCKETS 0 @@ -759,7 +759,7 @@ struct LwIPEvent; * Defaults to enabled on Zephyr platforms that enable CONFIG_EVENTFD. */ #ifndef CHIP_SYSTEM_CONFIG_USE_ZEPHYR_EVENTFD -#if __ZEPHYR__ && CONFIG_EVENTFD +#if defined(__ZEPHYR__) && CONFIG_EVENTFD #define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_EVENTFD 1 #else #define CHIP_SYSTEM_CONFIG_USE_ZEPHYR_EVENTFD 0 diff --git a/src/system/SystemError.h b/src/system/SystemError.h index 37abd6c0b2257a..5bc4b79d1ebf1e 100644 --- a/src/system/SystemError.h +++ b/src/system/SystemError.h @@ -59,7 +59,7 @@ extern const char * DescribeErrorPOSIX(CHIP_ERROR code); extern void RegisterPOSIXErrorFormatter(); extern bool FormatPOSIXError(char * buf, uint16_t bufSize, CHIP_ERROR err); -#if __ZEPHYR__ +#ifdef __ZEPHYR__ extern CHIP_ERROR MapErrorZephyr(int code); #endif // __ZEPHYR__ From ef5040a4d95f2ad3db3a9a5cbafc9afae55b0050 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Tue, 12 Sep 2023 16:18:51 +0200 Subject: [PATCH 065/134] =?UTF-8?q?[MatterYamlTests]=20null=20values=20tha?= =?UTF-8?q?t=20are=20saved=20are=20not=20substituted=20when=E2=80=A6=20(#2?= =?UTF-8?q?9107)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [MatterYamlTests] null values that are saved with saveAs are not substituted when the key used to saved them is used * Update darwin-framework-tool tests codegen * Add a new check in yaml_loader.py to ensure than the saveAs key is not the same as the attribute since this is a common mistake and it confuses the test suite that does not know if the attribute name should be replaced or not * Update various YAML files such that they do not save the result of a read attribute with the exact same name than the attribute itself --- .../matter_yamltests/errors.py | 12 + .../matter_yamltests/parser.py | 5 +- .../matter_yamltests/yaml_loader.py | 12 +- src/app/tests/suites/DL_Schedules.yaml | 62 +- .../tests/suites/DL_UsersAndCredentials.yaml | 36 +- .../tests/suites/TestColorControl_9_2.yaml | 10 +- src/app/tests/suites/TestSaveAs.yaml | 35 + .../suites/certification/Test_TC_ACL_2_3.yaml | 36 +- .../suites/certification/Test_TC_ACL_2_4.yaml | 160 ++-- .../suites/certification/Test_TC_ACL_2_5.yaml | 19 +- .../suites/certification/Test_TC_ACL_2_6.yaml | 14 +- .../suites/certification/Test_TC_ACL_2_9.yaml | 6 +- .../suites/certification/Test_TC_CC_8_1.yaml | 24 +- .../suites/certification/Test_TC_CC_9_2.yaml | 10 +- .../certification/Test_TC_CDOCONC_2_1.yaml | 18 +- .../certification/Test_TC_CMOCONC_2_1.yaml | 18 +- .../certification/Test_TC_DRLK_2_5.yaml | 4 +- .../certification/Test_TC_DRLK_2_6.yaml | 2 +- .../certification/Test_TC_DRLK_2_7.yaml | 8 +- .../certification/Test_TC_DRLK_2_9.yaml | 2 +- .../certification/Test_TC_FLDCONC_2_1.yaml | 18 +- .../suites/certification/Test_TC_ILL_2_2.yaml | 4 +- .../certification/Test_TC_NDOCONC_2_1.yaml | 18 +- .../certification/Test_TC_OZCONC_2_1.yaml | 18 +- .../certification/Test_TC_PMHCONC_2_1.yaml | 18 +- .../certification/Test_TC_PMICONC_2_1.yaml | 18 +- .../certification/Test_TC_PMKCONC_2_1.yaml | 18 +- .../suites/certification/Test_TC_PRS_2_1.yaml | 20 +- .../certification/Test_TC_RNCONC_2_1.yaml | 18 +- .../certification/Test_TC_TVOCCONC_2_1.yaml | 18 +- .../certification/Test_TC_WNCV_2_1.yaml | 16 +- .../zap-generated/test/Commands.h | 793 +++++++++++------- 32 files changed, 850 insertions(+), 620 deletions(-) diff --git a/scripts/py_matter_yamltests/matter_yamltests/errors.py b/scripts/py_matter_yamltests/matter_yamltests/errors.py index fb525bae6c8850..daa886573569c1 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/errors.py +++ b/scripts/py_matter_yamltests/matter_yamltests/errors.py @@ -210,3 +210,15 @@ def __init__(self, content): self.tag_key_with_error(content, 'command') arguments = content.get('arguments') self.tag_key_with_error(arguments, 'value') + + +class TestStepSaveAsNameError(TestStepError): + """Raise when a test step response save an attribute response with the same name than the attribute itself""" + + def __init__(self, content): + message = 'The "saveAs" key can not be the same than the "attribute" key' + super().__init__(message) + + self.tag_key_with_error(content, 'attribute') + response = content.get('response') + self.tag_key_with_error(response, 'saveAs') diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index d66584355ff175..18e643d97d5df5 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -1080,9 +1080,8 @@ def _config_variable_substitution(self, value): variable_info = self._runtime_config_variable_storage[token] if type(variable_info) is dict and 'defaultValue' in variable_info: variable_info = variable_info['defaultValue'] - if variable_info is not None: - tokens[idx] = variable_info - substitution_occured = True + tokens[idx] = variable_info + substitution_occured = True if len(tokens) == 1: return tokens[0] diff --git a/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py b/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py index 5f1352ced6d40e..d798ef5f06d99c 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py +++ b/scripts/py_matter_yamltests/matter_yamltests/yaml_loader.py @@ -17,7 +17,8 @@ from .errors import (TestStepArgumentsValueError, TestStepError, TestStepGroupEndPointError, TestStepGroupResponseError, TestStepInvalidTypeError, TestStepKeyError, TestStepNodeIdAndGroupIdError, TestStepResponseVariableError, - TestStepValueAndValuesError, TestStepVerificationStandaloneError, TestStepWaitResponseError) + TestStepSaveAsNameError, TestStepValueAndValuesError, TestStepVerificationStandaloneError, + TestStepWaitResponseError) from .fixes import add_yaml_support_for_scientific_notation_without_dot try: @@ -123,6 +124,7 @@ def __check_test_step(self, config: dict, content): self.__rule_wait_should_not_expect_a_response(content) self.__rule_response_variable_should_exist_in_config(config, content) self.__rule_argument_value_is_only_when_writing_attributes(content) + self.__rule_saveas_name_and_attribute_name_should_be_different(content) if 'arguments' in content: arguments = content.get('arguments') @@ -272,3 +274,11 @@ def __rule_argument_value_is_only_when_writing_attributes(self, content): arguments = content.get('arguments') if 'value' in arguments and operation != 'writeAttribute': raise TestStepArgumentsValueError(content) + + def __rule_saveas_name_and_attribute_name_should_be_different(self, content): + if content.get('command') == 'readAttribute' and 'response' in content: + attribute_name = content.get('attribute') + response = content.get('response') + if 'saveAs' in response: + if response.get('saveAs') == attribute_name: + raise TestStepSaveAsNameError(content) diff --git a/src/app/tests/suites/DL_Schedules.yaml b/src/app/tests/suites/DL_Schedules.yaml index 208600f4f65ec8..fedc9247daca26 100644 --- a/src/app/tests/suites/DL_Schedules.yaml +++ b/src/app/tests/suites/DL_Schedules.yaml @@ -58,7 +58,7 @@ tests: command: "readAttribute" attribute: "NumberOfTotalUsersSupported" response: - saveAs: NumberOfTotalUsersSupported + saveAs: NumberOfTotalUsersSupportedValue value: 10 - label: @@ -67,7 +67,7 @@ tests: command: "readAttribute" attribute: "NumberOfWeekDaySchedulesSupportedPerUser" response: - saveAs: NumberOfWeekDaySchedulesSupportedPerUser + saveAs: NumberOfWeekDaySchedulesSupportedPerUserValue value: 10 - label: @@ -76,14 +76,14 @@ tests: command: "readAttribute" attribute: "NumberOfYearDaySchedulesSupportedPerUser" response: - saveAs: NumberOfYearDaySchedulesSupportedPerUser + saveAs: NumberOfYearDaySchedulesSupportedPerUserValue value: 10 - label: "Get Max number of Holiday schedules and verify default value" command: "readAttribute" attribute: "NumberOfHolidaySchedulesSupported" response: - saveAs: NumberOfHolidaySchedulesSupported + saveAs: NumberOfHolidaySchedulesSupportedValue value: 10 # @@ -115,7 +115,7 @@ tests: arguments: values: - name: "WeekDayIndex" - value: NumberOfWeekDaySchedulesSupportedPerUser + 1 + value: NumberOfWeekDaySchedulesSupportedPerUserValue + 1 - name: "UserIndex" value: 1 - name: "DaysMask" @@ -159,7 +159,7 @@ tests: - name: "WeekDayIndex" value: 1 - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 - name: "DaysMask" value: 0x01 - name: "StartHour" @@ -427,13 +427,13 @@ tests: arguments: values: - name: "WeekDayIndex" - value: NumberOfWeekDaySchedulesSupportedPerUser + 1 + value: NumberOfWeekDaySchedulesSupportedPerUserValue + 1 - name: "UserIndex" value: 1 response: values: - name: "WeekDayIndex" - value: NumberOfWeekDaySchedulesSupportedPerUser + 1 + value: NumberOfWeekDaySchedulesSupportedPerUserValue + 1 - name: "UserIndex" value: 1 - name: "Status" @@ -463,13 +463,13 @@ tests: - name: "WeekDayIndex" value: 1 - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 response: values: - name: "WeekDayIndex" value: 1 - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 - name: "Status" value: 0x85 @@ -513,7 +513,7 @@ tests: arguments: values: - name: "YearDayIndex" - value: NumberOfYearDaySchedulesSupportedPerUser + 1 + value: NumberOfYearDaySchedulesSupportedPerUserValue + 1 - name: "UserIndex" value: 1 - name: "LocalStartTime" @@ -545,7 +545,7 @@ tests: - name: "YearDayIndex" value: 1 - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 - name: "LocalStartTime" value: 12345 - name: "LocalEndTime" @@ -625,13 +625,13 @@ tests: arguments: values: - name: "YearDayIndex" - value: NumberOfYearDaySchedulesSupportedPerUser + 1 + value: NumberOfYearDaySchedulesSupportedPerUserValue + 1 - name: "UserIndex" value: 1 response: values: - name: "YearDayIndex" - value: NumberOfYearDaySchedulesSupportedPerUser + 1 + value: NumberOfYearDaySchedulesSupportedPerUserValue + 1 - name: "UserIndex" value: 1 - name: "Status" @@ -661,13 +661,13 @@ tests: - name: "YearDayIndex" value: 1 - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 response: values: - name: "YearDayIndex" value: 1 - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 - name: "Status" value: 0x85 @@ -711,7 +711,7 @@ tests: arguments: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + 1 + value: NumberOfHolidaySchedulesSupportedValue + 1 - name: "LocalStartTime" value: 12345 - name: "LocalEndTime" @@ -785,11 +785,11 @@ tests: arguments: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + 1 + value: NumberOfHolidaySchedulesSupportedValue + 1 response: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + 1 + value: NumberOfHolidaySchedulesSupportedValue + 1 - name: "Status" value: 0x85 @@ -925,7 +925,7 @@ tests: arguments: values: - name: "WeekDayIndex" - value: NumberOfWeekDaySchedulesSupportedPerUser + 1 + value: NumberOfWeekDaySchedulesSupportedPerUserValue + 1 - name: "UserIndex" value: 1 response: @@ -949,7 +949,7 @@ tests: - name: "WeekDayIndex" value: 1 - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 response: error: INVALID_COMMAND @@ -1050,7 +1050,7 @@ tests: arguments: values: - name: "YearDayIndex" - value: NumberOfYearDaySchedulesSupportedPerUser + 1 + value: NumberOfYearDaySchedulesSupportedPerUserValue + 1 - name: "UserIndex" value: 1 response: @@ -1074,7 +1074,7 @@ tests: - name: "YearDayIndex" value: 1 - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 response: error: INVALID_COMMAND @@ -1171,7 +1171,7 @@ tests: arguments: values: - name: "HolidayIndex" - value: NumberOfYearDaySchedulesSupportedPerUser + 1 + value: NumberOfYearDaySchedulesSupportedPerUserValue + 1 response: error: INVALID_COMMAND @@ -1896,7 +1896,7 @@ tests: arguments: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + value: NumberOfHolidaySchedulesSupportedValue - name: "LocalStartTime" value: 1 - name: "LocalEndTime" @@ -1909,11 +1909,11 @@ tests: arguments: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + value: NumberOfHolidaySchedulesSupportedValue response: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + value: NumberOfHolidaySchedulesSupportedValue - name: "Status" value: 0x0 - name: "LocalStartTime" @@ -2027,11 +2027,11 @@ tests: arguments: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + value: NumberOfHolidaySchedulesSupportedValue response: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + value: NumberOfHolidaySchedulesSupportedValue - name: "Status" value: 0x0 - name: "LocalStartTime" @@ -2129,11 +2129,11 @@ tests: arguments: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + value: NumberOfHolidaySchedulesSupportedValue response: values: - name: "HolidayIndex" - value: NumberOfHolidaySchedulesSupported + value: NumberOfHolidaySchedulesSupportedValue - name: "Status" value: 0x8B diff --git a/src/app/tests/suites/DL_UsersAndCredentials.yaml b/src/app/tests/suites/DL_UsersAndCredentials.yaml index d62a8291181084..0a344d4883eba6 100644 --- a/src/app/tests/suites/DL_UsersAndCredentials.yaml +++ b/src/app/tests/suites/DL_UsersAndCredentials.yaml @@ -61,7 +61,7 @@ tests: command: "readAttribute" attribute: "NumberOfTotalUsersSupported" response: - saveAs: NumberOfTotalUsersSupported + saveAs: NumberOfTotalUsersSupportedValue value: 10 - label: "Read fails for user with index 0" @@ -79,7 +79,7 @@ tests: arguments: values: - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 response: error: INVALID_COMMAND @@ -656,7 +656,7 @@ tests: - name: "OperationType" value: 0 - name: "UserIndex" - value: NumberOfTotalUsersSupported + value: NumberOfTotalUsersSupportedValue - name: "UserName" value: "last_user" - name: "UserUniqueID" @@ -673,11 +673,11 @@ tests: arguments: values: - name: "UserIndex" - value: NumberOfTotalUsersSupported + value: NumberOfTotalUsersSupportedValue response: values: - name: "UserIndex" - value: NumberOfTotalUsersSupported + value: NumberOfTotalUsersSupportedValue - name: "UserName" value: "last_user" - name: "UserUniqueID" @@ -727,7 +727,7 @@ tests: - name: "OperationType" value: 0 - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 - name: "UserName" value: null - name: "UserUniqueID" @@ -844,7 +844,7 @@ tests: arguments: values: - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 response: error: INVALID_COMMAND @@ -890,11 +890,11 @@ tests: arguments: values: - name: "UserIndex" - value: NumberOfTotalUsersSupported + value: NumberOfTotalUsersSupportedValue response: values: - name: "UserIndex" - value: NumberOfTotalUsersSupported + value: NumberOfTotalUsersSupportedValue - name: "UserName" value: null - name: "UserUniqueID" @@ -922,7 +922,7 @@ tests: command: "readAttribute" attribute: "NumberOfPINUsersSupported" response: - saveAs: NumberOfPINUsersSupported + saveAs: NumberOfPINUsersSupportedValue value: 10 - label: "Check that PIN credential does not exist" @@ -972,7 +972,7 @@ tests: value: { CredentialType: 1, - CredentialIndex: NumberOfPINUsersSupported + 1, + CredentialIndex: NumberOfPINUsersSupportedValue + 1, } response: values: @@ -1154,7 +1154,7 @@ tests: value: { CredentialType: 1, - CredentialIndex: NumberOfPINUsersSupported + 1, + CredentialIndex: NumberOfPINUsersSupportedValue + 1, } - name: "CredentialData" value: "123456" @@ -1177,7 +1177,7 @@ tests: command: "readAttribute" attribute: "NumberOfRFIDUsersSupported" response: - saveAs: NumberOfRFIDUsersSupported + saveAs: NumberOfRFIDUsersSupportedValue value: 10 - label: "Reading RFID credential with index 0 returns no credential" @@ -1209,7 +1209,7 @@ tests: value: { CredentialType: 2, - CredentialIndex: NumberOfRFIDUsersSupported + 1, + CredentialIndex: NumberOfRFIDUsersSupportedValue + 1, } response: values: @@ -1443,7 +1443,7 @@ tests: value: { CredentialType: 2, - CredentialIndex: NumberOfRFIDUsersSupported + 1, + CredentialIndex: NumberOfRFIDUsersSupportedValue + 1, } - name: "CredentialData" value: "new_rfid_data_field" @@ -1500,7 +1500,7 @@ tests: - name: "CredentialData" value: "123465" - name: "UserIndex" - value: NumberOfTotalUsersSupported + 1 + value: NumberOfTotalUsersSupportedValue + 1 - name: "UserStatus" value: null - name: "UserType" @@ -2692,7 +2692,7 @@ tests: value: { CredentialType: 1, - CredentialIndex: NumberOfPINUsersSupported + 1, + CredentialIndex: NumberOfPINUsersSupportedValue + 1, } response: error: INVALID_COMMAND @@ -2716,7 +2716,7 @@ tests: value: { CredentialType: 2, - CredentialIndex: NumberOfRFIDUsersSupported + 1, + CredentialIndex: NumberOfRFIDUsersSupportedValue + 1, } response: error: INVALID_COMMAND diff --git a/src/app/tests/suites/TestColorControl_9_2.yaml b/src/app/tests/suites/TestColorControl_9_2.yaml index 21e501ced547a9..0d41650935001c 100644 --- a/src/app/tests/suites/TestColorControl_9_2.yaml +++ b/src/app/tests/suites/TestColorControl_9_2.yaml @@ -233,7 +233,7 @@ tests: command: "readAttribute" attribute: "ColorLoopStartEnhancedHue" response: - saveAs: ColorLoopStartEnhancedHue + saveAs: ColorLoopStartEnhancedHueValue2 - label: "Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -241,7 +241,7 @@ tests: response: constraints: type: int16u - minValue: ColorLoopStartEnhancedHue + minValue: ColorLoopStartEnhancedHueValue2 maxValue: 65535 - label: "Wait for 5S" @@ -258,7 +258,7 @@ tests: response: constraints: type: int16u - minValue: ColorLoopStartEnhancedHue + minValue: ColorLoopStartEnhancedHueValue2 maxValue: 65535 - label: @@ -294,13 +294,13 @@ tests: command: "readAttribute" attribute: "ColorLoopStoredEnhancedHue" response: - saveAs: ColorLoopStoredEnhancedHueValue + saveAs: ColorLoopStoredEnhancedHueValue3 - label: "Read EnhancedCurrentHue attribute from DUT." command: "readAttribute" attribute: "EnhancedCurrentHue" response: - value: ColorLoopStoredEnhancedHueValue + value: ColorLoopStoredEnhancedHueValue3 - label: "Turn off light for color control tests" cluster: "On/Off" diff --git a/src/app/tests/suites/TestSaveAs.yaml b/src/app/tests/suites/TestSaveAs.yaml index 47a648a4f384ea..de46bb85caec79 100644 --- a/src/app/tests/suites/TestSaveAs.yaml +++ b/src/app/tests/suites/TestSaveAs.yaml @@ -802,3 +802,38 @@ tests: attribute: "octet_string" arguments: value: readAttributeOctetStringDefaultValue + + # Tests for null values + - label: "Read attribute nullable_boolean Default Value" + command: "readAttribute" + attribute: "nullable_boolean" + response: + saveAs: readAttributeNullableBooleanDefaultValue + value: false + + - label: "Write attribute nullable_boolean to null" + command: "writeAttribute" + attribute: "nullable_boolean" + arguments: + value: null + + - label: "Read attribute nullable_boolean null Value" + command: "readAttribute" + attribute: "nullable_boolean" + response: + saveAs: readAttributeNullableBooleanNullValue + value: null + + - label: + "Read attribute nullable_boolean null Value again and compare it to + the previously saved value" + command: "readAttribute" + attribute: "nullable_boolean" + response: + value: readAttributeNullableBooleanNullValue + + - label: "Write attribute nullable_boolean Default Value" + command: "writeAttribute" + attribute: "nullable_boolean" + arguments: + value: readAttributeNullableBooleanDefaultValue diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml index 68dacd47324ba1..af287a4fa97869 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_3.yaml @@ -69,7 +69,7 @@ tests: command: "readAttribute" attribute: "CurrentFabricIndex" response: - saveAs: CurrentFabricIndex + saveAs: CurrentFabricIndexValue - label: "Step 3: TH1 reads DUT Endpoint 0 AccessControl cluster Extension @@ -88,7 +88,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndexValue }] - label: "Step 5: TH1 reads DUT Endpoint 0 AccessControl cluster Extension @@ -97,7 +97,7 @@ tests: command: "readAttribute" attribute: "Extension" response: - value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndexValue }] - label: "Step 6: TH1 writes DUT Endpoint 0 AccessControl cluster Extension @@ -108,7 +108,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndexValue }] - label: "Step 7: TH1 reads DUT Endpoint 0 AccessControl cluster Extension @@ -117,7 +117,7 @@ tests: command: "readAttribute" attribute: "Extension" response: - value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndexValue }] - label: "Step 8: TH1 writes DUT Endpoint 0 AccessControl cluster Extension @@ -128,7 +128,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_OK_FULL, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_OK_FULL, FabricIndex: CurrentFabricIndexValue }] - label: "Step 9: TH1 reads DUT Endpoint 0 AccessControl cluster Extension @@ -137,7 +137,7 @@ tests: command: "readAttribute" attribute: "Extension" response: - value: [{ Data: D_OK_FULL, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_OK_FULL, FabricIndex: CurrentFabricIndexValue }] - label: "Step 10: TH1 writes DUT Endpoint 0 AccessControl cluster Extension @@ -148,7 +148,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_BAD_LENGTH, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_BAD_LENGTH, FabricIndex: CurrentFabricIndexValue }] response: error: CONSTRAINT_ERROR @@ -160,7 +160,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_BAD_STRUCT, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_BAD_STRUCT, FabricIndex: CurrentFabricIndexValue }] response: error: CONSTRAINT_ERROR @@ -173,7 +173,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_BAD_LIST, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_BAD_LIST, FabricIndex: CurrentFabricIndexValue }] response: error: CONSTRAINT_ERROR @@ -186,7 +186,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_BAD_ELEM, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_BAD_ELEM, FabricIndex: CurrentFabricIndexValue }] response: error: CONSTRAINT_ERROR @@ -199,7 +199,8 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_BAD_OVERFLOW, FabricIndex: CurrentFabricIndex }] + value: + [{ Data: D_BAD_OVERFLOW, FabricIndex: CurrentFabricIndexValue }] response: error: CONSTRAINT_ERROR @@ -212,7 +213,8 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_BAD_UNDERFLOW, FabricIndex: CurrentFabricIndex }] + value: + [{ Data: D_BAD_UNDERFLOW, FabricIndex: CurrentFabricIndexValue }] response: error: CONSTRAINT_ERROR @@ -224,7 +226,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_BAD_NONE, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_BAD_NONE, FabricIndex: CurrentFabricIndexValue }] response: error: CONSTRAINT_ERROR @@ -241,8 +243,8 @@ tests: arguments: value: [ - { Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }, - { Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }, + { Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndexValue }, + { Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndexValue }, ] response: error: CONSTRAINT_ERROR @@ -254,7 +256,7 @@ tests: command: "readAttribute" attribute: "Extension" response: - value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndexValue }] - label: "Step 19: TH1 writes DUT Endpoint 0 AccessControl cluster Extension diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_4.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_4.yaml index ac498dc6ff9d8a..c08bba0b65f47f 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_4.yaml @@ -59,7 +59,7 @@ tests: cluster: "Operational Credentials" attribute: "CurrentFabricIndex" response: - saveAs: CurrentFabricIndex + saveAs: CurrentFabricIndexValue - label: "Step 3:TH1 reads DUT Endpoint 0 AccessControl cluster ACL attribute" @@ -74,7 +74,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -98,7 +98,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 1, @@ -106,7 +106,7 @@ tests: Subjects: [111, 222, 333, 444], Targets: [{ Cluster: 11, Endpoint: 22, DeviceType: null }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -114,7 +114,7 @@ tests: Subjects: [555, 666, 777, 888], Targets: [{ Cluster: 55, Endpoint: 66, DeviceType: null }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -131,7 +131,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 1, @@ -139,7 +139,7 @@ tests: Subjects: [111, 222, 333, 444], Targets: [{ Cluster: 11, Endpoint: 22, DeviceType: null }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -147,7 +147,7 @@ tests: Subjects: [555, 666, 777, 888], Targets: [{ Cluster: 55, Endpoint: 66, DeviceType: null }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -171,7 +171,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 4, @@ -179,7 +179,7 @@ tests: Subjects: [444, 333, 222, 111], Targets: [{ Cluster: 44, Endpoint: 33, DeviceType: null }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 5, @@ -187,7 +187,7 @@ tests: Subjects: [888, 777, 666, 555], Targets: [{ Cluster: 88, Endpoint: 77, DeviceType: null }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -204,7 +204,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 4, @@ -212,7 +212,7 @@ tests: Subjects: [444, 333, 222, 111], Targets: [{ Cluster: 44, Endpoint: 33, DeviceType: null }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 5, @@ -220,7 +220,7 @@ tests: Subjects: [888, 777, 666, 555], Targets: [{ Cluster: 88, Endpoint: 77, DeviceType: null }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -245,7 +245,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 1, @@ -256,7 +256,7 @@ tests: { Cluster: 11, Endpoint: 22, DeviceType: null }, { Cluster: 33, Endpoint: null, DeviceType: 44 }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -267,7 +267,7 @@ tests: { Cluster: 55, Endpoint: 66, DeviceType: null }, { Cluster: 77, Endpoint: null, DeviceType: 88 }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -283,7 +283,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 1, @@ -294,7 +294,7 @@ tests: { Cluster: 11, Endpoint: 22, DeviceType: null }, { Cluster: 33, Endpoint: null, DeviceType: 44 }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -305,7 +305,7 @@ tests: { Cluster: 55, Endpoint: 66, DeviceType: null }, { Cluster: 77, Endpoint: null, DeviceType: 88 }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -330,7 +330,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 1, @@ -341,7 +341,7 @@ tests: { Cluster: 11, Endpoint: 22, DeviceType: null }, { Cluster: 33, Endpoint: null, DeviceType: 44 }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -352,7 +352,7 @@ tests: { Cluster: 55, Endpoint: 66, DeviceType: null }, { Cluster: 77, Endpoint: null, DeviceType: 88 }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -368,7 +368,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 1, @@ -379,7 +379,7 @@ tests: { Cluster: 11, Endpoint: 22, DeviceType: null }, { Cluster: 33, Endpoint: null, DeviceType: 44 }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -390,7 +390,7 @@ tests: { Cluster: 55, Endpoint: 66, DeviceType: null }, { Cluster: 77, Endpoint: null, DeviceType: 88 }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -414,21 +414,21 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 1, AuthMode: 2, Subjects: [111, 222, 333, 444], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 3, Subjects: [555, 666, 777, 888], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -444,21 +444,21 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 1, AuthMode: 2, Subjects: [111, 222, 333, 444], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 3, Subjects: [555, 666, 777, 888], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -480,14 +480,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 3, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -503,14 +503,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 3, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -532,14 +532,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 2, AuthMode: 2, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -555,14 +555,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 2, AuthMode: 2, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -719,14 +719,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: [CAT1, CAT2, CAT3, CAT4], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -742,14 +742,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: [CAT1, CAT2, CAT3, CAT4], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -760,7 +760,7 @@ tests: command: "readAttribute" attribute: "TargetsPerAccessControlEntry" response: - saveAs: TargetsPerAccessControlEntry + saveAs: TargetsPerAccessControlEntryValue #Need if support : https://github.com/project-chip/connectedhomeip/issues/16719 - label: @@ -926,21 +926,21 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -956,21 +956,21 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -992,14 +992,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 1, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1017,7 +1017,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -1039,14 +1039,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 5, AuthMode: 3, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1070,14 +1070,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: "6", AuthMode: 3, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1097,14 +1097,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: "6", AuthMode: "4", Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1124,14 +1124,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: [0], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1155,14 +1155,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: ["18446744073709551615"], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1186,14 +1186,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: ["18446744060824649728"], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1217,14 +1217,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: ["18446744073709486080"], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1248,7 +1248,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -1256,7 +1256,7 @@ tests: Subjects: null, Targets: [{ Cluster: null, Endpoint: null, DeviceType: null }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1280,7 +1280,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -1294,7 +1294,7 @@ tests: DeviceType: null, }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1318,7 +1318,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -1332,7 +1332,7 @@ tests: DeviceType: null, }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1356,7 +1356,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -1370,7 +1370,7 @@ tests: DeviceType: 4294967295, }, ], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1394,7 +1394,7 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, @@ -1402,7 +1402,7 @@ tests: Subjects: null, Targets: [{ Cluster: null, Endpoint: 22, DeviceType: 33 }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: @@ -1426,14 +1426,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 2, Subjects: null, Targets: [{ Cluster: 11, Endpoint: 22, DeviceType: 33 }], - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml index cc97538d2a3678..bc2a1b7ddb315c 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml @@ -56,7 +56,7 @@ tests: cluster: "Operational Credentials" attribute: "CurrentFabricIndex" response: - saveAs: CurrentFabricIndex + saveAs: CurrentFabricIndexValue #Issue: https://github.com/project-chip/connectedhomeip/issues/24081 - label: @@ -94,7 +94,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndexValue }] - label: "Step 5: TH reads DUT Endpoint 0 AccessControl cluster @@ -109,8 +109,11 @@ tests: AdminPasscodeID: null, ChangeType: 1, LatestValue: - { Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }, - FabricIndex: CurrentFabricIndex, + { + Data: D_OK_EMPTY, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, } - label: @@ -121,7 +124,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndexValue }] #Issue: https://github.com/project-chip/connectedhomeip/issues/24149 - label: @@ -178,7 +181,7 @@ tests: command: "writeAttribute" attribute: "Extension" arguments: - value: [{ Data: D_BAD_LENGTH, FabricIndex: CurrentFabricIndex }] + value: [{ Data: D_BAD_LENGTH, FabricIndex: CurrentFabricIndexValue }] response: error: CONSTRAINT_ERROR @@ -224,8 +227,8 @@ tests: arguments: value: [ - { Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndex }, - { Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndex }, + { Data: D_OK_EMPTY, FabricIndex: CurrentFabricIndexValue }, + { Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndexValue }, ] response: error: CONSTRAINT_ERROR diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml index 5cb8e02110db3a..942fd2f97f82c2 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml @@ -46,7 +46,7 @@ tests: cluster: "Operational Credentials" attribute: "CurrentFabricIndex" response: - saveAs: CurrentFabricIndex + saveAs: CurrentFabricIndexValue - label: "Step 3: TH reads DUT Endpoint 0 AccessControl cluster @@ -66,9 +66,9 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, } - label: @@ -89,14 +89,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 3, Subjects: null, Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -210,14 +210,14 @@ tests: AuthMode: 2, Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, { Privilege: 3, AuthMode: 3, Subjects: [0], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_9.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_9.yaml index 1789e7091b8d52..6b8e1d507b5bfd 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_9.yaml @@ -52,7 +52,7 @@ tests: cluster: "Operational Credentials" attribute: "CurrentFabricIndex" response: - saveAs: CurrentFabricIndex + saveAs: CurrentFabricIndexValue - label: "Step 2:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute" @@ -67,7 +67,7 @@ tests: AuthMode: "2", Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] @@ -92,7 +92,7 @@ tests: AuthMode: "2", Subjects: [CommissionerNodeId], Targets: null, - FabricIndex: CurrentFabricIndex, + FabricIndex: CurrentFabricIndexValue, }, ] response: diff --git a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml index 2492c644355dfc..4406b0a35b6a98 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_8_1.yaml @@ -218,7 +218,7 @@ tests: command: "readAttribute" attribute: "ColorTempPhysicalMinMireds" response: - saveAs: ColorTempPhysicalMinMireds + saveAs: ColorTempPhysicalMinMiredsValue constraints: type: int16u minValue: 0 @@ -229,7 +229,7 @@ tests: command: "readAttribute" attribute: "ColorTempPhysicalMaxMireds" response: - saveAs: ColorTempPhysicalMaxMireds + saveAs: ColorTempPhysicalMaxMiredsValue constraints: type: int16u minValue: 0 @@ -245,8 +245,8 @@ tests: values: - name: "ColorTemperatureMireds" value: - ( ColorTempPhysicalMinMireds + ColorTempPhysicalMaxMireds ) - / 2 + ( ColorTempPhysicalMinMiredsValue + + ColorTempPhysicalMaxMiredsValue ) / 2 - name: "TransitionTime" value: 0 - name: "OptionsMask" @@ -274,12 +274,12 @@ tests: value: 1 - name: "Rate" value: - ( ColorTempPhysicalMaxMireds - ColorTempPhysicalMinMireds ) - / 40 + ( ColorTempPhysicalMaxMiredsValue - + ColorTempPhysicalMinMiredsValue ) / 40 - name: "ColorTemperatureMinimumMireds" - value: ColorTempPhysicalMinMireds + value: ColorTempPhysicalMinMiredsValue - name: "ColorTemperatureMaximumMireds" - value: ColorTempPhysicalMaxMireds + value: ColorTempPhysicalMaxMiredsValue - name: "OptionsMask" value: 0 - name: "OptionsOverride" @@ -309,8 +309,8 @@ tests: attribute: "ColorTemperatureMireds" response: constraints: - minValue: ColorTempPhysicalMinMireds - maxValue: ColorTempPhysicalMaxMireds + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTempPhysicalMaxMiredsValue - label: "Wait 2s" cluster: "DelayCommands" @@ -326,8 +326,8 @@ tests: attribute: "ColorTemperatureMireds" response: constraints: - minValue: ColorTempPhysicalMinMireds - maxValue: ColorTempPhysicalMaxMireds + minValue: ColorTempPhysicalMinMiredsValue + maxValue: ColorTempPhysicalMaxMiredsValue - label: "Step 5a: TH sends EnhancedMoveToHue command to DUT with diff --git a/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml b/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml index c4cbef954db9c5..959804e2a8e11c 100644 --- a/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_CC_9_2.yaml @@ -255,7 +255,7 @@ tests: attribute: "ColorLoopStartEnhancedHue" PICS: CC.S.F01 && CC.S.F02 && CC.S.A4005 && CC.S.C44.Rsp response: - saveAs: ColorLoopStartEnhancedHue + saveAs: ColorLoopStartEnhancedHueValue2 - label: "Step 3c: Read EnhancedCurrentHue attribute from DUT" command: "readAttribute" @@ -264,7 +264,7 @@ tests: response: constraints: type: int16u - minValue: ColorLoopStartEnhancedHue + minValue: ColorLoopStartEnhancedHueValue2 maxValue: 65535 - label: "Wait for 30S" @@ -283,7 +283,7 @@ tests: response: constraints: type: int16u - minValue: ColorLoopStartEnhancedHue + minValue: ColorLoopStartEnhancedHueValue2 maxValue: 65535 - label: @@ -323,14 +323,14 @@ tests: PICS: CC.S.F01 && CC.S.F02 && CC.S.A4006 && CC.S.C44.Rsp attribute: "ColorLoopStoredEnhancedHue" response: - saveAs: ColorLoopStoredEnhancedHueValue + saveAs: ColorLoopStoredEnhancedHueValue3 - label: "Step 4c: Read EnhancedCurrentHue attribute from DUT." command: "readAttribute" attribute: "EnhancedCurrentHue" PICS: CC.S.F01 && CC.S.F02 && CC.S.A4000 && CC.S.C44.Rsp response: - value: ColorLoopStoredEnhancedHueValue + value: ColorLoopStoredEnhancedHueValue3 - label: "Turn off light for color control tests" PICS: OO.S.C00.Rsp diff --git a/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml index 82a2a7b622e566..aefd4aeb36e961 100644 --- a/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CDOCONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: CDOCONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: CDOCONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml index 62de23eda9c0c4..9d1ab7f333031e 100644 --- a/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_CMOCONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: CMOCONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: CMOCONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml index 782824c8de5caf..dc14b7b47be313 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_5.yaml @@ -89,7 +89,7 @@ tests: command: "readAttribute" attribute: "NumberOfWeekDaySchedulesSupportedPerUser" response: - saveAs: NumberOfWeekDaySchedulesSupportedPerUser + saveAs: NumberOfWeekDaySchedulesSupportedPerUserValue constraints: minValue: 0 maxValue: 255 @@ -99,7 +99,7 @@ tests: command: "readAttribute" attribute: "NumberOfTotalUsersSupported" response: - saveAs: NumberOfTotalUsersSupported + saveAs: NumberOfTotalUsersSupportedValue constraints: minValue: 0 maxValue: 65534 diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml index 739bcd33a304b4..c52167942223ff 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_6.yaml @@ -41,7 +41,7 @@ tests: command: "readAttribute" attribute: "NumberOfHolidaySchedulesSupported" response: - saveAs: NumberOfHolidaySchedulesSupported + saveAs: NumberOfHolidaySchedulesSupportedValue constraints: minValue: 0 maxValue: 255 diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml index 0db99395e20ea8..86dcd163375afc 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_7.yaml @@ -89,7 +89,7 @@ tests: command: "readAttribute" attribute: "NumberOfYearDaySchedulesSupportedPerUser" response: - saveAs: NumberOfYearDaySchedulesSupportedPerUser + saveAs: NumberOfYearDaySchedulesSupportedPerUserValue constraints: minValue: 0 maxValue: 255 @@ -99,7 +99,7 @@ tests: command: "readAttribute" attribute: "NumberOfTotalUsersSupported" response: - saveAs: NumberOfTotalUsersSupported + saveAs: NumberOfTotalUsersSupportedValue constraints: minValue: 0 maxValue: 65534 @@ -208,13 +208,13 @@ tests: arguments: values: - name: "YearDayIndex" - value: NumberOfYearDaySchedulesSupportedPerUser + value: NumberOfYearDaySchedulesSupportedPerUserValue - name: "UserIndex" value: 5 response: values: - name: "YearDayIndex" - value: NumberOfYearDaySchedulesSupportedPerUser + value: NumberOfYearDaySchedulesSupportedPerUserValue - name: "UserIndex" value: 5 - name: "Status" diff --git a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml index e1169d4acd1aeb..fa960d570a0e47 100644 --- a/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml +++ b/src/app/tests/suites/certification/Test_TC_DRLK_2_9.yaml @@ -90,7 +90,7 @@ tests: command: "readAttribute" attribute: "NumberOfTotalUsersSupported" response: - saveAs: NumberOfTotalUsersSupported + saveAs: NumberOfTotalUsersSupportedValue constraints: minValue: 0 maxValue: 65534 diff --git a/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml index 2c9c2b78c55f0b..fa75195dd33fff 100644 --- a/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_FLDCONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: FLDCONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: FLDCONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_ILL_2_2.yaml b/src/app/tests/suites/certification/Test_TC_ILL_2_2.yaml index 47c85f44d9a19e..b7817bf216284a 100644 --- a/src/app/tests/suites/certification/Test_TC_ILL_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_ILL_2_2.yaml @@ -37,7 +37,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: int16u @@ -46,7 +46,7 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: int16u diff --git a/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml index c98982da5b8b8b..145610ca5ff950 100644 --- a/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_NDOCONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: NDOCONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: NDOCONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml index d68496691ab4c6..d1cf7f692e555a 100644 --- a/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_OZCONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: OZCONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: OZCONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml index 02160146954a5a..2e673e96a6899c 100644 --- a/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PMHCONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: PMHCONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: PMHCONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml index 3488c29bd75cb7..f1692efb0443e2 100644 --- a/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PMICONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: PMICONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: PMICONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml index 848c3ae27ec5a4..1045a64fada66c 100644 --- a/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PMKCONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: PMKCONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: PMKCONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml b/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml index 1f5b8a86e00e1e..e025d856390ec3 100644 --- a/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_PRS_2_1.yaml @@ -37,7 +37,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: int16s minValue: -32767 @@ -49,10 +49,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: int16s - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue maxValue: 32767 - label: "Step 4: Read the mandatory attribute constraints: MeasuredValue" @@ -62,8 +62,8 @@ tests: response: constraints: type: int16s - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: Read the optional attribute: Tolerance" PICS: PRS.S.A0003 @@ -80,7 +80,7 @@ tests: command: "readAttribute" attribute: "MinScaledValue" response: - saveAs: MinScaledValue + saveAs: MinScaledValueValue constraints: type: int16s minValue: -32767 @@ -91,10 +91,10 @@ tests: command: "readAttribute" attribute: "MaxScaledValue" response: - saveAs: MaxScaledValue + saveAs: MaxScaledValueValue constraints: type: int16s - minValue: MinScaledValue + minValue: MinScaledValueValue maxValue: 32767 - label: "Step 8: Read the optional attribute: ScaledValue" @@ -104,8 +104,8 @@ tests: response: constraints: type: int16s - minValue: MinScaledValue - maxValue: MaxScaledValue + minValue: MinScaledValueValue + maxValue: MaxScaledValueValue - label: "Step 9: Read the optional attribute: ScaledTolerance" PICS: PRS.S.A0013 diff --git a/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml index d8fea0cad57baa..fe2a4adebcfae9 100644 --- a/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_RNCONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: RNCONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: RNCONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml index 9fa0181973521d..578b12c8de855d 100644 --- a/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TVOCCONC_2_1.yaml @@ -36,7 +36,7 @@ tests: command: "readAttribute" attribute: "MinMeasuredValue" response: - saveAs: MinMeasuredValue + saveAs: MinMeasuredValueValue constraints: type: single minValue: 0 @@ -46,10 +46,10 @@ tests: command: "readAttribute" attribute: "MaxMeasuredValue" response: - saveAs: MaxMeasuredValue + saveAs: MaxMeasuredValueValue constraints: type: single - minValue: MinMeasuredValue + minValue: MinMeasuredValueValue - label: "Step 4: TH reads from the DUT the MeasuredValue attribute." PICS: TVOCCONC.S.A0000 @@ -58,8 +58,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 5: TH reads from the DUT the PeakMeasuredValue attribute." PICS: TVOCCONC.S.A0003 @@ -68,8 +68,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 6: TH reads from the DUT the PeakMeasuredValueWindow attribute." @@ -89,8 +89,8 @@ tests: response: constraints: type: single - minValue: MinMeasuredValue - maxValue: MaxMeasuredValue + minValue: MinMeasuredValueValue + maxValue: MaxMeasuredValueValue - label: "Step 8: TH reads from the DUT the AverageMeasuredValueWindow diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_2_1.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_2_1.yaml index d309d65f99a496..6c273f2fb46af0 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_2_1.yaml @@ -159,7 +159,7 @@ tests: attribute: "InstalledOpenLimitLift" PICS: WNCV.S.A0010 response: - saveAs: InstalledOpenLimitLift + saveAs: InstalledOpenLimitLiftValue constraints: type: int16u minValue: 0 @@ -173,7 +173,7 @@ tests: attribute: "InstalledClosedLimitLift" PICS: WNCV.S.A0011 response: - saveAs: InstalledClosedLimitLift + saveAs: InstalledClosedLimitLiftValue constraints: type: int16u minValue: 0 @@ -187,7 +187,7 @@ tests: attribute: "InstalledOpenLimitTilt" PICS: WNCV.S.A0012 response: - saveAs: InstalledOpenLimitTilt + saveAs: InstalledOpenLimitTiltValue constraints: type: int16u minValue: 0 @@ -201,7 +201,7 @@ tests: attribute: "InstalledClosedLimitTilt" PICS: WNCV.S.A0013 response: - saveAs: InstalledClosedLimitTilt + saveAs: InstalledClosedLimitTiltValue constraints: type: int16u minValue: 0 @@ -266,8 +266,8 @@ tests: response: constraints: type: int16u - minValue: InstalledOpenLimitLift - maxValue: InstalledClosedLimitLift + minValue: InstalledOpenLimitLiftValue + maxValue: InstalledClosedLimitLiftValue ### Attribute[ 4]: CurrentPositionTilt ==================== - label: @@ -290,8 +290,8 @@ tests: response: constraints: type: int16u - minValue: InstalledOpenLimitTilt - maxValue: InstalledClosedLimitTilt + minValue: InstalledOpenLimitTiltValue + maxValue: InstalledClosedLimitTiltValue ### Attribute[ 5]: NumberOfActuationsLift ==================== - label: diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index c3b182ff614a02..1f549307744223 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -3353,7 +3353,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nonnull CurrentFabricIndex; + NSNumber * _Nonnull CurrentFabricIndexValue; CHIP_ERROR TestStep2Th1ReadsDutEndpoint0OperationalCredentialsClusterCurrentFabricIndexAttribute_1() { @@ -3370,7 +3370,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - CurrentFabricIndex = value; + CurrentFabricIndexValue = value; } NextTest(); @@ -3422,7 +3422,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).data = mDOkEmpty.HasValue() ? [NSData dataWithBytes:mDOkEmpty.Value().data() length:mDOkEmpty.Value().size()] : [[NSData alloc] initWithBytes:"\x17\x18" length:2]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3470,7 +3470,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { )); VerifyOrReturn(CheckValue("FabricIndex", ((MTRAccessControlClusterAccessControlExtensionStruct *) actualValue[0]).fabricIndex, - CurrentFabricIndex)); + CurrentFabricIndexValue)); } NextTest(); @@ -3498,7 +3498,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" length:71]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3555,7 +3555,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { )); VerifyOrReturn(CheckValue("FabricIndex", ((MTRAccessControlClusterAccessControlExtensionStruct *) actualValue[0]).fabricIndex, - CurrentFabricIndex)); + CurrentFabricIndexValue)); } NextTest(); @@ -3586,7 +3586,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { "\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E" "\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x00\x18" length:128]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3648,7 +3648,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { )); VerifyOrReturn(CheckValue("FabricIndex", ((MTRAccessControlClusterAccessControlExtensionStruct *) actualValue[0]).fabricIndex, - CurrentFabricIndex)); + CurrentFabricIndexValue)); } NextTest(); @@ -3679,7 +3679,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { "\x48\x65\x6C\x6C\x6F\x20\x57\x6F\x72\x6C\x64\x2E\x20\x54\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E" "\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x61\x67\x61\x69\x6E\x2E\x2E\x2E\x2E\x2E\x2E\x00\x18" length:129]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3721,7 +3721,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).data = mDBadStruct.HasValue() ? [NSData dataWithBytes:mDBadStruct.Value().data() length:mDBadStruct.Value().size()] : [[NSData alloc] initWithBytes:"\x15\x18" length:2]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3763,7 +3763,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { "\x68\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20" "\x6C\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" length:72]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3807,7 +3807,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { "\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C\x69\x76\x69\x6E\x67\x20" "\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" length:65]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3851,7 +3851,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18\xFF" length:72]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3895,7 +3895,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00" length:70]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3935,7 +3935,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).data = mDBadNone.HasValue() ? [NSData dataWithBytes:mDBadNone.Value().data() length:mDBadNone.Value().size()] : [[NSData alloc] initWithBytes:"" length:0]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -3973,7 +3973,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).data = mDOkEmpty.HasValue() ? [NSData dataWithBytes:mDOkEmpty.Value().data() length:mDOkEmpty.Value().size()] : [[NSData alloc] initWithBytes:"\x17\x18" length:2]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[0]).fabricIndex = [CurrentFabricIndexValue copy]; temp_0[1] = [[MTRAccessControlClusterAccessControlExtensionStruct alloc] init]; ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[1]).data = mDOkSingle.HasValue() @@ -3983,7 +3983,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { "\x69\x73\x20\x69\x73\x20\x61\x20\x73\x69\x6E\x67\x6C\x65\x20\x65\x6C\x65\x6D\x65\x6E\x74\x20\x6C" "\x69\x76\x69\x6E\x67\x20\x61\x73\x20\x61\x20\x63\x68\x61\x72\x73\x74\x72\x69\x6E\x67\x00\x18" length:71]; - ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[1]).fabricIndex = [CurrentFabricIndex copy]; + ((MTRAccessControlClusterAccessControlExtensionStruct *) temp_0[1]).fabricIndex = [CurrentFabricIndexValue copy]; extensionArgument = temp_0; } @@ -4039,7 +4039,7 @@ class Test_TC_ACL_2_3 : public TestCommandBridge { )); VerifyOrReturn(CheckValue("FabricIndex", ((MTRAccessControlClusterAccessControlExtensionStruct *) actualValue[0]).fabricIndex, - CurrentFabricIndex)); + CurrentFabricIndexValue)); } NextTest(); @@ -27259,7 +27259,7 @@ class TestColorControl_9_2 : public TestCommandBridge { value.ms = 5000UL; return WaitForMs("alpha", value); } - NSNumber * _Nonnull ColorLoopStartEnhancedHue; + NSNumber * _Nonnull ColorLoopStartEnhancedHueValue2; CHIP_ERROR TestSavingValueForComparisionReadColorLoopStartEnhancedHueAttributeFromDut_21() { @@ -27274,7 +27274,7 @@ class TestColorControl_9_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - ColorLoopStartEnhancedHue = value; + ColorLoopStartEnhancedHueValue2 = value; } NextTest(); @@ -27296,8 +27296,8 @@ class TestColorControl_9_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], ColorLoopStartEnhancedHue)); + VerifyOrReturn(CheckConstraintMinValue( + "enhancedCurrentHue", [value unsignedShortValue], ColorLoopStartEnhancedHueValue2)); VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); NextTest(); @@ -27327,8 +27327,8 @@ class TestColorControl_9_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("enhancedCurrentHue", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("enhancedCurrentHue", [value unsignedShortValue], ColorLoopStartEnhancedHue)); + VerifyOrReturn(CheckConstraintMinValue( + "enhancedCurrentHue", [value unsignedShortValue], ColorLoopStartEnhancedHueValue2)); VerifyOrReturn(CheckConstraintMaxValue("enhancedCurrentHue", [value unsignedShortValue], 65535U)); NextTest(); @@ -27388,7 +27388,7 @@ class TestColorControl_9_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue; + NSNumber * _Nonnull ColorLoopStoredEnhancedHueValue3; CHIP_ERROR TestSavingValueForComparisionReadColorLoopStoredEnhancedHueAttributeFromDut_27() { @@ -27403,7 +27403,7 @@ class TestColorControl_9_2 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); { - ColorLoopStoredEnhancedHueValue = value; + ColorLoopStoredEnhancedHueValue3 = value; } NextTest(); @@ -27426,7 +27426,7 @@ class TestColorControl_9_2 : public TestCommandBridge { { id actualValue = value; - VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, ColorLoopStoredEnhancedHueValue)); + VerifyOrReturn(CheckValue("EnhancedCurrentHue", actualValue, ColorLoopStoredEnhancedHueValue3)); } NextTest(); @@ -28761,7 +28761,7 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -28783,7 +28783,7 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -28791,7 +28791,7 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -28810,10 +28810,10 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -28839,8 +28839,8 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -28866,8 +28866,8 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -28917,8 +28917,8 @@ class Test_TC_CDOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -30308,7 +30308,7 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -30330,7 +30330,7 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -30338,7 +30338,7 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -30357,10 +30357,10 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -30386,8 +30386,8 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -30413,8 +30413,8 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -30464,8 +30464,8 @@ class Test_TC_CMOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -31855,7 +31855,7 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -31877,7 +31877,7 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -31885,7 +31885,7 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -31904,10 +31904,10 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -31933,8 +31933,8 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -31960,8 +31960,8 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -32011,8 +32011,8 @@ class Test_TC_FLDCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -33402,7 +33402,7 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -33424,7 +33424,7 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -33432,7 +33432,7 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -33451,10 +33451,10 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -33480,8 +33480,8 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -33507,8 +33507,8 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -33558,8 +33558,8 @@ class Test_TC_NDOCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -34945,7 +34945,7 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -34967,7 +34967,7 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -34975,7 +34975,7 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -34994,10 +34994,10 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -35023,8 +35023,8 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -35050,8 +35050,8 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -35101,8 +35101,8 @@ class Test_TC_OZCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -36492,7 +36492,7 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -36514,7 +36514,7 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -36522,7 +36522,7 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -36541,10 +36541,10 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -36570,8 +36570,8 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -36597,8 +36597,8 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -36648,8 +36648,8 @@ class Test_TC_PMHCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -38039,7 +38039,7 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -38061,7 +38061,7 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -38069,7 +38069,7 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -38088,10 +38088,10 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -38117,8 +38117,8 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -38144,8 +38144,8 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -38195,8 +38195,8 @@ class Test_TC_PMICONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -39586,7 +39586,7 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -39608,7 +39608,7 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -39616,7 +39616,7 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -39635,10 +39635,10 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -39664,8 +39664,8 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -39691,8 +39691,8 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -39742,8 +39742,8 @@ class Test_TC_PMKCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -41129,7 +41129,7 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -41151,7 +41151,7 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -41159,7 +41159,7 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -41178,10 +41178,10 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -41207,8 +41207,8 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -41234,8 +41234,8 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -41285,8 +41285,8 @@ class Test_TC_RNCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -42707,7 +42707,7 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ThReadsFromTheDutTheMinMeasuredValueAttribute_1() { @@ -42730,7 +42730,7 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("minMeasuredValue", [value floatValue], 0.0f)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -42738,7 +42738,7 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxMeasuredValueAttribute_2() { @@ -42758,10 +42758,10 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value floatValue], MinMeasuredValueValue)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -42788,8 +42788,8 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -42816,8 +42816,8 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("peakMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("peakMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("peakMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -42869,8 +42869,8 @@ class Test_TC_TVOCCONC_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("averageMeasuredValue", "single", "single")); - VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("averageMeasuredValue", [value floatValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("averageMeasuredValue", [value floatValue], MaxMeasuredValueValue)); } NextTest(); @@ -57916,7 +57916,7 @@ class Test_TC_ILL_2_2 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2aThReadsMinMeasuredValueAttributeFromDut_1() { @@ -57937,7 +57937,7 @@ class Test_TC_ILL_2_2 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("minMeasuredValue", "int16u", "int16u")); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -57945,7 +57945,7 @@ class Test_TC_ILL_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep2bThReadsMaxMeasuredValueAttributeFromDut_2() { @@ -57966,7 +57966,7 @@ class Test_TC_ILL_2_2 : public TestCommandBridge { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16u", "int16u")); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -88385,7 +88385,7 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nullable MinMeasuredValue; + NSNumber * _Nullable MinMeasuredValueValue; CHIP_ERROR TestStep2ReadTheMandatoryAttributeConstraintsMinMeasuredValue_1() { @@ -88408,7 +88408,7 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMaxValue("minMeasuredValue", [value shortValue], 32766)); } { - MinMeasuredValue = value; + MinMeasuredValueValue = value; } NextTest(); @@ -88416,7 +88416,7 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxMeasuredValue; + NSNumber * _Nullable MaxMeasuredValueValue; CHIP_ERROR TestStep3ReadTheMandatoryAttributeConstraintsMaxMeasuredValue_2() { @@ -88435,11 +88435,11 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxMeasuredValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], MinMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("maxMeasuredValue", [value shortValue], MinMeasuredValueValue)); VerifyOrReturn(CheckConstraintMaxValue("maxMeasuredValue", [value shortValue], 32767)); } { - MaxMeasuredValue = value; + MaxMeasuredValueValue = value; } NextTest(); @@ -88465,8 +88465,8 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("measuredValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value shortValue], MinMeasuredValue)); - VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value shortValue], MaxMeasuredValue)); + VerifyOrReturn(CheckConstraintMinValue("measuredValue", [value shortValue], MinMeasuredValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("measuredValue", [value shortValue], MaxMeasuredValueValue)); } NextTest(); @@ -88498,7 +88498,7 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MinScaledValue; + NSNumber * _Nullable MinScaledValueValue; CHIP_ERROR TestStep6ReadTheOptionalAttributeMinScaledValue_5() { @@ -88521,7 +88521,7 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMaxValue("minScaledValue", [value shortValue], 32766)); } { - MinScaledValue = value; + MinScaledValueValue = value; } NextTest(); @@ -88529,7 +88529,7 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nullable MaxScaledValue; + NSNumber * _Nullable MaxScaledValueValue; CHIP_ERROR TestStep7ReadTheOptionalAttributeMaxScaledValue_6() { @@ -88548,11 +88548,11 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("maxScaledValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("maxScaledValue", [value shortValue], MinScaledValue)); + VerifyOrReturn(CheckConstraintMinValue("maxScaledValue", [value shortValue], MinScaledValueValue)); VerifyOrReturn(CheckConstraintMaxValue("maxScaledValue", [value shortValue], 32767)); } { - MaxScaledValue = value; + MaxScaledValueValue = value; } NextTest(); @@ -88578,8 +88578,8 @@ class Test_TC_PRS_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("scaledValue", "int16s", "int16s")); - VerifyOrReturn(CheckConstraintMinValue("scaledValue", [value shortValue], MinScaledValue)); - VerifyOrReturn(CheckConstraintMaxValue("scaledValue", [value shortValue], MaxScaledValue)); + VerifyOrReturn(CheckConstraintMinValue("scaledValue", [value shortValue], MinScaledValueValue)); + VerifyOrReturn(CheckConstraintMaxValue("scaledValue", [value shortValue], MaxScaledValueValue)); } NextTest(); @@ -108093,7 +108093,7 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull InstalledOpenLimitLift; + NSNumber * _Nonnull InstalledOpenLimitLiftValue; CHIP_ERROR TestStep2eReadTheRoOptionalAttributeDefaultInstalledOpenLimitLift_11() { @@ -108111,7 +108111,7 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitLift", [value unsignedShortValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitLift", [value unsignedShortValue], 65535U)); { - InstalledOpenLimitLift = value; + InstalledOpenLimitLiftValue = value; } NextTest(); @@ -108119,7 +108119,7 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull InstalledClosedLimitLift; + NSNumber * _Nonnull InstalledClosedLimitLiftValue; CHIP_ERROR TestStep2fReadTheRoOptionalAttributeDefaultInstalledClosedLimitLift_12() { @@ -108137,7 +108137,7 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitLift", [value unsignedShortValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitLift", [value unsignedShortValue], 65535U)); { - InstalledClosedLimitLift = value; + InstalledClosedLimitLiftValue = value; } NextTest(); @@ -108145,7 +108145,7 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull InstalledOpenLimitTilt; + NSNumber * _Nonnull InstalledOpenLimitTiltValue; CHIP_ERROR TestStep2gReadTheRoOptionalAttributeDefaultInstalledOpenLimitTilt_13() { @@ -108163,7 +108163,7 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("installedOpenLimitTilt", [value unsignedShortValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedOpenLimitTilt", [value unsignedShortValue], 65535U)); { - InstalledOpenLimitTilt = value; + InstalledOpenLimitTiltValue = value; } NextTest(); @@ -108171,7 +108171,7 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull InstalledClosedLimitTilt; + NSNumber * _Nonnull InstalledClosedLimitTiltValue; CHIP_ERROR TestStep2hReadTheRoOptionalAttributeDefaultInstalledClosedLimitTilt_14() { @@ -108189,7 +108189,7 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("installedClosedLimitTilt", [value unsignedShortValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("installedClosedLimitTilt", [value unsignedShortValue], 65535U)); { - InstalledClosedLimitTilt = value; + InstalledClosedLimitTiltValue = value; } NextTest(); @@ -108304,10 +108304,10 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("currentPositionLift", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("currentPositionLift", [value unsignedShortValue], InstalledOpenLimitLift)); - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionLift", [value unsignedShortValue], InstalledClosedLimitLift)); + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionLift", [value unsignedShortValue], InstalledOpenLimitLiftValue)); + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionLift", [value unsignedShortValue], InstalledClosedLimitLiftValue)); } NextTest(); @@ -108356,10 +108356,10 @@ class Test_TC_WNCV_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("currentPositionTilt", "int16u", "int16u")); - VerifyOrReturn( - CheckConstraintMinValue("currentPositionTilt", [value unsignedShortValue], InstalledOpenLimitTilt)); - VerifyOrReturn( - CheckConstraintMaxValue("currentPositionTilt", [value unsignedShortValue], InstalledClosedLimitTilt)); + VerifyOrReturn(CheckConstraintMinValue( + "currentPositionTilt", [value unsignedShortValue], InstalledOpenLimitTiltValue)); + VerifyOrReturn(CheckConstraintMaxValue( + "currentPositionTilt", [value unsignedShortValue], InstalledClosedLimitTiltValue)); } NextTest(); @@ -138679,6 +138679,28 @@ class TestSaveAs : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 109 : Write attribute octet_string Default Value\n"); err = TestWriteAttributeOctetStringDefaultValue_109(); break; + case 110: + ChipLogProgress(chipTool, " ***** Test Step 110 : Read attribute nullable_boolean Default Value\n"); + err = TestReadAttributeNullableBooleanDefaultValue_110(); + break; + case 111: + ChipLogProgress(chipTool, " ***** Test Step 111 : Write attribute nullable_boolean to null\n"); + err = TestWriteAttributeNullableBooleanToNull_111(); + break; + case 112: + ChipLogProgress(chipTool, " ***** Test Step 112 : Read attribute nullable_boolean null Value\n"); + err = TestReadAttributeNullableBooleanNullValue_112(); + break; + case 113: + ChipLogProgress(chipTool, + " ***** Test Step 113 : Read attribute nullable_boolean null Value again and compare it to the previously saved " + "value\n"); + err = TestReadAttributeNullableBooleanNullValueAgainAndCompareItToThePreviouslySavedValue_113(); + break; + case 114: + ChipLogProgress(chipTool, " ***** Test Step 114 : Write attribute nullable_boolean Default Value\n"); + err = TestWriteAttributeNullableBooleanDefaultValue_114(); + break; } if (CHIP_NO_ERROR != err) { @@ -139020,6 +139042,21 @@ class TestSaveAs : public TestCommandBridge { case 109: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; + case 110: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 111: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 112: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 113: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 114: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; } // Go on to the next test. @@ -139033,7 +139070,7 @@ class TestSaveAs : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 110; + const uint16_t mTestCount = 115; chip::Optional mNodeId; chip::Optional mCluster; @@ -141532,6 +141569,131 @@ class TestSaveAs : public TestCommandBridge { return CHIP_NO_ERROR; } + NSNumber * _Nullable readAttributeNullableBooleanDefaultValue; + + CHIP_ERROR TestReadAttributeNullableBooleanDefaultValue_110() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute nullable_boolean Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNonNull("nullable_boolean", actualValue)); + VerifyOrReturn(CheckValue("nullable_boolean", actualValue, false)); + } + { + readAttributeNullableBooleanDefaultValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeNullableBooleanToNull_111() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nullableBooleanArgument; + nullableBooleanArgument = nil; + [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Write attribute nullable_boolean to null Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nullable readAttributeNullableBooleanNullValue; + + CHIP_ERROR TestReadAttributeNullableBooleanNullValue_112() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute nullable_boolean null Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValueNull("nullable_boolean", actualValue)); + } + { + readAttributeNullableBooleanNullValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestReadAttributeNullableBooleanNullValueAgainAndCompareItToThePreviouslySavedValue_113() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeNullableBooleanWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Read attribute nullable_boolean null Value again and compare it to the previously saved value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + if (readAttributeNullableBooleanNullValue == nil) { + VerifyOrReturn(CheckValueNull("nullable_boolean", actualValue)); + } else { + VerifyOrReturn(CheckValueNonNull("nullable_boolean", actualValue)); + VerifyOrReturn(CheckValue("nullable_boolean", actualValue, readAttributeNullableBooleanNullValue)); + } + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestWriteAttributeNullableBooleanDefaultValue_114() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterUnitTesting alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + id nullableBooleanArgument; + nullableBooleanArgument = [readAttributeNullableBooleanDefaultValue copy]; + [cluster writeAttributeNullableBooleanWithValue:nullableBooleanArgument + completion:^(NSError * _Nullable err) { + NSLog(@"Write attribute nullable_boolean Default Value Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } }; class TestConfigVariables : public TestCommandBridge { @@ -157869,7 +158031,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfTotalUsersSupported; + NSNumber * _Nonnull NumberOfTotalUsersSupportedValue; CHIP_ERROR TestGetNumberOfSupportedUsersAndVerifyDefaultValue_2() { @@ -157888,7 +158050,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { VerifyOrReturn(CheckValue("NumberOfTotalUsersSupported", actualValue, 10U)); } { - NumberOfTotalUsersSupported = value; + NumberOfTotalUsersSupportedValue = value; } NextTest(); @@ -157928,7 +158090,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetUserParams alloc] init]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; [cluster getUserWithParams:params completion:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable err) { @@ -159133,7 +159295,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; params.operationType = [NSNumber numberWithUnsignedChar:0U]; - params.userIndex = [NumberOfTotalUsersSupported copy]; + params.userIndex = [NumberOfTotalUsersSupportedValue copy]; params.userName = @"last_user"; params.userUniqueID = nil; params.userStatus = nil; @@ -159159,7 +159321,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetUserParams alloc] init]; - params.userIndex = [NumberOfTotalUsersSupported copy]; + params.userIndex = [NumberOfTotalUsersSupportedValue copy]; [cluster getUserWithParams:params completion:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable err) { NSLog(@"Read the last user back and verify its fields Error: %@", err); @@ -159168,7 +159330,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("UserIndex", actualValue, NumberOfTotalUsersSupported)); + VerifyOrReturn(CheckValue("UserIndex", actualValue, NumberOfTotalUsersSupportedValue)); } { @@ -159267,7 +159429,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterSetUserParams alloc] init]; params.operationType = [NSNumber numberWithUnsignedChar:0U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; params.userName = nil; params.userUniqueID = nil; params.userStatus = nil; @@ -159518,7 +159680,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterClearUserParams alloc] init]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; [cluster clearUserWithParams:params completion:^(NSError * _Nullable err) { @@ -159634,7 +159796,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetUserParams alloc] init]; - params.userIndex = [NumberOfTotalUsersSupported copy]; + params.userIndex = [NumberOfTotalUsersSupportedValue copy]; [cluster getUserWithParams:params completion:^(MTRDoorLockClusterGetUserResponseParams * _Nullable values, NSError * _Nullable err) { NSLog(@"Read last cleared user and verify it is available Error: %@", err); @@ -159643,7 +159805,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue("UserIndex", actualValue, NumberOfTotalUsersSupported)); + VerifyOrReturn(CheckValue("UserIndex", actualValue, NumberOfTotalUsersSupportedValue)); } { @@ -159696,7 +159858,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfPINUsersSupported; + NSNumber * _Nonnull NumberOfPINUsersSupportedValue; CHIP_ERROR TestGetNumberOfSupportedPinCredentialsAndVerifyDefaultValue_41() { @@ -159715,7 +159877,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { VerifyOrReturn(CheckValue("NumberOfPINUsersSupported", actualValue, 10U)); } { - NumberOfPINUsersSupported = value; + NumberOfPINUsersSupportedValue = value; } NextTest(); @@ -159835,7 +159997,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = - [NSNumber numberWithUnsignedShort:[NumberOfPINUsersSupported unsignedShortValue] + 1U]; + [NSNumber numberWithUnsignedShort:[NumberOfPINUsersSupportedValue unsignedShortValue] + 1U]; [cluster getCredentialStatusWithParams:params @@ -160208,7 +160370,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = - [NSNumber numberWithUnsignedShort:[NumberOfPINUsersSupported unsignedShortValue] + 1U]; + [NSNumber numberWithUnsignedShort:[NumberOfPINUsersSupportedValue unsignedShortValue] + 1U]; params.credentialData = [[NSData alloc] initWithBytes:"123456" length:6]; params.userIndex = nil; @@ -160241,7 +160403,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfRFIDUsersSupported; + NSNumber * _Nonnull NumberOfRFIDUsersSupportedValue; CHIP_ERROR TestGetNumberOfSupportedRfidCredentialsAndVerifyDefaultValue_52() { @@ -160260,7 +160422,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { VerifyOrReturn(CheckValue("NumberOfRFIDUsersSupported", actualValue, 10U)); } { - NumberOfRFIDUsersSupported = value; + NumberOfRFIDUsersSupportedValue = value; } NextTest(); @@ -160330,7 +160492,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:2U]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = - [NSNumber numberWithUnsignedShort:[NumberOfRFIDUsersSupported unsignedShortValue] + 1U]; + [NSNumber numberWithUnsignedShort:[NumberOfRFIDUsersSupportedValue unsignedShortValue] + 1U]; [cluster getCredentialStatusWithParams:params @@ -160808,7 +160970,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:2U]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = - [NSNumber numberWithUnsignedShort:[NumberOfRFIDUsersSupported unsignedShortValue] + 1U]; + [NSNumber numberWithUnsignedShort:[NumberOfRFIDUsersSupportedValue unsignedShortValue] + 1U]; params.credentialData = [[NSData alloc] initWithBytes:"new_rfid_data_field" length:19]; params.userIndex = nil; @@ -160902,7 +161064,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = [NSNumber numberWithUnsignedShort:2U]; params.credentialData = [[NSData alloc] initWithBytes:"123465" length:6]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; params.userStatus = nil; params.userType = nil; [cluster @@ -163462,7 +163624,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:1U]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = - [NSNumber numberWithUnsignedShort:[NumberOfPINUsersSupported unsignedShortValue] + 1U]; + [NSNumber numberWithUnsignedShort:[NumberOfPINUsersSupportedValue unsignedShortValue] + 1U]; [cluster clearCredentialWithParams:params completion:^(NSError * _Nullable err) { @@ -163517,7 +163679,7 @@ class DL_UsersAndCredentials : public TestCommandBridge { params.credential = [[MTRDoorLockClusterCredentialStruct alloc] init]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialType = [NSNumber numberWithUnsignedChar:2U]; ((MTRDoorLockClusterCredentialStruct *) params.credential).credentialIndex = - [NSNumber numberWithUnsignedShort:[NumberOfRFIDUsersSupported unsignedShortValue] + 1U]; + [NSNumber numberWithUnsignedShort:[NumberOfRFIDUsersSupportedValue unsignedShortValue] + 1U]; [cluster clearCredentialWithParams:params completion:^(NSError * _Nullable err) { @@ -164995,7 +165157,7 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfTotalUsersSupported; + NSNumber * _Nonnull NumberOfTotalUsersSupportedValue; CHIP_ERROR TestGetNumberOfSupportedUsers_2() { @@ -165014,7 +165176,7 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturn(CheckValue("NumberOfTotalUsersSupported", actualValue, 10U)); } { - NumberOfTotalUsersSupported = value; + NumberOfTotalUsersSupportedValue = value; } NextTest(); @@ -165022,7 +165184,7 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfWeekDaySchedulesSupportedPerUser; + NSNumber * _Nonnull NumberOfWeekDaySchedulesSupportedPerUserValue; CHIP_ERROR TestGetMaxNumberOfWeekDaySchedulesForUserAndVerifyDefaultValue_3() { @@ -165042,7 +165204,7 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturn(CheckValue("NumberOfWeekDaySchedulesSupportedPerUser", actualValue, 10U)); } { - NumberOfWeekDaySchedulesSupportedPerUser = value; + NumberOfWeekDaySchedulesSupportedPerUserValue = value; } NextTest(); @@ -165050,7 +165212,7 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfYearDaySchedulesSupportedPerUser; + NSNumber * _Nonnull NumberOfYearDaySchedulesSupportedPerUserValue; CHIP_ERROR TestGetMaxNumberOfYearDaySchedulesForUserAndVerifyDefaultValue_4() { @@ -165070,7 +165232,7 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturn(CheckValue("NumberOfYearDaySchedulesSupportedPerUser", actualValue, 10U)); } { - NumberOfYearDaySchedulesSupportedPerUser = value; + NumberOfYearDaySchedulesSupportedPerUserValue = value; } NextTest(); @@ -165078,7 +165240,7 @@ class DL_Schedules : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfHolidaySchedulesSupported; + NSNumber * _Nonnull NumberOfHolidaySchedulesSupportedValue; CHIP_ERROR TestGetMaxNumberOfHolidaySchedulesAndVerifyDefaultValue_5() { @@ -165098,7 +165260,7 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturn(CheckValue("NumberOfHolidaySchedulesSupported", actualValue, 10U)); } { - NumberOfHolidaySchedulesSupported = value; + NumberOfHolidaySchedulesSupportedValue = value; } NextTest(); @@ -165145,7 +165307,8 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.weekDayIndex = + [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUserValue unsignedCharValue] + 1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; params.daysMask = [NSNumber numberWithUnsignedChar:1U]; params.startHour = [NSNumber numberWithUnsignedChar:15U]; @@ -165206,7 +165369,7 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterSetWeekDayScheduleParams alloc] init]; params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; params.daysMask = [NSNumber numberWithUnsignedChar:1U]; params.startHour = [NSNumber numberWithUnsignedChar:15U]; params.startMinute = [NSNumber numberWithUnsignedChar:16U]; @@ -165613,7 +165776,8 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.weekDayIndex = + [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUserValue unsignedCharValue] + 1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getWeekDayScheduleWithParams:params completion:^(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, @@ -165625,7 +165789,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.weekDayIndex; VerifyOrReturn(CheckValue("WeekDayIndex", actualValue, - [NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U)); + [NumberOfWeekDaySchedulesSupportedPerUserValue unsignedCharValue] + 1U)); } { @@ -165691,7 +165855,7 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterGetWeekDayScheduleParams alloc] init]; params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; [cluster getWeekDayScheduleWithParams:params completion:^(MTRDoorLockClusterGetWeekDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { @@ -165706,8 +165870,8 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue( - "UserIndex", actualValue, [NumberOfTotalUsersSupported unsignedShortValue] + 1U)); + VerifyOrReturn(CheckValue("UserIndex", actualValue, + [NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U)); } { @@ -165794,7 +165958,8 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.yearDayIndex = + [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUserValue unsignedCharValue] + 1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; @@ -165849,7 +166014,7 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterSetYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; [cluster setYearDayScheduleWithParams:params @@ -166005,7 +166170,8 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.yearDayIndex = + [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUserValue unsignedCharValue] + 1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster getYearDayScheduleWithParams:params completion:^(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, @@ -166017,7 +166183,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.yearDayIndex; VerifyOrReturn(CheckValue("YearDayIndex", actualValue, - [NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U)); + [NumberOfYearDaySchedulesSupportedPerUserValue unsignedCharValue] + 1U)); } { @@ -166083,7 +166249,7 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; [cluster getYearDayScheduleWithParams:params completion:^(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { @@ -166098,8 +166264,8 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.userIndex; - VerifyOrReturn(CheckValue( - "UserIndex", actualValue, [NumberOfTotalUsersSupported unsignedShortValue] + 1U)); + VerifyOrReturn(CheckValue("UserIndex", actualValue, + [NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U)); } { @@ -166186,7 +166352,7 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfHolidaySchedulesSupported unsignedCharValue] + 1U]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfHolidaySchedulesSupportedValue unsignedCharValue] + 1U]; params.localStartTime = [NSNumber numberWithUnsignedInt:12345UL]; params.localEndTime = [NSNumber numberWithUnsignedInt:12345689UL]; params.operatingMode = [NSNumber numberWithUnsignedChar:0U]; @@ -166331,7 +166497,7 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfHolidaySchedulesSupported unsignedCharValue] + 1U]; + params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfHolidaySchedulesSupportedValue unsignedCharValue] + 1U]; [cluster getHolidayScheduleWithParams:params completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { @@ -166342,7 +166508,7 @@ class DL_Schedules : public TestCommandBridge { { id actualValue = values.holidayIndex; VerifyOrReturn(CheckValue("HolidayIndex", actualValue, - [NumberOfHolidaySchedulesSupported unsignedCharValue] + 1U)); + [NumberOfHolidaySchedulesSupportedValue unsignedCharValue] + 1U)); } { @@ -166623,7 +166789,8 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; - params.weekDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.weekDayIndex = + [NSNumber numberWithUnsignedChar:[NumberOfWeekDaySchedulesSupportedPerUserValue unsignedCharValue] + 1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster clearWeekDayScheduleWithParams:params @@ -166676,7 +166843,7 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterClearWeekDayScheduleParams alloc] init]; params.weekDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; [cluster clearWeekDayScheduleWithParams:params completion:^(NSError * _Nullable err) { @@ -166911,7 +167078,8 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.yearDayIndex = + [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUserValue unsignedCharValue] + 1U]; params.userIndex = [NSNumber numberWithUnsignedShort:1U]; [cluster clearYearDayScheduleWithParams:params @@ -166964,7 +167132,7 @@ class DL_Schedules : public TestCommandBridge { __auto_type * params = [[MTRDoorLockClusterClearYearDayScheduleParams alloc] init]; params.yearDayIndex = [NSNumber numberWithUnsignedChar:1U]; - params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupported unsignedShortValue] + 1U]; + params.userIndex = [NSNumber numberWithUnsignedShort:[NumberOfTotalUsersSupportedValue unsignedShortValue] + 1U]; [cluster clearYearDayScheduleWithParams:params completion:^(NSError * _Nullable err) { @@ -167198,7 +167366,8 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterClearHolidayScheduleParams alloc] init]; - params.holidayIndex = [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUser unsignedCharValue] + 1U]; + params.holidayIndex = + [NSNumber numberWithUnsignedChar:[NumberOfYearDaySchedulesSupportedPerUserValue unsignedCharValue] + 1U]; [cluster clearHolidayScheduleWithParams:params completion:^(NSError * _Nullable err) { @@ -168774,7 +168943,7 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterSetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; + params.holidayIndex = [NumberOfHolidaySchedulesSupportedValue copy]; params.localStartTime = [NSNumber numberWithUnsignedInt:1UL]; params.localEndTime = [NSNumber numberWithUnsignedInt:100UL]; params.operatingMode = [NSNumber numberWithUnsignedChar:4U]; @@ -168798,42 +168967,42 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; - [cluster - getHolidayScheduleWithParams:params - completion:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Verify Created Holiday Schedule Error: %@", err); + params.holidayIndex = [NumberOfHolidaySchedulesSupportedValue copy]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Verify Created Holiday Schedule Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("HolidayIndex", actualValue, NumberOfHolidaySchedulesSupported)); - } + { + id actualValue = values.holidayIndex; + VerifyOrReturn( + CheckValue("HolidayIndex", actualValue, NumberOfHolidaySchedulesSupportedValue)); + } - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("LocalStartTime", actualValue, 1UL)); - } + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("LocalStartTime", actualValue, 1UL)); + } - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("LocalEndTime", actualValue, 100UL)); - } + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("LocalEndTime", actualValue, 100UL)); + } - { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("OperatingMode", actualValue, 4U)); - } + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("OperatingMode", actualValue, 4U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -169044,42 +169213,42 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; - [cluster - getHolidayScheduleWithParams:params - completion:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that third holiday schedule was not deleted Error: %@", err); + params.holidayIndex = [NumberOfHolidaySchedulesSupportedValue copy]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Make sure that third holiday schedule was not deleted Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("HolidayIndex", actualValue, NumberOfHolidaySchedulesSupported)); - } + { + id actualValue = values.holidayIndex; + VerifyOrReturn( + CheckValue("HolidayIndex", actualValue, NumberOfHolidaySchedulesSupportedValue)); + } - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 0U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 0U)); + } - { - id actualValue = values.localStartTime; - VerifyOrReturn(CheckValue("LocalStartTime", actualValue, 1UL)); - } + { + id actualValue = values.localStartTime; + VerifyOrReturn(CheckValue("LocalStartTime", actualValue, 1UL)); + } - { - id actualValue = values.localEndTime; - VerifyOrReturn(CheckValue("LocalEndTime", actualValue, 100UL)); - } + { + id actualValue = values.localEndTime; + VerifyOrReturn(CheckValue("LocalEndTime", actualValue, 100UL)); + } - { - id actualValue = values.operatingMode; - VerifyOrReturn(CheckValue("OperatingMode", actualValue, 4U)); - } + { + id actualValue = values.operatingMode; + VerifyOrReturn(CheckValue("OperatingMode", actualValue, 4U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -169288,27 +169457,27 @@ class DL_Schedules : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetHolidayScheduleParams alloc] init]; - params.holidayIndex = [NumberOfHolidaySchedulesSupported copy]; - [cluster - getHolidayScheduleWithParams:params - completion:^( - MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, NSError * _Nullable err) { - NSLog(@"Make sure that third holiday schedule was not deleted Error: %@", err); + params.holidayIndex = [NumberOfHolidaySchedulesSupportedValue copy]; + [cluster getHolidayScheduleWithParams:params + completion:^(MTRDoorLockClusterGetHolidayScheduleResponseParams * _Nullable values, + NSError * _Nullable err) { + NSLog(@"Make sure that third holiday schedule was not deleted Error: %@", err); - VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); - { - id actualValue = values.holidayIndex; - VerifyOrReturn(CheckValue("HolidayIndex", actualValue, NumberOfHolidaySchedulesSupported)); - } + { + id actualValue = values.holidayIndex; + VerifyOrReturn( + CheckValue("HolidayIndex", actualValue, NumberOfHolidaySchedulesSupportedValue)); + } - { - id actualValue = values.status; - VerifyOrReturn(CheckValue("Status", actualValue, 139U)); - } + { + id actualValue = values.status; + VerifyOrReturn(CheckValue("Status", actualValue, 139U)); + } - NextTest(); - }]; + NextTest(); + }]; return CHIP_NO_ERROR; } @@ -172044,7 +172213,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfWeekDaySchedulesSupportedPerUser; + NSNumber * _Nonnull NumberOfWeekDaySchedulesSupportedPerUserValue; CHIP_ERROR TestStep1ThReadsNumberOfWeekDaySchedulesSupportedPerUserAttribute_3() { @@ -172064,7 +172233,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { VerifyOrReturn( CheckConstraintMaxValue("numberOfWeekDaySchedulesSupportedPerUser", [value unsignedCharValue], 255U)); { - NumberOfWeekDaySchedulesSupportedPerUser = value; + NumberOfWeekDaySchedulesSupportedPerUserValue = value; } NextTest(); @@ -172072,7 +172241,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfTotalUsersSupported; + NSNumber * _Nonnull NumberOfTotalUsersSupportedValue; CHIP_ERROR TestStep2ThReadsNumberOfTotalUsersSupportedAttribute_4() { @@ -172089,7 +172258,7 @@ class Test_TC_DRLK_2_5 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("numberOfTotalUsersSupported", [value unsignedShortValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("numberOfTotalUsersSupported", [value unsignedShortValue], 65534U)); { - NumberOfTotalUsersSupported = value; + NumberOfTotalUsersSupportedValue = value; } NextTest(); @@ -172622,7 +172791,7 @@ class Test_TC_DRLK_2_6 : public TestCommandBridge { value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee("alpha", value); } - NSNumber * _Nonnull NumberOfHolidaySchedulesSupported; + NSNumber * _Nonnull NumberOfHolidaySchedulesSupportedValue; CHIP_ERROR TestStep1ThReadsNumberOfHolidaySchedulesSupportedAndSavesForFutureUse_1() { @@ -172640,7 +172809,7 @@ class Test_TC_DRLK_2_6 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("numberOfHolidaySchedulesSupported", [value unsignedCharValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("numberOfHolidaySchedulesSupported", [value unsignedCharValue], 255U)); { - NumberOfHolidaySchedulesSupported = value; + NumberOfHolidaySchedulesSupportedValue = value; } NextTest(); @@ -173272,7 +173441,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfYearDaySchedulesSupportedPerUser; + NSNumber * _Nonnull NumberOfYearDaySchedulesSupportedPerUserValue; CHIP_ERROR TestStep1ThReadsNumberOfYearDaySchedulesSupportedPerUserAttribute_3() { @@ -173292,7 +173461,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { VerifyOrReturn( CheckConstraintMaxValue("numberOfYearDaySchedulesSupportedPerUser", [value unsignedCharValue], 255U)); { - NumberOfYearDaySchedulesSupportedPerUser = value; + NumberOfYearDaySchedulesSupportedPerUserValue = value; } NextTest(); @@ -173300,7 +173469,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { return CHIP_NO_ERROR; } - NSNumber * _Nonnull NumberOfTotalUsersSupported; + NSNumber * _Nonnull NumberOfTotalUsersSupportedValue; CHIP_ERROR TestStep2ThReadsNumberOfTotalUsersSupportedAttribute_4() { @@ -173317,7 +173486,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { VerifyOrReturn(CheckConstraintMinValue("numberOfTotalUsersSupported", [value unsignedShortValue], 0U)); VerifyOrReturn(CheckConstraintMaxValue("numberOfTotalUsersSupported", [value unsignedShortValue], 65534U)); { - NumberOfTotalUsersSupported = value; + NumberOfTotalUsersSupportedValue = value; } NextTest(); @@ -173512,7 +173681,7 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); __auto_type * params = [[MTRDoorLockClusterGetYearDayScheduleParams alloc] init]; - params.yearDayIndex = [NumberOfYearDaySchedulesSupportedPerUser copy]; + params.yearDayIndex = [NumberOfYearDaySchedulesSupportedPerUserValue copy]; params.userIndex = [NSNumber numberWithUnsignedShort:5U]; [cluster getYearDayScheduleWithParams:params completion:^(MTRDoorLockClusterGetYearDayScheduleResponseParams * _Nullable values, @@ -173523,8 +173692,8 @@ class Test_TC_DRLK_2_7 : public TestCommandBridge { { id actualValue = values.yearDayIndex; - VerifyOrReturn( - CheckValue("YearDayIndex", actualValue, NumberOfYearDaySchedulesSupportedPerUser)); + VerifyOrReturn(CheckValue( + "YearDayIndex", actualValue, NumberOfYearDaySchedulesSupportedPerUserValue)); } { From 041ba339ec7064b0090cea6abe0df483da37b577 Mon Sep 17 00:00:00 2001 From: Thirupathi S <108743108+Thirsrin@users.noreply.github.com> Date: Tue, 12 Sep 2023 20:24:43 +0530 Subject: [PATCH 066/134] [Silabs] feature/DIC feature support for thermostat app and window app (#29084) * feature/DIC feature support for thermostat app and window app * Restyled by whitespace * Restyled by clang-format * addressed review comments * Restyled by clang-format * addressed review comments * addressed review comments --------- Co-authored-by: Restyled.io --- .../thermostat/silabs/src/ZclCallbacks.cpp | 7 ++++++ .../window-app/silabs/src/WindowManager.cpp | 23 ++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/examples/thermostat/silabs/src/ZclCallbacks.cpp b/examples/thermostat/silabs/src/ZclCallbacks.cpp index 734637d91be401..641f4c7698c27d 100644 --- a/examples/thermostat/silabs/src/ZclCallbacks.cpp +++ b/examples/thermostat/silabs/src/ZclCallbacks.cpp @@ -28,6 +28,10 @@ #include #include +#ifdef DIC_ENABLE +#include "dic_control.h" +#endif // DIC_ENABLE + using namespace ::chip; using namespace ::chip::app::Clusters; @@ -46,5 +50,8 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & else if (clusterId == Thermostat::Id) { TempMgr().AttributeChangeHandler(attributePath.mEndpointId, attributeId, value, size); +#ifdef DIC_ENABLE + dic::control::AttributeHandler(attributePath.mEndpointId, attributeId); +#endif // DIC_ENABLE } } diff --git a/examples/window-app/silabs/src/WindowManager.cpp b/examples/window-app/silabs/src/WindowManager.cpp index c6687ab2ba512e..851a818e9ec485 100644 --- a/examples/window-app/silabs/src/WindowManager.cpp +++ b/examples/window-app/silabs/src/WindowManager.cpp @@ -56,6 +56,12 @@ using namespace ::chip::DeviceLayer::Silabs; #define APP_STATE_LED 0 #define APP_ACTION_LED 1 +#ifdef DIC_ENABLE +#define DECIMAL 10 +#define MSG_SIZE 6 +#include "dic.h" +#endif // DIC_ENABLE + using namespace ::chip::Credentials; using namespace ::chip::DeviceLayer; using namespace chip::app::Clusters::WindowCovering; @@ -502,10 +508,25 @@ void WindowManager::Cover::CallbackPositionSet(intptr_t arg) position.SetNonNull(data->percent100ths); if (data->isTilt) + { TiltPositionSet(data->mEndpointId, position); +#ifdef DIC_ENABLE + uint16_t value = data->percent100ths; + char buffer[MSG_SIZE]; + itoa(value, buffer, DECIMAL); + dic_sendmsg("tilt/position set", (const char *) (buffer)); +#endif // DIC_ENABLE + } else + { LiftPositionSet(data->mEndpointId, position); - +#ifdef DIC_ENABLE + uint16_t value = data->percent100ths; + char buffer[MSG_SIZE]; + itoa(value, buffer, DECIMAL); + dic_sendmsg("lift/position set", (const char *) (buffer)); +#endif // DIC_ENABLE + } chip::Platform::Delete(data); } From 4442906bcc6df98ab0f5c85f643ff35674979cd9 Mon Sep 17 00:00:00 2001 From: Douglas Rocha Ferraz Date: Tue, 12 Sep 2023 13:51:47 -0400 Subject: [PATCH 067/134] Sample Manufacturer Extension Cluster (#29162) * new: chef test custom cluster * MEI sample cluster. Chef device sample * renamed some symbols * fix: sampleMei doesn't need zap-generated command callbacks * chg: new implementation of cluster supports many endpoints * chg: zap regen * chg: removed unused variable captured in closure * chg: changed %lu to %zu for size_t types * commands made non-optional. Restyle * removed reference for availability.yaml * fix: controller-clusters.zap as a samplemei client cluster, not server * fix: sample mei command handling on adding, availability.yaml * chg: replaced %zu to type castings. Lint doesn't like %zu * fix: removed event list from data model * fix: event list removed from controller-clusters.zap * chg: sample mei tag doc * fix: last bits of controller-clusters.zap got cut when rebased * chg: zap regen after new zap version installed * changed MEI to Mei in cluster name * Restyled by whitespace * Restyled by clang-format * Update src/darwin/Framework/CHIP/templates/availability.yaml Co-authored-by: Boris Zbarsky * Update src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml Co-authored-by: Boris Zbarsky * Update src/app/clusters/sample-mei-server/sample-mei-server.cpp Co-authored-by: Boris Zbarsky * capitalized MEI * chg: cluster added to ClustersWithShutdownFunctions * chg: included app/util/config.h in sample-mei-server.h * fix: shutdown calls UnregisterEndpoint * fix: shutdown calls UnregisterEndpoint * fix: name of cluster in config-data.yaml * Restyled by clang-format * chg: removed dead code * chg: error codes for r/w * Restyled by clang-format * chg: issue number in config-data.yaml --------- Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .github/.wordlist.txt | 1 + .github/workflows/tests.yaml | 1 + examples/chef/README.md | 27 + .../rootnode_onofflight_samplemei.matter | 1600 ++++ .../devices/rootnode_onofflight_samplemei.zap | 7736 +++++++++++++++++ scripts/rules.matterlint | 2 +- .../sample-mei-server/sample-mei-server.cpp | 225 + .../sample-mei-server/sample-mei-server.h | 89 + src/app/common/templates/config-data.yaml | 5 + src/app/zap-templates/zcl/data-model/all.xml | 1 + .../data-model/chip/sample-mei-cluster.xml | 59 + .../zcl/zcl-with-test-extensions.json | 1 + src/app/zap-templates/zcl/zcl.json | 1 + src/app/zap_cluster_list.json | 2 + src/controller/data_model/BUILD.gn | 2 + .../data_model/controller-clusters.matter | 25 + .../data_model/controller-clusters.zap | 196 +- .../devicecontroller/ClusterIDMapping.java | 123 + .../devicecontroller/ClusterReadMapping.java | 84 +- .../devicecontroller/ClusterWriteMapping.java | 26 +- .../CHIPAttributeTLVValueDecoder.cpp | 158 + .../java/zap-generated/CHIPClientCallbacks.h | 8 + .../zap-generated/CHIPClustersWrite-JNI.cpp | 52 + .../CHIPEventTLVValueDecoder.cpp | 10 + .../zap-generated/CHIPInvokeCallbacks.cpp | 60 + .../java/zap-generated/CHIPInvokeCallbacks.h | 15 + .../java/zap-generated/CHIPReadCallbacks.cpp | 284 + .../chip/devicecontroller/ChipClusters.java | 208 + .../chip/devicecontroller/ChipIdLookup.java | 4309 +++++++++ .../devicecontroller/ClusterInfoMapping.java | 138 + .../python/chip/clusters/CHIPClusters.py | 67 + .../python/chip/clusters/Objects.py | 187 + .../CHIP/templates/availability.yaml | 1 + .../MTRAttributeSpecifiedCheck.mm | 33 + .../MTRAttributeTLVValueDecoder.mm | 28 + .../CHIP/zap-generated/MTRBaseClusters.h | 124 + .../CHIP/zap-generated/MTRBaseClusters.mm | 434 + .../zap-generated/MTRBaseClusters_Internal.h | 4 + .../CHIP/zap-generated/MTRCallbackBridge.h | 154 + .../CHIP/zap-generated/MTRCallbackBridge.mm | 165 + .../CHIP/zap-generated/MTRClusterConstants.h | 21 + .../CHIP/zap-generated/MTRClusters.h | 52 + .../CHIP/zap-generated/MTRClusters.mm | 179 + .../CHIP/zap-generated/MTRClusters_Internal.h | 4 + .../zap-generated/MTRCommandPayloadsObjc.h | 79 + .../zap-generated/MTRCommandPayloadsObjc.mm | 140 + .../MTRCommandPayloads_Internal.h | 7 + .../zap-generated/MTREventTLVValueDecoder.mm | 15 + .../zap-generated/attributes/Accessors.cpp | 99 + .../zap-generated/attributes/Accessors.h | 21 + .../app-common/zap-generated/callback.h | 86 + .../app-common/zap-generated/cluster-enums.h | 2 + .../zap-generated/cluster-objects.cpp | 160 + .../zap-generated/cluster-objects.h | 190 + .../app-common/zap-generated/ids/Attributes.h | 34 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 18 + .../app-common/zap-generated/print-cluster.h | 9 +- .../zap-generated/cluster/Commands.h | 152 + .../cluster/logging/DataModelLogger.cpp | 60 + .../cluster/logging/DataModelLogger.h | 2 + .../zap-generated/cluster/Commands.h | 861 ++ 62 files changed, 18833 insertions(+), 6 deletions(-) create mode 100644 examples/chef/devices/rootnode_onofflight_samplemei.matter create mode 100644 examples/chef/devices/rootnode_onofflight_samplemei.zap create mode 100644 src/app/clusters/sample-mei-server/sample-mei-server.cpp create mode 100644 src/app/clusters/sample-mei-server/sample-mei-server.h create mode 100644 src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml create mode 100644 src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 05a46e2da0395e..f5dc5a1ac9c7cb 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -849,6 +849,7 @@ MDNS MediaInput MediaPlayback MediaTek +MEI mem memdf MemMonitoring diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index aa54505bbae9ab..08c5ded0fccb27 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -180,6 +180,7 @@ jobs: src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml \ src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml \ + src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \ " - name: Build Apps run: | diff --git a/examples/chef/README.md b/examples/chef/README.md index 98ae9ac3ec2ecb..ab239b39a939ce 100644 --- a/examples/chef/README.md +++ b/examples/chef/README.md @@ -210,3 +210,30 @@ To add new devices for chef: `examples/chef/devices`. - This is gated by the workflow in `.github/workflows/zap_templates.yaml`. - All devices added to the repository are built in CD. + +## Manufacturer Extensions / Custom Clusters + +You may add vendor-defined features to chef. The +`rootnode_onofflight_meisample*` device showcases its usage by using the Sample +MEI cluster which is defined on +`src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml` + +This cluster has + +- One boolean attribute: `flip-flop` +- A `ping` command with no arguments +- A command/response pair `add-arguments`. The command takes two uint8 + arguments and the response command returns their sum. + +You may test the `Sample MEI` via chip-tool using the following commands: + +``` +# commissioning of on-network chef device +chip-tool pairing onnetwork 1 20202021 +# tests command to sum arguments: returns 30 +chip-tool samplemei add-arguments 1 1 10 20 +# sets Flip-Flop to false +chip-tool samplemei write flip-flop 0 1 1 +# reads Flip-Flop +chip-tool samplemei read flip-flop 1 1 +``` diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter new file mode 100644 index 00000000000000..dc75c0a2d44b8e --- /dev/null +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -0,0 +1,1600 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; +} + +struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; +} + +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : ENUM8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : ENUM8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : ENUM8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + INT16U identifyTime = 0; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for group configuration and manipulation. */ +server cluster Groups = 4 { + bitmap Feature : BITMAP32 { + kGroupNames = 0x1; + } + + bitmap NameSupportBitmap : BITMAP8 { + kGroupNames = 0x80; + } + + readonly attribute NameSupportBitmap nameSupport = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + CHAR_STRING groupName = 2; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; +} + +/** Attributes and commands for switching devices between 'On' and 'Off' states. */ +server cluster OnOff = 6 { + enum OnOffDelayedAllOffEffectVariant : ENUM8 { + kFadeToOffIn0p8Seconds = 0; + kNoFade = 1; + k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2; + } + + enum OnOffDyingLightEffectVariant : ENUM8 { + k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0; + } + + enum OnOffEffectIdentifier : ENUM8 { + kDelayedAllOff = 0; + kDyingLight = 1; + } + + enum OnOffStartUpOnOff : ENUM8 { + kOff = 0; + kOn = 1; + kTogglePreviousOnOff = 2; + } + + bitmap Feature : BITMAP32 { + kLighting = 0x1; + kDeadFront = 0x2; + } + + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; + } + + readonly attribute boolean onOff = 0; + readonly attribute boolean globalSceneControl = 16384; + attribute int16u onTime = 16385; + attribute int16u offWaitTime = 16386; + attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command Off(): DefaultSuccess = 0; + command On(): DefaultSuccess = 1; + command Toggle(): DefaultSuccess = 2; +} + +/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ +server cluster LevelControl = 8 { + enum MoveMode : ENUM8 { + kUp = 0; + kDown = 1; + } + + enum StepMode : ENUM8 { + kUp = 0; + kDown = 1; + } + + bitmap Feature : BITMAP32 { + kOnOff = 0x1; + kLighting = 0x2; + kFrequency = 0x4; + } + + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + + readonly attribute nullable int8u currentLevel = 0; + readonly attribute int16u remainingTime = 1; + readonly attribute int8u minLevel = 2; + readonly attribute int8u maxLevel = 3; + attribute LevelControlOptions options = 15; + attribute nullable int8u onLevel = 17; + attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct MoveToLevelRequest { + INT8U level = 0; + nullable INT16U transitionTime = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct MoveRequest { + MoveMode moveMode = 0; + nullable INT8U rate = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct StepRequest { + StepMode stepMode = 0; + INT8U stepSize = 1; + nullable INT16U transitionTime = 2; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; + } + + request struct StopRequest { + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; + } + + request struct MoveToLevelWithOnOffRequest { + INT8U level = 0; + nullable INT16U transitionTime = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct MoveWithOnOffRequest { + MoveMode moveMode = 0; + nullable INT8U rate = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct StepWithOnOffRequest { + StepMode stepMode = 0; + INT8U stepSize = 1; + nullable INT16U transitionTime = 2; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; + } + + request struct StopWithOnOffRequest { + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; + } + + command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; + command Move(MoveRequest): DefaultSuccess = 1; + command Step(StepRequest): DefaultSuccess = 2; + command Stop(StopRequest): DefaultSuccess = 3; + command MoveToLevelWithOnOff(MoveToLevelWithOnOffRequest): DefaultSuccess = 4; + command MoveWithOnOff(MoveWithOnOffRequest): DefaultSuccess = 5; + command StepWithOnOff(StepWithOnOffRequest): DefaultSuccess = 6; + command StopWithOnOff(StopWithOnOffRequest): DefaultSuccess = 7; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : BITMAP32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute CLUSTER_ID serverList[] = 1; + readonly attribute CLUSTER_ID clientList[] = 2; + readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Binding Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for supporting the binding table. */ +client cluster Binding = 30 { + fabric_scoped struct TargetStruct { + optional node_id node = 1; + optional group_id group = 2; + optional endpoint_no endpoint = 3; + optional cluster_id cluster = 4; + fabric_idx fabricIndex = 254; + } + + attribute TargetStruct binding[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : ENUM8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : ENUM8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : ENUM8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : ENUM8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + INT32U softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; + attribute access(write: manage) boolean localConfigDisabled = 16; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Provides an interface for providing OTA software updates */ +client cluster OtaSoftwareUpdateProvider = 41 { + enum OTAApplyUpdateAction : ENUM8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum OTADownloadProtocol : ENUM8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum OTAQueryStatus : ENUM8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + INT16U productID = 1; + INT32U softwareVersion = 2; + OTADownloadProtocol protocolsSupported[] = 3; + optional INT16U hardwareVersion = 4; + optional CHAR_STRING<2> location = 5; + optional BOOLEAN requestorCanConsent = 6; + optional OCTET_STRING<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + OTAQueryStatus status = 0; + optional INT32U delayedActionTime = 1; + optional CHAR_STRING<256> imageURI = 2; + optional INT32U softwareVersion = 3; + optional CHAR_STRING<64> softwareVersionString = 4; + optional OCTET_STRING<32> updateToken = 5; + optional BOOLEAN userConsentNeeded = 6; + optional OCTET_STRING<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + OTAApplyUpdateAction action = 0; + INT32U delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +server cluster OtaSoftwareUpdateRequestor = 42 { + enum OTAAnnouncementReason : ENUM8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum OTAChangeReasonEnum : ENUM8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum OTAUpdateStateEnum : ENUM8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + OTAUpdateStateEnum previousState = 0; + OTAUpdateStateEnum newState = 1; + OTAChangeReasonEnum reason = 2; + nullable INT32U targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + INT32U softwareVersion = 0; + INT16U productID = 1; + } + + info event DownloadError = 2 { + INT32U softwareVersion = 0; + INT64U bytesDownloaded = 1; + nullable INT8U progressPercent = 2; + nullable INT64S platformCode = 3; + } + + attribute ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute OTAUpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + OTAAnnouncementReason announcementReason = 2; + optional OCTET_STRING<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +server cluster LocalizationConfiguration = 43 { + attribute char_string<35> activeLocale = 0; + readonly attribute CHAR_STRING supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +server cluster TimeFormatLocalization = 44 { + enum CalendarTypeEnum : ENUM8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + } + + enum HourFormatEnum : ENUM8 { + k12hr = 0; + k24hr = 1; + } + + bitmap Feature : BITMAP32 { + kCalendarFormat = 0x1; + } + + attribute HourFormatEnum hourFormat = 0; + attribute CalendarTypeEnum activeCalendarType = 1; + readonly attribute CalendarTypeEnum supportedCalendarTypes[] = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : ENUM8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : ENUM8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + INT16U expiryLengthSeconds = 0; + INT64U breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + CHAR_STRING countryCode = 1; + INT64U breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : ENUM8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : ENUM8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : BITMAP32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap WiFiSecurityBitmap : BITMAP8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable OCTET_STRING<32> ssid = 0; + optional INT64U breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + OCTET_STRING<32> ssid = 0; + OCTET_STRING<64> credentials = 1; + optional INT64U breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + OCTET_STRING<254> operationalDataset = 0; + optional INT64U breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING<512> debugText = 1; + optional INT8U networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +server cluster DiagnosticLogs = 50 { + enum IntentEnum : ENUM8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : ENUM8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : ENUM8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional CHAR_STRING<32> transferFileDesignator = 2; + } + + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : ENUM8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : ENUM8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : ENUM8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : ENUM8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : ENUM8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; + readonly attribute int32u totalOperationalHours = 3; + readonly attribute BootReasonEnum bootReason = 4; + readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + OCTET_STRING<16> enableKey = 0; + INT64U eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster SoftwareDiagnostics = 52 { + bitmap Feature : BITMAP32 { + kWaterMarks = 0x1; + } + + struct ThreadMetricsStruct { + int64u id = 0; + optional char_string<8> name = 1; + optional int32u stackFreeCurrent = 2; + optional int32u stackFreeMinimum = 3; + optional int32u stackSize = 4; + } + + info event SoftwareFault = 0 { + INT64U id = 0; + optional CHAR_STRING name = 1; + optional OCTET_STRING faultRecording = 2; + } + + readonly attribute ThreadMetricsStruct threadMetrics[] = 0; + readonly attribute int64u currentHeapFree = 1; + readonly attribute int64u currentHeapUsed = 2; + readonly attribute int64u currentHeapHighWatermark = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command ResetWatermarks(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : ENUM8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : ENUM8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + OCTET_STRING PAKEPasscodeVerifier = 1; + INT16U discriminator = 2; + INT32U iterations = 3; + OCTET_STRING salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : ENUM8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : ENUM8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute OCTET_STRING trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + OCTET_STRING attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + OCTET_STRING CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + OCTET_STRING IPKValue = 2; + Int64u caseAdminSubject = 3; + VENDOR_ID adminVendorId = 4; + } + + request struct UpdateNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + CHAR_STRING<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + OCTET_STRING rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : ENUM8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : BITMAP32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + INT16U groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + INT16U groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + INT16U groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only +labels. */ +server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + readonly attribute LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Sample MEI cluster showcases a cluster manufacturer extensions */ +server cluster SampleMei = 4294048800 { + attribute boolean flipFlop = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AddArgumentsRequest { + INT8U arg1 = 0; + INT8U arg2 = 1; + } + + response struct AddArgumentsResponse = 1 { + INT8U returnValue = 0; + } + + command Ping(): DefaultSuccess = 0; + command AddArguments(AddArgumentsRequest): AddArgumentsResponse = 2; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + binding cluster OtaSoftwareUpdateProvider; + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry; + callback attribute targetsPerAccessControlEntry; + callback attribute accessControlEntriesPerFabric; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision default = 10; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OtaSoftwareUpdateRequestor { + emits event StateTransition; + emits event VersionApplied; + emits event DownloadError; + callback attribute defaultOTAProviders; + ram attribute updatePossible default = 1; + ram attribute updateState default = 0; + ram attribute updateStateProgress default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster LocalizationConfiguration { + ram attribute activeLocale; + callback attribute supportedLocales; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + persist attribute activeCalendarType default = 0; + callback attribute supportedCalendarTypes; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + ram attribute featureMap default = 6; + ram attribute clusterRevision default = 0x0001; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 0x0001; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralDiagnostics { + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; + callback attribute totalOperationalHours default = 0x00000000; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster SoftwareDiagnostics { + callback attribute threadMetrics; + callback attribute currentHeapFree default = 0x0000000000000000; + callback attribute currentHeapUsed default = 0x0000000000000000; + callback attribute currentHeapHighWatermark default = 0x0000000000000000; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 0x0001; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 0x0001; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster FixedLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_onofflight = 256, version 1; + + binding cluster Binding; + + server cluster Identify { + ram attribute identifyTime default = 0x0; + ram attribute identifyType default = 0x0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 2; + } + + server cluster Groups { + ram attribute nameSupport default = 0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 3; + } + + server cluster OnOff { + ram attribute onOff default = 0; + ram attribute globalSceneControl default = 1; + ram attribute onTime default = 0; + ram attribute offWaitTime default = 0; + ram attribute startUpOnOff default = 0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 5; + } + + server cluster LevelControl { + ram attribute currentLevel default = 0x01; + ram attribute remainingTime default = 0x0000; + ram attribute minLevel default = 0x01; + ram attribute maxLevel default = 0xFE; + ram attribute options default = 0x01; + ram attribute onLevel default = 0xFE; + ram attribute startUpCurrentLevel default = 0x01; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 5; + } + + server cluster Descriptor { + callback attribute deviceTypeList default = 0; + callback attribute serverList default = 0; + callback attribute clientList default = 0; + callback attribute partsList default = 0; + callback attribute generatedCommandList default = 0; + callback attribute acceptedCommandList default = 0; + callback attribute attributeList default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster SampleMei { + ram attribute flipFlop default = false; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} + + diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.zap b/examples/chef/devices/rootnode_onofflight_samplemei.zap new file mode 100644 index 00000000000000..4d6bc2c3c09493 --- /dev/null +++ b/examples/chef/devices/rootnode_onofflight_samplemei.zap @@ -0,0 +1,7736 @@ +{ + "featureLevel": 97, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 4, + "name": "MA-rootdevice", + "deviceTypeRef": { + "id": 2, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "id": 2, + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceTypeRefs": [ + 2 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "switch type", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "switch actions", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OTAUpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StateTransition", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "VersionApplied", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "DownloadError", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "PHYRate", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PHYRateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FullDuplex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketRxCount", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketTxCount", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCount", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CollisionCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CarrierDetect", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TimeSinceReset", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NumberOfPositions", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPosition", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0001", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 3, + "name": "Anonymous Endpoint Type", + "deviceTypeRef": { + "id": 8, + "code": 256, + "profileId": 259, + "label": "MA-onofflight", + "name": "MA-onofflight" + }, + "deviceTypes": [ + { + "id": 8, + "code": 256, + "profileId": 259, + "label": "MA-onofflight", + "name": "MA-onofflight" + } + ], + "deviceTypeRefs": [ + 8 + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 256 + ], + "deviceTypeName": "MA-onofflight", + "deviceTypeCode": 256, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConfiguredBy", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "node_id", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GlobalSceneControl", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTime", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffWaitTime", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpOnOff", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "OnOffStartUpOnOff", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinLevel", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxLevel", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentFrequency", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinFrequency", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxFrequency", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "LevelControlOptions", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnOffTransitionTime", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnLevel", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTransitionTime", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffTransitionTime", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultMoveRate", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpCurrentLevel", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "client", + "enabled": 1, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Binding", + "code": 30, + "mfgCode": null, + "define": "BINDING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Binding", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Occupancy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "OccupancyBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupancySensorType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OccupancySensorTypeBitmap", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PIROccupiedToUnoccupiedDelay", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PIRUnoccupiedToOccupiedDelay", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PIRUnoccupiedToOccupiedThreshold", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UltrasonicOccupiedToUnoccupiedDelay", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UltrasonicUnoccupiedToOccupiedDelay", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UltrasonicUnoccupiedToOccupiedThreshold", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalContactOccupiedToUnoccupiedDelay", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalContactUnoccupiedToOccupiedDelay", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PhysicalContactUnoccupiedToOccupiedThreshold", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Sample MEI", + "code": 4294048800, + "mfgCode": null, + "define": "SAMPLE_MEI_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Ping", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddArguments", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Sample MEI", + "code": 4294048800, + "mfgCode": null, + "define": "SAMPLE_MEI_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AddArgumentsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FlipFlop", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "Anonymous Endpoint Type", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index 60de80bd19e9f1..3892736a0da7fa 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -91,7 +91,7 @@ load "../src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters. load "../src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/air-quality-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml"; - +load "../src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml"; all endpoints { // These attributes follow a different code path and do not have to be diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.cpp b/src/app/clusters/sample-mei-server/sample-mei-server.cpp new file mode 100644 index 00000000000000..94b83419f59a87 --- /dev/null +++ b/src/app/clusters/sample-mei-server/sample-mei-server.cpp @@ -0,0 +1,225 @@ +#include "sample-mei-server.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::SampleMei; +using namespace chip::app::Clusters::SampleMei::Commands; +using namespace chip::app::Clusters::SampleMei::Attributes; + +// ***************************************************************************** +// Init/Shutdown Callbacks + +void MatterSampleMeiPluginServerInitCallback() +{ + ChipLogProgress(Zcl, "Sample MEI Init. Ep %d, Total Ep %u", EMBER_AF_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT, + static_cast(kNumSupportedEndpoints)); + ReturnOnFailure(InteractionModelEngine::GetInstance()->RegisterCommandHandler(&SampleMeiServer::Instance())); + VerifyOrReturn(registerAttributeAccessOverride(&SampleMeiServer::Instance()), CHIP_ERROR_INCORRECT_STATE); +} + +void emberAfSampleMeiClusterServerInitCallback(chip::EndpointId endpoint) +{ + ChipLogProgress(Zcl, "Creating Sample MEI cluster, Ep %d", endpoint); + SampleMeiServer::Instance().RegisterEndpoint(endpoint); +} + +void MatterSampleMeiClusterServerShutdownCallback(chip::EndpointId endpoint) +{ + // There's currently no whole-cluster shutdown callback. That would trigger + // call to `Shutdown`. Thus ep-based shutdown calls `UnregisterEndpoint` + ChipLogProgress(Zcl, "Shutting down Sample MEI cluster, Ep %d", endpoint); + SampleMeiServer::Instance().UnregisterEndpoint(endpoint); +} + +// ***************************************************************************** +// SampleMeiContent + +namespace chip { +namespace app { +namespace Clusters { +namespace SampleMei { + +SampleMeiContent::SampleMeiContent() : SampleMeiContent(kInvalidEndpointId) {} + +SampleMeiContent::SampleMeiContent(EndpointId aEndpoint) +{ + endpoint = aEndpoint; + + // Attribute default values + flipflop = false; +} + +// ***************************************************************************** +// SampleMeiServer + +void SampleMeiServer::InvokeCommand(HandlerContext & ctxt) +{ + auto endpoint = ctxt.mRequestPath.mEndpointId; + auto endpointIndex = EndpointIndex(endpoint); + if (endpointIndex == std::numeric_limits::max()) + { + ctxt.mCommandHandler.AddStatus(ctxt.mRequestPath, Protocols::InteractionModel::Status::UnsupportedEndpoint); + return; + } + + switch (ctxt.mRequestPath.mCommandId) + { + case Commands::Ping::Id: + HandleCommand(ctxt, [endpoint](HandlerContext & ctx, const auto & req) { + ChipLogProgress(Zcl, "Ping Command on Ep %d", endpoint); + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::Success); + }); + return; + case Commands::AddArguments::Id: + HandleCommand(ctxt, [endpoint](HandlerContext & ctx, const auto & req) { + ChipLogProgress(Zcl, "AddArgumentsCommand on Ep %d", endpoint); + if (req.arg1 > UINT8_MAX - req.arg2) + { + ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::InvalidCommand); + return; + } + + AddArgumentsResponse::Type response; + response.returnValue = static_cast(req.arg1 + req.arg2); + ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response); + }); + return; + } +} + +CHIP_ERROR SampleMeiServer::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + auto endpoint = aPath.mEndpointId; + auto endpointIndex = EndpointIndex(endpoint); + if (endpointIndex == std::numeric_limits::max()) + { + return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint); + } + + switch (aPath.mAttributeId) + { + case Attributes::FlipFlop::Id: + ChipLogProgress(Zcl, "Read Attribute flip-flop from Ep %d index %u value %d", endpoint, + static_cast(endpointIndex), content[endpointIndex].flipflop); + err = aEncoder.Encode(content[endpointIndex].flipflop); + break; + default: + break; + } + + return err; +} + +CHIP_ERROR SampleMeiServer::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + auto endpoint = aPath.mEndpointId; + auto endpointIndex = EndpointIndex(endpoint); + if (endpointIndex == std::numeric_limits::max()) + { + return CHIP_IM_GLOBAL_STATUS(UnsupportedEndpoint); + } + + switch (aPath.mAttributeId) + { + case Attributes::FlipFlop::Id: { + auto oldValue = content[endpointIndex].flipflop; + ReturnErrorOnFailure(aDecoder.Decode(content[endpointIndex].flipflop)); + ChipLogProgress(Zcl, "Write Attribute flip-flop on Ep %d index %u newValue %d oldValue %d", endpoint, + static_cast(endpointIndex), content[endpointIndex].flipflop, oldValue); + break; + } + default: + break; + } + + return err; +} + +SampleMeiServer & SampleMeiServer::Instance() +{ + static SampleMeiServer sampleMeiServer; + return sampleMeiServer; +} + +void SampleMeiServer::Shutdown() +{ + for (size_t i = 0; i < kNumSupportedEndpoints; ++i) + { + content[i].endpoint = kInvalidEndpointId; + } +} + +size_t SampleMeiServer::GetNumSupportedEndpoints() const +{ + return kNumSupportedEndpoints; +} + +CHIP_ERROR SampleMeiServer::RegisterEndpoint(EndpointId endpointId) +{ + size_t endpointIndex = NextEmptyIndex(); + if (endpointIndex == std::numeric_limits::max()) + { + return CHIP_ERROR_NO_MEMORY; + } + + content[endpointIndex] = SampleMeiContent(endpointId); + return CHIP_NO_ERROR; +} + +CHIP_ERROR SampleMeiServer::UnregisterEndpoint(EndpointId endpointId) +{ + size_t endpointIndex = EndpointIndex(endpointId); + if (endpointIndex == std::numeric_limits::max()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + content[endpointIndex].endpoint = kInvalidEndpointId; + return CHIP_NO_ERROR; +} + +size_t SampleMeiServer::EndpointIndex(EndpointId endpointId) const +{ + for (size_t i = 0; i < kNumSupportedEndpoints; ++i) + { + if (content[i].endpoint == endpointId) + { + return i; + } + } + return std::numeric_limits::max(); +} + +size_t SampleMeiServer::NextEmptyIndex() const +{ + for (size_t i = 0; i < kNumSupportedEndpoints; ++i) + { + if (content[i].endpoint == kInvalidEndpointId) + { + return i; + } + } + return std::numeric_limits::max(); +} + +} // namespace SampleMei +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.h b/src/app/clusters/sample-mei-server/sample-mei-server.h new file mode 100644 index 00000000000000..3f4463215e4acc --- /dev/null +++ b/src/app/clusters/sample-mei-server/sample-mei-server.h @@ -0,0 +1,89 @@ +#ifndef SRC_APP_CLUSTERS_SAMPLE_MEI_CLUSTER_SERVER_SERVER_H_ +#define SRC_APP_CLUSTERS_SAMPLE_MEI_CLUSTER_SERVER_SERVER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef ZCL_USING_SAMPLE_MEI_CLUSTER_SERVER +#define SAMPLE_MEI_NUM_SUPPORTED_ENDPOINTS \ + (EMBER_AF_SAMPLE_MEI_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT) +#else +#define SAMPLE_MEI_NUM_SUPPORTED_ENDPOINTS CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT +#endif /* ZCL_USING_SAMPLE_MEI_CLUSTER_SERVER */ +static constexpr size_t kNumSupportedEndpoints = SAMPLE_MEI_NUM_SUPPORTED_ENDPOINTS; + +namespace chip { +namespace app { +namespace Clusters { +namespace SampleMei { + +// ***************************************************************************** +// SampleMeiContent has the stateful attributes of the cluster: its endpoint +// and attributes + +class SampleMeiContent +{ +public: + EndpointId endpoint; + + // Attribute List + bool flipflop; /* Attributes::FlipFlop::Id */ + + SampleMeiContent(EndpointId endpoint); + SampleMeiContent(); +}; + +// ***************************************************************************** +// SampleMeiServer implements both Attributes and Commands + +class SampleMeiServer : public AttributeAccessInterface, public CommandHandlerInterface +{ +public: + // Register on all endpoints. + SampleMeiServer() : + AttributeAccessInterface(Optional::Missing(), SampleMei::Id), + CommandHandlerInterface(Optional(), Id) + {} + static SampleMeiServer & Instance(); + + // Currently not used, but should be called from a whole-cluster shutdown + // callback once cluster lifecycle is clearer + void Shutdown(); + + // Attributes + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + + // Commands + void InvokeCommand(HandlerContext & ctx) override; + + // Attribute storage +#if SAMPLE_MEI_NUM_SUPPORTED_ENDPOINTS > 0 + SampleMeiContent content[kNumSupportedEndpoints]; +#else + SampleMeiContent * content = nullptr; +#endif + + size_t GetNumSupportedEndpoints() const; + CHIP_ERROR RegisterEndpoint(EndpointId endpointId); + CHIP_ERROR UnregisterEndpoint(EndpointId endpointId); + +private: + // both return std::numeric_limits::max() for not found + size_t EndpointIndex(EndpointId endpointId) const; + size_t NextEmptyIndex() const; +}; + +} // namespace SampleMei +} // namespace Clusters +} // namespace app +} // namespace chip + +#endif // SRC_APP_CLUSTERS_SAMPLE_MEI_CLUSTER_SERVER_SERVER_H_ diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index b6e8bf1135f051..601d3f13f613fd 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -33,6 +33,9 @@ CommandHandlerInterfaceOnlyClusters: - ActivatedCarbonFilterMonitoring - HepaFilterMonitoring - RvcOperationalState + # cluster format should match ClustersWithInitFunctions et al + # See https://github.com/project-chip/connectedhomeip/issues/29186 + - SampleMei # We need a more configurable way of deciding which clusters have which init functions.... # See https://github.com/project-chip/connectedhomeip/issues/4369 @@ -48,6 +51,7 @@ ClustersWithInitFunctions: - Time Format Localization - Thermostat - Mode Select + - Sample MEI ClustersWithAttributeChangedFunctions: - Bridged Device Basic @@ -63,6 +67,7 @@ ClustersWithShutdownFunctions: - Door Lock - Level Control - Color Control + - Sample MEI ClustersWithPreAttributeChangeFunctions: - Door Lock diff --git a/src/app/zap-templates/zcl/data-model/all.xml b/src/app/zap-templates/zcl/data-model/all.xml index ca275414705c4f..211fed5581d049 100644 --- a/src/app/zap-templates/zcl/data-model/all.xml +++ b/src/app/zap-templates/zcl/data-model/all.xml @@ -92,4 +92,5 @@ + diff --git a/src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml new file mode 100644 index 00000000000000..98790ca85babe8 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml @@ -0,0 +1,59 @@ + + + + + + + General + Sample MEI + + 0xFFF1FC20 + SAMPLE_MEI_CLUSTER + The Sample MEI cluster showcases a cluster manufacturer extensions + + + + FlipFlop + + + + + Response for AddArguments that returns the sum. + + + + + + + + Command that takes two uint8 arguments and returns their sum. + + + + + + + + Simple command without any parameters and without a response. + + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 23d31a680befb4..cda276d24e3012 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -105,6 +105,7 @@ "wifi-network-diagnostics-cluster.xml", "window-covering.xml", "matter-devices.xml", + "sample-mei-cluster.xml", "types/color-control.xml", "types/door-lock.xml", "types/occupancy-sensing.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 803c56012be49c..d83714d040a20b 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -103,6 +103,7 @@ "wifi-network-diagnostics-cluster.xml", "window-covering.xml", "matter-devices.xml", + "sample-mei-cluster.xml", "types/color-control.xml", "types/door-lock.xml", "types/occupancy-sensing.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 9cec759b259d71..61b2d99f5433e0 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -55,6 +55,7 @@ "MEDIA_PLAYBACK_CLUSTER": [], "MODE_SELECT_CLUSTER": [], "NETWORK_COMMISSIONING_CLUSTER": [], + "SAMPLE_MEI_CLUSTER": [], "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [], "OCCUPANCY_SENSING_CLUSTER": ["occupancy-sensor-server"], "ON_OFF_CLUSTER": [], @@ -186,6 +187,7 @@ "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], + "SAMPLE_MEI_CLUSTER": ["sample-mei-server"], "OCCUPANCY_SENSING_CLUSTER": ["occupancy-sensor-server"], "ON_OFF_CLUSTER": ["on-off-server"], "ON_OFF_SWITCH_CONFIGURATION_CLUSTER": [], diff --git a/src/controller/data_model/BUILD.gn b/src/controller/data_model/BUILD.gn index e5ab9d24460a88..f5044d61711df8 100644 --- a/src/controller/data_model/BUILD.gn +++ b/src/controller/data_model/BUILD.gn @@ -218,6 +218,8 @@ if (current_os == "android" || matter_enable_java_compilation) { "jni/RvcCleanModeClient-ReadImpl.cpp", "jni/RvcRunModeClient-InvokeSubscribeImpl.cpp", "jni/RvcRunModeClient-ReadImpl.cpp", + "jni/SampleMeiClient-InvokeSubscribeImpl.cpp", + "jni/SampleMeiClient-ReadImpl.cpp", "jni/ScenesClient-InvokeSubscribeImpl.cpp", "jni/ScenesClient-ReadImpl.cpp", "jni/SmokeCoAlarmClient-InvokeSubscribeImpl.cpp", diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 8a623075a5ef86..d2b7233e62c5ed 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -7066,3 +7066,28 @@ client cluster FaultInjection = 4294048774 { command access(invoke: manage) FailRandomlyAtFault(FailRandomlyAtFaultRequest): DefaultSuccess = 1; } +/** The Sample MEI cluster showcases a cluster manufacturer extensions */ +client cluster SampleMei = 4294048800 { + attribute boolean flipFlop = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + response struct AddArgumentsResponse = 1 { + INT8U returnValue = 0; + } + + request struct AddArgumentsRequest { + INT8U arg1 = 0; + INT8U arg2 = 1; + } + + /** Simple command without any parameters and without a response. */ + command Ping(): DefaultSuccess = 0; + /** Command that takes two uint8 arguments and returns their sum. */ + command AddArguments(AddArgumentsRequest): AddArgumentsResponse = 2; +} + diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 77f9d90aa108f6..1273f03e8d52b7 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -33,7 +33,7 @@ ], "endpointTypes": [ { - "id": 1, + "id": 4, "name": "MA-rootdevice", "deviceTypeRef": { "code": 22, @@ -28771,6 +28771,198 @@ "reportableChange": 0 } ] + }, + { + "name": "Sample MEI", + "code": 4294048800, + "mfgCode": null, + "define": "SAMPLE_MEI_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "Ping", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddArguments", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "client", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Sample MEI", + "code": 4294048800, + "mfgCode": null, + "define": "SAMPLE_MEI_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddArgumentsResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "FlipFlop", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] } ] } @@ -28784,4 +28976,4 @@ "networkId": 0 } ] -} \ No newline at end of file +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index dedcfd9290312d..9d5be1817a7cdd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -318,6 +318,9 @@ public static BaseCluster getCluster(long clusterId) { } if (clusterId == FaultInjection.ID) { return new FaultInjection(); + } + if (clusterId == SampleMei.ID) { + return new SampleMei(); }return null; } public static class Identify implements BaseCluster { @@ -14160,6 +14163,126 @@ public long getEventID(String name) throws IllegalArgumentException { return Event.valueOf(name).getID(); } + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } + public static class SampleMei implements BaseCluster { + public static final long ID = 4294048800L; + public long getID() { + return ID; + } + + public enum Attribute { + FlipFlop(0L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + Ping(0L), + AddArguments(2L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }public enum AddArgumentsCommandField {Arg1(0),Arg2(1),; + private final int id; + AddArgumentsCommandField(int id) { + this.id = id; + } + + public int getID() { + return id; + } + public static AddArgumentsCommandField value(int id) throws NoSuchFieldError { + for (AddArgumentsCommandField field : AddArgumentsCommandField.values()) { + if (field.getID() == id) { + return field; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + @Override public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 338023c10f36c1..16cdf60a0085df 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -17342,6 +17342,87 @@ private static Map readFaultInjectionInteractionInfo() return result; } + private static Map readSampleMeiInteractionInfo() { + Map result = new LinkedHashMap<>();Map readSampleMeiFlipFlopCommandParams = new LinkedHashMap(); + InteractionInfo readSampleMeiFlipFlopAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster).readFlipFlopAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readSampleMeiFlipFlopCommandParams + ); + result.put("readFlipFlopAttribute", readSampleMeiFlipFlopAttributeInteractionInfo); + Map readSampleMeiGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readSampleMeiGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.SampleMeiCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedSampleMeiClusterGeneratedCommandListAttributeCallback(), + readSampleMeiGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readSampleMeiGeneratedCommandListAttributeInteractionInfo); + Map readSampleMeiAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readSampleMeiAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.SampleMeiCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedSampleMeiClusterAcceptedCommandListAttributeCallback(), + readSampleMeiAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readSampleMeiAcceptedCommandListAttributeInteractionInfo); + Map readSampleMeiEventListCommandParams = new LinkedHashMap(); + InteractionInfo readSampleMeiEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster).readEventListAttribute( + (ChipClusters.SampleMeiCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedSampleMeiClusterEventListAttributeCallback(), + readSampleMeiEventListCommandParams + ); + result.put("readEventListAttribute", readSampleMeiEventListAttributeInteractionInfo); + Map readSampleMeiAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readSampleMeiAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster).readAttributeListAttribute( + (ChipClusters.SampleMeiCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedSampleMeiClusterAttributeListAttributeCallback(), + readSampleMeiAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readSampleMeiAttributeListAttributeInteractionInfo); + Map readSampleMeiFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readSampleMeiFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readSampleMeiFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readSampleMeiFeatureMapAttributeInteractionInfo); + Map readSampleMeiClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readSampleMeiClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readSampleMeiClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readSampleMeiClusterRevisionAttributeInteractionInfo); + + return result; + } @SuppressWarnings("serial") public Map> getReadAttributeMap() { @@ -17442,7 +17523,8 @@ public Map> getReadAttributeMap() { put("accountLogin", readAccountLoginInteractionInfo()); put("electricalMeasurement", readElectricalMeasurementInteractionInfo()); put("unitTesting", readUnitTestingInteractionInfo()); - put("faultInjection", readFaultInjectionInteractionInfo());}}; + put("faultInjection", readFaultInjectionInteractionInfo()); + put("sampleMei", readSampleMeiInteractionInfo());}}; } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 595222f79f5a38..5df865adc76614 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -5191,6 +5191,30 @@ public Map> getWriteAttributeMap() { writeUnitTestingInteractionInfo.put("writeWriteOnlyInt8uAttribute", writeUnitTestingWriteOnlyInt8uAttributeInteractionInfo); writeAttributeMap.put("unitTesting", writeUnitTestingInteractionInfo); Map writeFaultInjectionInteractionInfo = new LinkedHashMap<>(); - writeAttributeMap.put("faultInjection", writeFaultInjectionInteractionInfo);return writeAttributeMap; + writeAttributeMap.put("faultInjection", writeFaultInjectionInteractionInfo); + Map writeSampleMeiInteractionInfo = new LinkedHashMap<>(); + Map writeSampleMeiFlipFlopCommandParams = new LinkedHashMap(); + CommandParameterInfo sampleMeiflipFlopCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeSampleMeiFlipFlopCommandParams.put( + "value", + sampleMeiflipFlopCommandParameterInfo + ); + InteractionInfo writeSampleMeiFlipFlopAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster).writeFlipFlopAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeSampleMeiFlipFlopCommandParams + ); + writeSampleMeiInteractionInfo.put("writeFlipFlopAttribute", writeSampleMeiFlipFlopAttributeInteractionInfo); + writeAttributeMap.put("sampleMei", writeSampleMeiInteractionInfo);return writeAttributeMap; } } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 8701d512deaeeb..d7ceccc2757ba6 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -34954,6 +34954,164 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::SampleMei::Id: { + using namespace app::Clusters::SampleMei; + switch (aPath.mAttributeId) + { + case Attributes::FlipFlop::Id: { + using TypeInfo = Attributes::FlipFlop::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } default: *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; break; diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index 813ddba48a0738..b1646be03f8911 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -1001,3 +1001,11 @@ typedef void (*FaultInjectionEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*FaultInjectionAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SampleMeiGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SampleMeiAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SampleMeiEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*SampleMeiAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); diff --git a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp index a3936fe6b03dbb..9a97be24f17b40 100644 --- a/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp +++ b/src/controller/java/zap-generated/CHIPClustersWrite-JNI.cpp @@ -13989,4 +13989,56 @@ JNI_METHOD(void, UnitTestingCluster, writeWriteOnlyInt8uAttribute) onFailure.release(); } +JNI_METHOD(void, SampleMeiCluster, writeFlipFlopAttribute) +(JNIEnv * env, jobject self, jlong clusterPtr, jobject callback, jobject value, jobject timedWriteTimeoutMs) +{ + chip::DeviceLayer::StackLock lock; + ListFreer listFreer; + using TypeInfo = chip::app::Clusters::SampleMei::Attributes::FlipFlop::TypeInfo; + TypeInfo::Type cppValue; + + std::vector> cleanupByteArrays; + std::vector> cleanupStrings; + + cppValue = + static_cast>(chip::JniReferences::GetInstance().BooleanToPrimitive(value)); + + std::unique_ptr onSuccess( + Platform::New(callback), 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), 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; + SampleMeiCluster * cppCluster = reinterpret_cast(clusterPtr); + VerifyOrReturn(cppCluster != nullptr, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException( + env, callback, "Could not get native cluster", CHIP_ERROR_INCORRECT_STATE)); + + auto successFn = chip::Callback::Callback::FromCancelable(onSuccess->Cancel()); + auto failureFn = chip::Callback::Callback::FromCancelable(onFailure->Cancel()); + + if (timedWriteTimeoutMs == nullptr) + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall); + } + else + { + err = cppCluster->WriteAttribute(cppValue, onSuccess->mContext, successFn->mCall, failureFn->mCall, + chip::JniReferences::GetInstance().IntegerToPrimitive(timedWriteTimeoutMs)); + } + VerifyOrReturn( + err == CHIP_NO_ERROR, + chip::AndroidClusterExceptions::GetInstance().ReturnIllegalStateException(env, callback, "Error writing attribute", err)); + + onSuccess.release(); + onFailure.release(); +} + #pragma clang diagnostic pop diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 245413bb6abe30..0a096db6a8e36c 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -5045,6 +5045,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::SampleMei::Id: { + using namespace app::Clusters::SampleMei; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } default: *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; break; diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp index 8dc941845121a4..d9d0c871ba082d 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp @@ -6911,4 +6911,64 @@ void CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback::Callba env->CallVoidMethod(javaCallbackRef, javaMethod, value); } +CHIPSampleMeiClusterAddArgumentsResponseCallback::CHIPSampleMeiClusterAddArgumentsResponseCallback(jobject javaCallback) : + Callback::Callback(CallbackFn, this) +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPSampleMeiClusterAddArgumentsResponseCallback::~CHIPSampleMeiClusterAddArgumentsResponseCallback() +{ + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +}; + +void CHIPSampleMeiClusterAddArgumentsResponseCallback::CallbackFn( + void * context, const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType & dataResponse) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + jmethodID javaMethod; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Error invoking Java callback: no JNIEnv")); + + std::unique_ptr + cppCallback(reinterpret_cast(context), + chip::Platform::Delete); + VerifyOrReturn(cppCallback != nullptr, ChipLogError(Zcl, "Error invoking Java callback: failed to cast native callback")); + + javaCallbackRef = cppCallback->javaCallbackRef; + // Java callback is allowed to be null, exit early if this is the case. + VerifyOrReturn(javaCallbackRef != nullptr); + + err = JniReferences::GetInstance().FindMethod(env, javaCallbackRef, "onSuccess", "(Ljava/lang/Integer;)V", &javaMethod); + VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Error invoking Java callback: %s", ErrorStr(err))); + + jobject returnValue; + std::string returnValueClassName = "java/lang/Integer"; + std::string returnValueCtorSignature = "(I)V"; + jint jnireturnValue = static_cast(dataResponse.returnValue); + chip::JniReferences::GetInstance().CreateBoxedObject(returnValueClassName.c_str(), returnValueCtorSignature.c_str(), + jnireturnValue, returnValue); + + env->CallVoidMethod(javaCallbackRef, javaMethod, returnValue); +} } // namespace chip diff --git a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h index 2f93fd858fbec2..4bb4afe2fe72ba 100644 --- a/src/controller/java/zap-generated/CHIPInvokeCallbacks.h +++ b/src/controller/java/zap-generated/CHIPInvokeCallbacks.h @@ -990,4 +990,19 @@ class CHIPUnitTestingClusterTestEmitTestFabricScopedEventResponseCallback jobject javaCallbackRef; }; +class CHIPSampleMeiClusterAddArgumentsResponseCallback + : public Callback::Callback +{ +public: + CHIPSampleMeiClusterAddArgumentsResponseCallback(jobject javaCallback); + + ~CHIPSampleMeiClusterAddArgumentsResponseCallback(); + + static void CallbackFn(void * context, + const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType & data); + +private: + jobject javaCallbackRef; +}; + } // namespace chip diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 3903a402f42ebc..fd598c47904b1c 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -51534,3 +51534,287 @@ void CHIPFaultInjectionAttributeListAttributeCallback::CallbackFn( env->ExceptionClear(); env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); } + +CHIPSampleMeiGeneratedCommandListAttributeCallback::CHIPSampleMeiGeneratedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPSampleMeiGeneratedCommandListAttributeCallback::~CHIPSampleMeiGeneratedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPSampleMeiGeneratedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPSampleMeiAcceptedCommandListAttributeCallback::CHIPSampleMeiAcceptedCommandListAttributeCallback(jobject javaCallback, + bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), + keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPSampleMeiAcceptedCommandListAttributeCallback::~CHIPSampleMeiAcceptedCommandListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPSampleMeiAcceptedCommandListAttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPSampleMeiEventListAttributeCallback::CHIPSampleMeiEventListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPSampleMeiEventListAttributeCallback::~CHIPSampleMeiEventListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPSampleMeiEventListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} + +CHIPSampleMeiAttributeListAttributeCallback::CHIPSampleMeiAttributeListAttributeCallback(jobject javaCallback, bool keepAlive) : + chip::Callback::Callback(CallbackFn, this), keepAlive(keepAlive) +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + return; + } + + javaCallbackRef = env->NewGlobalRef(javaCallback); + if (javaCallbackRef == nullptr) + { + ChipLogError(Zcl, "Could not create global reference for Java callback"); + } +} + +CHIPSampleMeiAttributeListAttributeCallback::~CHIPSampleMeiAttributeListAttributeCallback() +{ + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + if (env == nullptr) + { + ChipLogError(Zcl, "Could not delete global reference for Java callback"); + return; + } + env->DeleteGlobalRef(javaCallbackRef); +} + +void CHIPSampleMeiAttributeListAttributeCallback::CallbackFn(void * context, + const chip::app::DataModel::DecodableList & list) +{ + chip::DeviceLayer::StackUnlock unlock; + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = chip::JniReferences::GetInstance().GetEnvForCurrentThread(); + jobject javaCallbackRef; + + VerifyOrReturn(env != nullptr, ChipLogError(Zcl, "Could not get JNI env")); + + std::unique_ptr cppCallback( + reinterpret_cast(context), maybeDestroy); + + // It's valid for javaCallbackRef to be nullptr if the Java code passed in a null callback. + javaCallbackRef = cppCallback.get()->javaCallbackRef; + VerifyOrReturn(javaCallbackRef != nullptr, + ChipLogProgress(Zcl, "Early return from attribute callback since Java callback is null")); + + jmethodID javaMethod; + 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")); + + jobject arrayListObj; + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); + + auto iter_arrayListObj_0 = list.begin(); + while (iter_arrayListObj_0.Next()) + { + auto & entry_0 = iter_arrayListObj_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + } + + env->ExceptionClear(); + env->CallVoidMethod(javaCallbackRef, javaMethod, arrayListObj); +} diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 30e933b4810fa4..8eac9532c59054 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -39562,5 +39562,213 @@ private native void subscribeClusterRevisionAttribute(long chipClusterPtr, IntegerAttributeCallback callback , int minInterval, int maxInterval); } + + public static class SampleMeiCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 0xFFF1FC20L; + + public SampleMeiCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId); + } + + @Override + public native long initWithDevice(long devicePtr, int endpointId); + + public void ping(DefaultClusterCallback callback + ) { + ping(chipClusterPtr, callback, null); + } + + public void ping(DefaultClusterCallback callback + + , int timedInvokeTimeoutMs) { + ping(chipClusterPtr, callback, timedInvokeTimeoutMs); + } + + public void addArguments(AddArgumentsResponseCallback callback + , Integer arg1, Integer arg2) { + addArguments(chipClusterPtr, callback, arg1, arg2, null); + } + + public void addArguments(AddArgumentsResponseCallback callback + , Integer arg1, Integer arg2 + , int timedInvokeTimeoutMs) { + addArguments(chipClusterPtr, callback, arg1, arg2, timedInvokeTimeoutMs); + } + private native void ping(long chipClusterPtr, DefaultClusterCallback Callback + + , @Nullable Integer timedInvokeTimeoutMs); + private native void addArguments(long chipClusterPtr, AddArgumentsResponseCallback Callback + , Integer arg1, Integer arg2 + , @Nullable Integer timedInvokeTimeoutMs); + public interface AddArgumentsResponseCallback { + void onSuccess(Integer returnValue); + + void onError(Exception error); + } + + + public interface GeneratedCommandListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface AcceptedCommandListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface EventListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + public interface AttributeListAttributeCallback { + void onSuccess( List valueList); + void onError(Exception ex); + default void onSubscriptionEstablished(long subscriptionId) {} + } + + public void readFlipFlopAttribute( + BooleanAttributeCallback callback + ) { + readFlipFlopAttribute(chipClusterPtr, callback); + } + public void writeFlipFlopAttribute(DefaultClusterCallback callback, Boolean value) { + writeFlipFlopAttribute(chipClusterPtr, callback, value, null); + } + + public void writeFlipFlopAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + writeFlipFlopAttribute(chipClusterPtr, callback, value, timedWriteTimeoutMs); + } + public void subscribeFlipFlopAttribute( + BooleanAttributeCallback callback +, + int minInterval, int maxInterval) { + subscribeFlipFlopAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback + ) { + readGeneratedCommandListAttribute(chipClusterPtr, callback); + } + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeGeneratedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback + ) { + readAcceptedCommandListAttribute(chipClusterPtr, callback); + } + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeAcceptedCommandListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback + ) { + readEventListAttribute(chipClusterPtr, callback); + } + public void subscribeEventListAttribute( + EventListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeEventListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback + ) { + readAttributeListAttribute(chipClusterPtr, callback); + } + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback + , + int minInterval, int maxInterval) { + subscribeAttributeListAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback + ) { + readFeatureMapAttribute(chipClusterPtr, callback); + } + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback +, + int minInterval, int maxInterval) { + subscribeFeatureMapAttribute(chipClusterPtr, callback, minInterval, maxInterval); + } + + 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 readFlipFlopAttribute(long chipClusterPtr, + BooleanAttributeCallback callback + ); + + private native void writeFlipFlopAttribute(long chipClusterPtr, DefaultClusterCallback callback, Boolean value, @Nullable Integer timedWriteTimeoutMs); + private native void subscribeFlipFlopAttribute(long chipClusterPtr, + BooleanAttributeCallback callback +, int minInterval, int maxInterval); + + private native void readGeneratedCommandListAttribute(long chipClusterPtr, + GeneratedCommandListAttributeCallback callback + ); + private native void subscribeGeneratedCommandListAttribute(long chipClusterPtr, + GeneratedCommandListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readAcceptedCommandListAttribute(long chipClusterPtr, + AcceptedCommandListAttributeCallback callback + ); + private native void subscribeAcceptedCommandListAttribute(long chipClusterPtr, + AcceptedCommandListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readEventListAttribute(long chipClusterPtr, + EventListAttributeCallback callback + ); + private native void subscribeEventListAttribute(long chipClusterPtr, + EventListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readAttributeListAttribute(long chipClusterPtr, + AttributeListAttributeCallback callback + ); + private native void subscribeAttributeListAttribute(long chipClusterPtr, + AttributeListAttributeCallback callback + , int minInterval, int maxInterval); + + private native void readFeatureMapAttribute(long chipClusterPtr, + LongAttributeCallback callback + ); + private native void subscribeFeatureMapAttribute(long chipClusterPtr, + LongAttributeCallback callback +, int minInterval, int maxInterval); + + private native void readClusterRevisionAttribute(long chipClusterPtr, + IntegerAttributeCallback callback + ); + private native void subscribeClusterRevisionAttribute(long chipClusterPtr, + IntegerAttributeCallback callback +, int minInterval, int maxInterval); + } } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java new file mode 100644 index 00000000000000..b5f120c17b55bd --- /dev/null +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipIdLookup.java @@ -0,0 +1,4309 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// THIS FILE IS GENERATED BY ZAP + +package chip.devicecontroller; + +public final class ChipIdLookup { + /** + * Translates cluster ID to a cluster name in upper camel case. If no matching ID is found, + * returns an empty string. + */ + public static String clusterIdToName(long clusterId) { + if (clusterId == 3L) { + return "Identify"; + } + if (clusterId == 4L) { + return "Groups"; + } + if (clusterId == 5L) { + return "Scenes"; + } + if (clusterId == 6L) { + return "OnOff"; + } + if (clusterId == 7L) { + return "OnOffSwitchConfiguration"; + } + if (clusterId == 8L) { + return "LevelControl"; + } + if (clusterId == 15L) { + return "BinaryInputBasic"; + } + if (clusterId == 29L) { + return "Descriptor"; + } + if (clusterId == 30L) { + return "Binding"; + } + if (clusterId == 31L) { + return "AccessControl"; + } + if (clusterId == 37L) { + return "Actions"; + } + if (clusterId == 40L) { + return "BasicInformation"; + } + if (clusterId == 41L) { + return "OtaSoftwareUpdateProvider"; + } + if (clusterId == 42L) { + return "OtaSoftwareUpdateRequestor"; + } + if (clusterId == 43L) { + return "LocalizationConfiguration"; + } + if (clusterId == 44L) { + return "TimeFormatLocalization"; + } + if (clusterId == 45L) { + return "UnitLocalization"; + } + if (clusterId == 46L) { + return "PowerSourceConfiguration"; + } + if (clusterId == 47L) { + return "PowerSource"; + } + if (clusterId == 48L) { + return "GeneralCommissioning"; + } + if (clusterId == 49L) { + return "NetworkCommissioning"; + } + if (clusterId == 50L) { + return "DiagnosticLogs"; + } + if (clusterId == 51L) { + return "GeneralDiagnostics"; + } + if (clusterId == 52L) { + return "SoftwareDiagnostics"; + } + if (clusterId == 53L) { + return "ThreadNetworkDiagnostics"; + } + if (clusterId == 54L) { + return "WiFiNetworkDiagnostics"; + } + if (clusterId == 55L) { + return "EthernetNetworkDiagnostics"; + } + if (clusterId == 57L) { + return "BridgedDeviceBasicInformation"; + } + if (clusterId == 59L) { + return "Switch"; + } + if (clusterId == 60L) { + return "AdministratorCommissioning"; + } + if (clusterId == 62L) { + return "OperationalCredentials"; + } + if (clusterId == 63L) { + return "GroupKeyManagement"; + } + if (clusterId == 64L) { + return "FixedLabel"; + } + if (clusterId == 65L) { + return "UserLabel"; + } + if (clusterId == 69L) { + return "BooleanState"; + } + if (clusterId == 80L) { + return "ModeSelect"; + } + if (clusterId == 257L) { + return "DoorLock"; + } + if (clusterId == 258L) { + return "WindowCovering"; + } + if (clusterId == 259L) { + return "BarrierControl"; + } + if (clusterId == 512L) { + return "PumpConfigurationAndControl"; + } + if (clusterId == 513L) { + return "Thermostat"; + } + if (clusterId == 514L) { + return "FanControl"; + } + if (clusterId == 516L) { + return "ThermostatUserInterfaceConfiguration"; + } + if (clusterId == 768L) { + return "ColorControl"; + } + if (clusterId == 769L) { + return "BallastConfiguration"; + } + if (clusterId == 1024L) { + return "IlluminanceMeasurement"; + } + if (clusterId == 1026L) { + return "TemperatureMeasurement"; + } + if (clusterId == 1027L) { + return "PressureMeasurement"; + } + if (clusterId == 1028L) { + return "FlowMeasurement"; + } + if (clusterId == 1029L) { + return "RelativeHumidityMeasurement"; + } + if (clusterId == 1030L) { + return "OccupancySensing"; + } + if (clusterId == 1283L) { + return "WakeOnLan"; + } + if (clusterId == 1284L) { + return "Channel"; + } + if (clusterId == 1285L) { + return "TargetNavigator"; + } + if (clusterId == 1286L) { + return "MediaPlayback"; + } + if (clusterId == 1287L) { + return "MediaInput"; + } + if (clusterId == 1288L) { + return "LowPower"; + } + if (clusterId == 1289L) { + return "KeypadInput"; + } + if (clusterId == 1290L) { + return "ContentLauncher"; + } + if (clusterId == 1291L) { + return "AudioOutput"; + } + if (clusterId == 1292L) { + return "ApplicationLauncher"; + } + if (clusterId == 1293L) { + return "ApplicationBasic"; + } + if (clusterId == 1294L) { + return "AccountLogin"; + } + if (clusterId == 2820L) { + return "ElectricalMeasurement"; + } + if (clusterId == 4166L) { + return "ClientMonitoring"; + } + if (clusterId == 4294048773L) { + return "UnitTesting"; + } + return ""; + } + + /** + * Translates cluster ID and attribute ID to an attribute name in upper camel case. If no matching + * IDs are found, returns an empty string. + */ + public static String attributeIdToName(long clusterId, long attributeId) { + if (clusterId == 3L) { + if (attributeId == 0L) { + return "IdentifyTime"; + } + if (attributeId == 1L) { + return "IdentifyType"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 4L) { + if (attributeId == 0L) { + return "NameSupport"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 5L) { + if (attributeId == 0L) { + return "SceneCount"; + } + if (attributeId == 1L) { + return "CurrentScene"; + } + if (attributeId == 2L) { + return "CurrentGroup"; + } + if (attributeId == 3L) { + return "SceneValid"; + } + if (attributeId == 4L) { + return "NameSupport"; + } + if (attributeId == 5L) { + return "LastConfiguredBy"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 6L) { + if (attributeId == 0L) { + return "OnOff"; + } + if (attributeId == 16384L) { + return "GlobalSceneControl"; + } + if (attributeId == 16385L) { + return "OnTime"; + } + if (attributeId == 16386L) { + return "OffWaitTime"; + } + if (attributeId == 16387L) { + return "StartUpOnOff"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 7L) { + if (attributeId == 0L) { + return "SwitchType"; + } + if (attributeId == 16L) { + return "SwitchActions"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 8L) { + if (attributeId == 0L) { + return "CurrentLevel"; + } + if (attributeId == 1L) { + return "RemainingTime"; + } + if (attributeId == 2L) { + return "MinLevel"; + } + if (attributeId == 3L) { + return "MaxLevel"; + } + if (attributeId == 4L) { + return "CurrentFrequency"; + } + if (attributeId == 5L) { + return "MinFrequency"; + } + if (attributeId == 6L) { + return "MaxFrequency"; + } + if (attributeId == 15L) { + return "Options"; + } + if (attributeId == 16L) { + return "OnOffTransitionTime"; + } + if (attributeId == 17L) { + return "OnLevel"; + } + if (attributeId == 18L) { + return "OnTransitionTime"; + } + if (attributeId == 19L) { + return "OffTransitionTime"; + } + if (attributeId == 20L) { + return "DefaultMoveRate"; + } + if (attributeId == 16384L) { + return "StartUpCurrentLevel"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 15L) { + if (attributeId == 4L) { + return "ActiveText"; + } + if (attributeId == 28L) { + return "Description"; + } + if (attributeId == 46L) { + return "InactiveText"; + } + if (attributeId == 81L) { + return "OutOfService"; + } + if (attributeId == 84L) { + return "Polarity"; + } + if (attributeId == 85L) { + return "PresentValue"; + } + if (attributeId == 103L) { + return "Reliability"; + } + if (attributeId == 111L) { + return "StatusFlags"; + } + if (attributeId == 256L) { + return "ApplicationType"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 29L) { + if (attributeId == 0L) { + return "DeviceTypeList"; + } + if (attributeId == 1L) { + return "ServerList"; + } + if (attributeId == 2L) { + return "ClientList"; + } + if (attributeId == 3L) { + return "PartsList"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 30L) { + if (attributeId == 0L) { + return "Binding"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 31L) { + if (attributeId == 0L) { + return "Acl"; + } + if (attributeId == 1L) { + return "Extension"; + } + if (attributeId == 2L) { + return "SubjectsPerAccessControlEntry"; + } + if (attributeId == 3L) { + return "TargetsPerAccessControlEntry"; + } + if (attributeId == 4L) { + return "AccessControlEntriesPerFabric"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 37L) { + if (attributeId == 0L) { + return "ActionList"; + } + if (attributeId == 1L) { + return "EndpointLists"; + } + if (attributeId == 2L) { + return "SetupURL"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 40L) { + if (attributeId == 0L) { + return "DataModelRevision"; + } + if (attributeId == 1L) { + return "VendorName"; + } + if (attributeId == 2L) { + return "VendorID"; + } + if (attributeId == 3L) { + return "ProductName"; + } + if (attributeId == 4L) { + return "ProductID"; + } + if (attributeId == 5L) { + return "NodeLabel"; + } + if (attributeId == 6L) { + return "Location"; + } + if (attributeId == 7L) { + return "HardwareVersion"; + } + if (attributeId == 8L) { + return "HardwareVersionString"; + } + if (attributeId == 9L) { + return "SoftwareVersion"; + } + if (attributeId == 10L) { + return "SoftwareVersionString"; + } + if (attributeId == 11L) { + return "ManufacturingDate"; + } + if (attributeId == 12L) { + return "PartNumber"; + } + if (attributeId == 13L) { + return "ProductURL"; + } + if (attributeId == 14L) { + return "ProductLabel"; + } + if (attributeId == 15L) { + return "SerialNumber"; + } + if (attributeId == 16L) { + return "LocalConfigDisabled"; + } + if (attributeId == 17L) { + return "Reachable"; + } + if (attributeId == 18L) { + return "UniqueID"; + } + if (attributeId == 19L) { + return "CapabilityMinima"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 41L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 42L) { + if (attributeId == 0L) { + return "DefaultOTAProviders"; + } + if (attributeId == 1L) { + return "UpdatePossible"; + } + if (attributeId == 2L) { + return "UpdateState"; + } + if (attributeId == 3L) { + return "UpdateStateProgress"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 43L) { + if (attributeId == 0L) { + return "ActiveLocale"; + } + if (attributeId == 1L) { + return "SupportedLocales"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 44L) { + if (attributeId == 0L) { + return "HourFormat"; + } + if (attributeId == 1L) { + return "ActiveCalendarType"; + } + if (attributeId == 2L) { + return "SupportedCalendarTypes"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 45L) { + if (attributeId == 0L) { + return "TemperatureUnit"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 46L) { + if (attributeId == 0L) { + return "Sources"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 47L) { + if (attributeId == 0L) { + return "Status"; + } + if (attributeId == 1L) { + return "Order"; + } + if (attributeId == 2L) { + return "Description"; + } + if (attributeId == 3L) { + return "WiredAssessedInputVoltage"; + } + if (attributeId == 4L) { + return "WiredAssessedInputFrequency"; + } + if (attributeId == 5L) { + return "WiredCurrentType"; + } + if (attributeId == 6L) { + return "WiredAssessedCurrent"; + } + if (attributeId == 7L) { + return "WiredNominalVoltage"; + } + if (attributeId == 8L) { + return "WiredMaximumCurrent"; + } + if (attributeId == 9L) { + return "WiredPresent"; + } + if (attributeId == 10L) { + return "ActiveWiredFaults"; + } + if (attributeId == 11L) { + return "BatVoltage"; + } + if (attributeId == 12L) { + return "BatPercentRemaining"; + } + if (attributeId == 13L) { + return "BatTimeRemaining"; + } + if (attributeId == 14L) { + return "BatChargeLevel"; + } + if (attributeId == 15L) { + return "BatReplacementNeeded"; + } + if (attributeId == 16L) { + return "BatReplaceability"; + } + if (attributeId == 17L) { + return "BatPresent"; + } + if (attributeId == 18L) { + return "ActiveBatFaults"; + } + if (attributeId == 19L) { + return "BatReplacementDescription"; + } + if (attributeId == 20L) { + return "BatCommonDesignation"; + } + if (attributeId == 21L) { + return "BatANSIDesignation"; + } + if (attributeId == 22L) { + return "BatIECDesignation"; + } + if (attributeId == 23L) { + return "BatApprovedChemistry"; + } + if (attributeId == 24L) { + return "BatCapacity"; + } + if (attributeId == 25L) { + return "BatQuantity"; + } + if (attributeId == 26L) { + return "BatChargeState"; + } + if (attributeId == 27L) { + return "BatTimeToFullCharge"; + } + if (attributeId == 28L) { + return "BatFunctionalWhileCharging"; + } + if (attributeId == 29L) { + return "BatChargingCurrent"; + } + if (attributeId == 30L) { + return "ActiveBatChargeFaults"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 48L) { + if (attributeId == 0L) { + return "Breadcrumb"; + } + if (attributeId == 1L) { + return "BasicCommissioningInfo"; + } + if (attributeId == 2L) { + return "RegulatoryConfig"; + } + if (attributeId == 3L) { + return "LocationCapability"; + } + if (attributeId == 4L) { + return "SupportsConcurrentConnection"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 49L) { + if (attributeId == 0L) { + return "MaxNetworks"; + } + if (attributeId == 1L) { + return "Networks"; + } + if (attributeId == 2L) { + return "ScanMaxTimeSeconds"; + } + if (attributeId == 3L) { + return "ConnectMaxTimeSeconds"; + } + if (attributeId == 4L) { + return "InterfaceEnabled"; + } + if (attributeId == 5L) { + return "LastNetworkingStatus"; + } + if (attributeId == 6L) { + return "LastNetworkID"; + } + if (attributeId == 7L) { + return "LastConnectErrorValue"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 50L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 51L) { + if (attributeId == 0L) { + return "NetworkInterfaces"; + } + if (attributeId == 1L) { + return "RebootCount"; + } + if (attributeId == 2L) { + return "UpTime"; + } + if (attributeId == 3L) { + return "TotalOperationalHours"; + } + if (attributeId == 4L) { + return "BootReason"; + } + if (attributeId == 5L) { + return "ActiveHardwareFaults"; + } + if (attributeId == 6L) { + return "ActiveRadioFaults"; + } + if (attributeId == 7L) { + return "ActiveNetworkFaults"; + } + if (attributeId == 8L) { + return "TestEventTriggersEnabled"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 52L) { + if (attributeId == 0L) { + return "ThreadMetrics"; + } + if (attributeId == 1L) { + return "CurrentHeapFree"; + } + if (attributeId == 2L) { + return "CurrentHeapUsed"; + } + if (attributeId == 3L) { + return "CurrentHeapHighWatermark"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 53L) { + if (attributeId == 0L) { + return "Channel"; + } + if (attributeId == 1L) { + return "RoutingRole"; + } + if (attributeId == 2L) { + return "NetworkName"; + } + if (attributeId == 3L) { + return "PanId"; + } + if (attributeId == 4L) { + return "ExtendedPanId"; + } + if (attributeId == 5L) { + return "MeshLocalPrefix"; + } + if (attributeId == 6L) { + return "OverrunCount"; + } + if (attributeId == 7L) { + return "NeighborTable"; + } + if (attributeId == 8L) { + return "RouteTable"; + } + if (attributeId == 9L) { + return "PartitionId"; + } + if (attributeId == 10L) { + return "Weighting"; + } + if (attributeId == 11L) { + return "DataVersion"; + } + if (attributeId == 12L) { + return "StableDataVersion"; + } + if (attributeId == 13L) { + return "LeaderRouterId"; + } + if (attributeId == 14L) { + return "DetachedRoleCount"; + } + if (attributeId == 15L) { + return "ChildRoleCount"; + } + if (attributeId == 16L) { + return "RouterRoleCount"; + } + if (attributeId == 17L) { + return "LeaderRoleCount"; + } + if (attributeId == 18L) { + return "AttachAttemptCount"; + } + if (attributeId == 19L) { + return "PartitionIdChangeCount"; + } + if (attributeId == 20L) { + return "BetterPartitionAttachAttemptCount"; + } + if (attributeId == 21L) { + return "ParentChangeCount"; + } + if (attributeId == 22L) { + return "TxTotalCount"; + } + if (attributeId == 23L) { + return "TxUnicastCount"; + } + if (attributeId == 24L) { + return "TxBroadcastCount"; + } + if (attributeId == 25L) { + return "TxAckRequestedCount"; + } + if (attributeId == 26L) { + return "TxAckedCount"; + } + if (attributeId == 27L) { + return "TxNoAckRequestedCount"; + } + if (attributeId == 28L) { + return "TxDataCount"; + } + if (attributeId == 29L) { + return "TxDataPollCount"; + } + if (attributeId == 30L) { + return "TxBeaconCount"; + } + if (attributeId == 31L) { + return "TxBeaconRequestCount"; + } + if (attributeId == 32L) { + return "TxOtherCount"; + } + if (attributeId == 33L) { + return "TxRetryCount"; + } + if (attributeId == 34L) { + return "TxDirectMaxRetryExpiryCount"; + } + if (attributeId == 35L) { + return "TxIndirectMaxRetryExpiryCount"; + } + if (attributeId == 36L) { + return "TxErrCcaCount"; + } + if (attributeId == 37L) { + return "TxErrAbortCount"; + } + if (attributeId == 38L) { + return "TxErrBusyChannelCount"; + } + if (attributeId == 39L) { + return "RxTotalCount"; + } + if (attributeId == 40L) { + return "RxUnicastCount"; + } + if (attributeId == 41L) { + return "RxBroadcastCount"; + } + if (attributeId == 42L) { + return "RxDataCount"; + } + if (attributeId == 43L) { + return "RxDataPollCount"; + } + if (attributeId == 44L) { + return "RxBeaconCount"; + } + if (attributeId == 45L) { + return "RxBeaconRequestCount"; + } + if (attributeId == 46L) { + return "RxOtherCount"; + } + if (attributeId == 47L) { + return "RxAddressFilteredCount"; + } + if (attributeId == 48L) { + return "RxDestAddrFilteredCount"; + } + if (attributeId == 49L) { + return "RxDuplicatedCount"; + } + if (attributeId == 50L) { + return "RxErrNoFrameCount"; + } + if (attributeId == 51L) { + return "RxErrUnknownNeighborCount"; + } + if (attributeId == 52L) { + return "RxErrInvalidSrcAddrCount"; + } + if (attributeId == 53L) { + return "RxErrSecCount"; + } + if (attributeId == 54L) { + return "RxErrFcsCount"; + } + if (attributeId == 55L) { + return "RxErrOtherCount"; + } + if (attributeId == 56L) { + return "ActiveTimestamp"; + } + if (attributeId == 57L) { + return "PendingTimestamp"; + } + if (attributeId == 58L) { + return "Delay"; + } + if (attributeId == 59L) { + return "SecurityPolicy"; + } + if (attributeId == 60L) { + return "ChannelPage0Mask"; + } + if (attributeId == 61L) { + return "OperationalDatasetComponents"; + } + if (attributeId == 62L) { + return "ActiveNetworkFaultsList"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 54L) { + if (attributeId == 0L) { + return "Bssid"; + } + if (attributeId == 1L) { + return "SecurityType"; + } + if (attributeId == 2L) { + return "WiFiVersion"; + } + if (attributeId == 3L) { + return "ChannelNumber"; + } + if (attributeId == 4L) { + return "Rssi"; + } + if (attributeId == 5L) { + return "BeaconLostCount"; + } + if (attributeId == 6L) { + return "BeaconRxCount"; + } + if (attributeId == 7L) { + return "PacketMulticastRxCount"; + } + if (attributeId == 8L) { + return "PacketMulticastTxCount"; + } + if (attributeId == 9L) { + return "PacketUnicastRxCount"; + } + if (attributeId == 10L) { + return "PacketUnicastTxCount"; + } + if (attributeId == 11L) { + return "CurrentMaxRate"; + } + if (attributeId == 12L) { + return "OverrunCount"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 55L) { + if (attributeId == 0L) { + return "PHYRate"; + } + if (attributeId == 1L) { + return "FullDuplex"; + } + if (attributeId == 2L) { + return "PacketRxCount"; + } + if (attributeId == 3L) { + return "PacketTxCount"; + } + if (attributeId == 4L) { + return "TxErrCount"; + } + if (attributeId == 5L) { + return "CollisionCount"; + } + if (attributeId == 6L) { + return "OverrunCount"; + } + if (attributeId == 7L) { + return "CarrierDetect"; + } + if (attributeId == 8L) { + return "TimeSinceReset"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 57L) { + if (attributeId == 1L) { + return "VendorName"; + } + if (attributeId == 2L) { + return "VendorID"; + } + if (attributeId == 3L) { + return "ProductName"; + } + if (attributeId == 5L) { + return "NodeLabel"; + } + if (attributeId == 7L) { + return "HardwareVersion"; + } + if (attributeId == 8L) { + return "HardwareVersionString"; + } + if (attributeId == 9L) { + return "SoftwareVersion"; + } + if (attributeId == 10L) { + return "SoftwareVersionString"; + } + if (attributeId == 11L) { + return "ManufacturingDate"; + } + if (attributeId == 12L) { + return "PartNumber"; + } + if (attributeId == 13L) { + return "ProductURL"; + } + if (attributeId == 14L) { + return "ProductLabel"; + } + if (attributeId == 15L) { + return "SerialNumber"; + } + if (attributeId == 17L) { + return "Reachable"; + } + if (attributeId == 18L) { + return "UniqueID"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 59L) { + if (attributeId == 0L) { + return "NumberOfPositions"; + } + if (attributeId == 1L) { + return "CurrentPosition"; + } + if (attributeId == 2L) { + return "MultiPressMax"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 60L) { + if (attributeId == 0L) { + return "WindowStatus"; + } + if (attributeId == 1L) { + return "AdminFabricIndex"; + } + if (attributeId == 2L) { + return "AdminVendorId"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 62L) { + if (attributeId == 0L) { + return "NOCs"; + } + if (attributeId == 1L) { + return "Fabrics"; + } + if (attributeId == 2L) { + return "SupportedFabrics"; + } + if (attributeId == 3L) { + return "CommissionedFabrics"; + } + if (attributeId == 4L) { + return "TrustedRootCertificates"; + } + if (attributeId == 5L) { + return "CurrentFabricIndex"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 63L) { + if (attributeId == 0L) { + return "GroupKeyMap"; + } + if (attributeId == 1L) { + return "GroupTable"; + } + if (attributeId == 2L) { + return "MaxGroupsPerFabric"; + } + if (attributeId == 3L) { + return "MaxGroupKeysPerFabric"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 64L) { + if (attributeId == 0L) { + return "LabelList"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 65L) { + if (attributeId == 0L) { + return "LabelList"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 69L) { + if (attributeId == 0L) { + return "StateValue"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 80L) { + if (attributeId == 0L) { + return "Description"; + } + if (attributeId == 1L) { + return "StandardNamespace"; + } + if (attributeId == 2L) { + return "SupportedModes"; + } + if (attributeId == 3L) { + return "CurrentMode"; + } + if (attributeId == 4L) { + return "StartUpMode"; + } + if (attributeId == 5L) { + return "OnMode"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + if (attributeId == 4293984257L) { + return "ManufacturerExtension"; + } + return ""; + } + if (clusterId == 257L) { + if (attributeId == 0L) { + return "LockState"; + } + if (attributeId == 1L) { + return "LockType"; + } + if (attributeId == 2L) { + return "ActuatorEnabled"; + } + if (attributeId == 3L) { + return "DoorState"; + } + if (attributeId == 4L) { + return "DoorOpenEvents"; + } + if (attributeId == 5L) { + return "DoorClosedEvents"; + } + if (attributeId == 6L) { + return "OpenPeriod"; + } + if (attributeId == 17L) { + return "NumberOfTotalUsersSupported"; + } + if (attributeId == 18L) { + return "NumberOfPINUsersSupported"; + } + if (attributeId == 19L) { + return "NumberOfRFIDUsersSupported"; + } + if (attributeId == 20L) { + return "NumberOfWeekDaySchedulesSupportedPerUser"; + } + if (attributeId == 21L) { + return "NumberOfYearDaySchedulesSupportedPerUser"; + } + if (attributeId == 22L) { + return "NumberOfHolidaySchedulesSupported"; + } + if (attributeId == 23L) { + return "MaxPINCodeLength"; + } + if (attributeId == 24L) { + return "MinPINCodeLength"; + } + if (attributeId == 25L) { + return "MaxRFIDCodeLength"; + } + if (attributeId == 26L) { + return "MinRFIDCodeLength"; + } + if (attributeId == 27L) { + return "CredentialRulesSupport"; + } + if (attributeId == 28L) { + return "NumberOfCredentialsSupportedPerUser"; + } + if (attributeId == 33L) { + return "Language"; + } + if (attributeId == 34L) { + return "LEDSettings"; + } + if (attributeId == 35L) { + return "AutoRelockTime"; + } + if (attributeId == 36L) { + return "SoundVolume"; + } + if (attributeId == 37L) { + return "OperatingMode"; + } + if (attributeId == 38L) { + return "SupportedOperatingModes"; + } + if (attributeId == 39L) { + return "DefaultConfigurationRegister"; + } + if (attributeId == 40L) { + return "EnableLocalProgramming"; + } + if (attributeId == 41L) { + return "EnableOneTouchLocking"; + } + if (attributeId == 42L) { + return "EnableInsideStatusLED"; + } + if (attributeId == 43L) { + return "EnablePrivacyModeButton"; + } + if (attributeId == 44L) { + return "LocalProgrammingFeatures"; + } + if (attributeId == 48L) { + return "WrongCodeEntryLimit"; + } + if (attributeId == 49L) { + return "UserCodeTemporaryDisableTime"; + } + if (attributeId == 50L) { + return "SendPINOverTheAir"; + } + if (attributeId == 51L) { + return "RequirePINforRemoteOperation"; + } + if (attributeId == 53L) { + return "ExpiringUserTimeout"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 258L) { + if (attributeId == 0L) { + return "Type"; + } + if (attributeId == 1L) { + return "PhysicalClosedLimitLift"; + } + if (attributeId == 2L) { + return "PhysicalClosedLimitTilt"; + } + if (attributeId == 3L) { + return "CurrentPositionLift"; + } + if (attributeId == 4L) { + return "CurrentPositionTilt"; + } + if (attributeId == 5L) { + return "NumberOfActuationsLift"; + } + if (attributeId == 6L) { + return "NumberOfActuationsTilt"; + } + if (attributeId == 7L) { + return "ConfigStatus"; + } + if (attributeId == 8L) { + return "CurrentPositionLiftPercentage"; + } + if (attributeId == 9L) { + return "CurrentPositionTiltPercentage"; + } + if (attributeId == 10L) { + return "OperationalStatus"; + } + if (attributeId == 11L) { + return "TargetPositionLiftPercent100ths"; + } + if (attributeId == 12L) { + return "TargetPositionTiltPercent100ths"; + } + if (attributeId == 13L) { + return "EndProductType"; + } + if (attributeId == 14L) { + return "CurrentPositionLiftPercent100ths"; + } + if (attributeId == 15L) { + return "CurrentPositionTiltPercent100ths"; + } + if (attributeId == 16L) { + return "InstalledOpenLimitLift"; + } + if (attributeId == 17L) { + return "InstalledClosedLimitLift"; + } + if (attributeId == 18L) { + return "InstalledOpenLimitTilt"; + } + if (attributeId == 19L) { + return "InstalledClosedLimitTilt"; + } + if (attributeId == 23L) { + return "Mode"; + } + if (attributeId == 26L) { + return "SafetyStatus"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 259L) { + if (attributeId == 1L) { + return "BarrierMovingState"; + } + if (attributeId == 2L) { + return "BarrierSafetyStatus"; + } + if (attributeId == 3L) { + return "BarrierCapabilities"; + } + if (attributeId == 4L) { + return "BarrierOpenEvents"; + } + if (attributeId == 5L) { + return "BarrierCloseEvents"; + } + if (attributeId == 6L) { + return "BarrierCommandOpenEvents"; + } + if (attributeId == 7L) { + return "BarrierCommandCloseEvents"; + } + if (attributeId == 8L) { + return "BarrierOpenPeriod"; + } + if (attributeId == 9L) { + return "BarrierClosePeriod"; + } + if (attributeId == 10L) { + return "BarrierPosition"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 512L) { + if (attributeId == 0L) { + return "MaxPressure"; + } + if (attributeId == 1L) { + return "MaxSpeed"; + } + if (attributeId == 2L) { + return "MaxFlow"; + } + if (attributeId == 3L) { + return "MinConstPressure"; + } + if (attributeId == 4L) { + return "MaxConstPressure"; + } + if (attributeId == 5L) { + return "MinCompPressure"; + } + if (attributeId == 6L) { + return "MaxCompPressure"; + } + if (attributeId == 7L) { + return "MinConstSpeed"; + } + if (attributeId == 8L) { + return "MaxConstSpeed"; + } + if (attributeId == 9L) { + return "MinConstFlow"; + } + if (attributeId == 10L) { + return "MaxConstFlow"; + } + if (attributeId == 11L) { + return "MinConstTemp"; + } + if (attributeId == 12L) { + return "MaxConstTemp"; + } + if (attributeId == 16L) { + return "PumpStatus"; + } + if (attributeId == 17L) { + return "EffectiveOperationMode"; + } + if (attributeId == 18L) { + return "EffectiveControlMode"; + } + if (attributeId == 19L) { + return "Capacity"; + } + if (attributeId == 20L) { + return "Speed"; + } + if (attributeId == 21L) { + return "LifetimeRunningHours"; + } + if (attributeId == 22L) { + return "Power"; + } + if (attributeId == 23L) { + return "LifetimeEnergyConsumed"; + } + if (attributeId == 32L) { + return "OperationMode"; + } + if (attributeId == 33L) { + return "ControlMode"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 513L) { + if (attributeId == 0L) { + return "LocalTemperature"; + } + if (attributeId == 1L) { + return "OutdoorTemperature"; + } + if (attributeId == 2L) { + return "Occupancy"; + } + if (attributeId == 3L) { + return "AbsMinHeatSetpointLimit"; + } + if (attributeId == 4L) { + return "AbsMaxHeatSetpointLimit"; + } + if (attributeId == 5L) { + return "AbsMinCoolSetpointLimit"; + } + if (attributeId == 6L) { + return "AbsMaxCoolSetpointLimit"; + } + if (attributeId == 7L) { + return "PICoolingDemand"; + } + if (attributeId == 8L) { + return "PIHeatingDemand"; + } + if (attributeId == 9L) { + return "HVACSystemTypeConfiguration"; + } + if (attributeId == 16L) { + return "LocalTemperatureCalibration"; + } + if (attributeId == 17L) { + return "OccupiedCoolingSetpoint"; + } + if (attributeId == 18L) { + return "OccupiedHeatingSetpoint"; + } + if (attributeId == 19L) { + return "UnoccupiedCoolingSetpoint"; + } + if (attributeId == 20L) { + return "UnoccupiedHeatingSetpoint"; + } + if (attributeId == 21L) { + return "MinHeatSetpointLimit"; + } + if (attributeId == 22L) { + return "MaxHeatSetpointLimit"; + } + if (attributeId == 23L) { + return "MinCoolSetpointLimit"; + } + if (attributeId == 24L) { + return "MaxCoolSetpointLimit"; + } + if (attributeId == 25L) { + return "MinSetpointDeadBand"; + } + if (attributeId == 26L) { + return "RemoteSensing"; + } + if (attributeId == 27L) { + return "ControlSequenceOfOperation"; + } + if (attributeId == 28L) { + return "SystemMode"; + } + if (attributeId == 30L) { + return "ThermostatRunningMode"; + } + if (attributeId == 32L) { + return "StartOfWeek"; + } + if (attributeId == 33L) { + return "NumberOfWeeklyTransitions"; + } + if (attributeId == 34L) { + return "NumberOfDailyTransitions"; + } + if (attributeId == 35L) { + return "TemperatureSetpointHold"; + } + if (attributeId == 36L) { + return "TemperatureSetpointHoldDuration"; + } + if (attributeId == 37L) { + return "ThermostatProgrammingOperationMode"; + } + if (attributeId == 41L) { + return "ThermostatRunningState"; + } + if (attributeId == 48L) { + return "SetpointChangeSource"; + } + if (attributeId == 49L) { + return "SetpointChangeAmount"; + } + if (attributeId == 50L) { + return "SetpointChangeSourceTimestamp"; + } + if (attributeId == 52L) { + return "OccupiedSetback"; + } + if (attributeId == 53L) { + return "OccupiedSetbackMin"; + } + if (attributeId == 54L) { + return "OccupiedSetbackMax"; + } + if (attributeId == 55L) { + return "UnoccupiedSetback"; + } + if (attributeId == 56L) { + return "UnoccupiedSetbackMin"; + } + if (attributeId == 57L) { + return "UnoccupiedSetbackMax"; + } + if (attributeId == 58L) { + return "EmergencyHeatDelta"; + } + if (attributeId == 64L) { + return "ACType"; + } + if (attributeId == 65L) { + return "ACCapacity"; + } + if (attributeId == 66L) { + return "ACRefrigerantType"; + } + if (attributeId == 67L) { + return "ACCompressorType"; + } + if (attributeId == 68L) { + return "ACErrorCode"; + } + if (attributeId == 69L) { + return "ACLouverPosition"; + } + if (attributeId == 70L) { + return "ACCoilTemperature"; + } + if (attributeId == 71L) { + return "ACCapacityformat"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 514L) { + if (attributeId == 0L) { + return "FanMode"; + } + if (attributeId == 1L) { + return "FanModeSequence"; + } + if (attributeId == 2L) { + return "PercentSetting"; + } + if (attributeId == 3L) { + return "PercentCurrent"; + } + if (attributeId == 4L) { + return "SpeedMax"; + } + if (attributeId == 5L) { + return "SpeedSetting"; + } + if (attributeId == 6L) { + return "SpeedCurrent"; + } + if (attributeId == 7L) { + return "RockSupport"; + } + if (attributeId == 8L) { + return "RockSetting"; + } + if (attributeId == 9L) { + return "WindSupport"; + } + if (attributeId == 10L) { + return "WindSetting"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 516L) { + if (attributeId == 0L) { + return "TemperatureDisplayMode"; + } + if (attributeId == 1L) { + return "KeypadLockout"; + } + if (attributeId == 2L) { + return "ScheduleProgrammingVisibility"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 768L) { + if (attributeId == 0L) { + return "CurrentHue"; + } + if (attributeId == 1L) { + return "CurrentSaturation"; + } + if (attributeId == 2L) { + return "RemainingTime"; + } + if (attributeId == 3L) { + return "CurrentX"; + } + if (attributeId == 4L) { + return "CurrentY"; + } + if (attributeId == 5L) { + return "DriftCompensation"; + } + if (attributeId == 6L) { + return "CompensationText"; + } + if (attributeId == 7L) { + return "ColorTemperatureMireds"; + } + if (attributeId == 8L) { + return "ColorMode"; + } + if (attributeId == 15L) { + return "Options"; + } + if (attributeId == 16L) { + return "NumberOfPrimaries"; + } + if (attributeId == 17L) { + return "Primary1X"; + } + if (attributeId == 18L) { + return "Primary1Y"; + } + if (attributeId == 19L) { + return "Primary1Intensity"; + } + if (attributeId == 21L) { + return "Primary2X"; + } + if (attributeId == 22L) { + return "Primary2Y"; + } + if (attributeId == 23L) { + return "Primary2Intensity"; + } + if (attributeId == 25L) { + return "Primary3X"; + } + if (attributeId == 26L) { + return "Primary3Y"; + } + if (attributeId == 27L) { + return "Primary3Intensity"; + } + if (attributeId == 32L) { + return "Primary4X"; + } + if (attributeId == 33L) { + return "Primary4Y"; + } + if (attributeId == 34L) { + return "Primary4Intensity"; + } + if (attributeId == 36L) { + return "Primary5X"; + } + if (attributeId == 37L) { + return "Primary5Y"; + } + if (attributeId == 38L) { + return "Primary5Intensity"; + } + if (attributeId == 40L) { + return "Primary6X"; + } + if (attributeId == 41L) { + return "Primary6Y"; + } + if (attributeId == 42L) { + return "Primary6Intensity"; + } + if (attributeId == 48L) { + return "WhitePointX"; + } + if (attributeId == 49L) { + return "WhitePointY"; + } + if (attributeId == 50L) { + return "ColorPointRX"; + } + if (attributeId == 51L) { + return "ColorPointRY"; + } + if (attributeId == 52L) { + return "ColorPointRIntensity"; + } + if (attributeId == 54L) { + return "ColorPointGX"; + } + if (attributeId == 55L) { + return "ColorPointGY"; + } + if (attributeId == 56L) { + return "ColorPointGIntensity"; + } + if (attributeId == 58L) { + return "ColorPointBX"; + } + if (attributeId == 59L) { + return "ColorPointBY"; + } + if (attributeId == 60L) { + return "ColorPointBIntensity"; + } + if (attributeId == 16384L) { + return "EnhancedCurrentHue"; + } + if (attributeId == 16385L) { + return "EnhancedColorMode"; + } + if (attributeId == 16386L) { + return "ColorLoopActive"; + } + if (attributeId == 16387L) { + return "ColorLoopDirection"; + } + if (attributeId == 16388L) { + return "ColorLoopTime"; + } + if (attributeId == 16389L) { + return "ColorLoopStartEnhancedHue"; + } + if (attributeId == 16390L) { + return "ColorLoopStoredEnhancedHue"; + } + if (attributeId == 16394L) { + return "ColorCapabilities"; + } + if (attributeId == 16395L) { + return "ColorTempPhysicalMinMireds"; + } + if (attributeId == 16396L) { + return "ColorTempPhysicalMaxMireds"; + } + if (attributeId == 16397L) { + return "CoupleColorTempToLevelMinMireds"; + } + if (attributeId == 16400L) { + return "StartUpColorTemperatureMireds"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 769L) { + if (attributeId == 0L) { + return "PhysicalMinLevel"; + } + if (attributeId == 1L) { + return "PhysicalMaxLevel"; + } + if (attributeId == 2L) { + return "BallastStatus"; + } + if (attributeId == 16L) { + return "MinLevel"; + } + if (attributeId == 17L) { + return "MaxLevel"; + } + if (attributeId == 20L) { + return "IntrinsicBallastFactor"; + } + if (attributeId == 21L) { + return "BallastFactorAdjustment"; + } + if (attributeId == 32L) { + return "LampQuantity"; + } + if (attributeId == 48L) { + return "LampType"; + } + if (attributeId == 49L) { + return "LampManufacturer"; + } + if (attributeId == 50L) { + return "LampRatedHours"; + } + if (attributeId == 51L) { + return "LampBurnHours"; + } + if (attributeId == 52L) { + return "LampAlarmMode"; + } + if (attributeId == 53L) { + return "LampBurnHoursTripPoint"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1024L) { + if (attributeId == 0L) { + return "MeasuredValue"; + } + if (attributeId == 1L) { + return "MinMeasuredValue"; + } + if (attributeId == 2L) { + return "MaxMeasuredValue"; + } + if (attributeId == 3L) { + return "Tolerance"; + } + if (attributeId == 4L) { + return "LightSensorType"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1026L) { + if (attributeId == 0L) { + return "MeasuredValue"; + } + if (attributeId == 1L) { + return "MinMeasuredValue"; + } + if (attributeId == 2L) { + return "MaxMeasuredValue"; + } + if (attributeId == 3L) { + return "Tolerance"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1027L) { + if (attributeId == 0L) { + return "MeasuredValue"; + } + if (attributeId == 1L) { + return "MinMeasuredValue"; + } + if (attributeId == 2L) { + return "MaxMeasuredValue"; + } + if (attributeId == 3L) { + return "Tolerance"; + } + if (attributeId == 16L) { + return "ScaledValue"; + } + if (attributeId == 17L) { + return "MinScaledValue"; + } + if (attributeId == 18L) { + return "MaxScaledValue"; + } + if (attributeId == 19L) { + return "ScaledTolerance"; + } + if (attributeId == 20L) { + return "Scale"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1028L) { + if (attributeId == 0L) { + return "MeasuredValue"; + } + if (attributeId == 1L) { + return "MinMeasuredValue"; + } + if (attributeId == 2L) { + return "MaxMeasuredValue"; + } + if (attributeId == 3L) { + return "Tolerance"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1029L) { + if (attributeId == 0L) { + return "MeasuredValue"; + } + if (attributeId == 1L) { + return "MinMeasuredValue"; + } + if (attributeId == 2L) { + return "MaxMeasuredValue"; + } + if (attributeId == 3L) { + return "Tolerance"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1030L) { + if (attributeId == 0L) { + return "Occupancy"; + } + if (attributeId == 1L) { + return "OccupancySensorType"; + } + if (attributeId == 2L) { + return "OccupancySensorTypeBitmap"; + } + if (attributeId == 16L) { + return "PIROccupiedToUnoccupiedDelay"; + } + if (attributeId == 17L) { + return "PIRUnoccupiedToOccupiedDelay"; + } + if (attributeId == 18L) { + return "PIRUnoccupiedToOccupiedThreshold"; + } + if (attributeId == 32L) { + return "UltrasonicOccupiedToUnoccupiedDelay"; + } + if (attributeId == 33L) { + return "UltrasonicUnoccupiedToOccupiedDelay"; + } + if (attributeId == 34L) { + return "UltrasonicUnoccupiedToOccupiedThreshold"; + } + if (attributeId == 48L) { + return "PhysicalContactOccupiedToUnoccupiedDelay"; + } + if (attributeId == 49L) { + return "PhysicalContactUnoccupiedToOccupiedDelay"; + } + if (attributeId == 50L) { + return "PhysicalContactUnoccupiedToOccupiedThreshold"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1283L) { + if (attributeId == 0L) { + return "MACAddress"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1284L) { + if (attributeId == 0L) { + return "ChannelList"; + } + if (attributeId == 1L) { + return "Lineup"; + } + if (attributeId == 2L) { + return "CurrentChannel"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1285L) { + if (attributeId == 0L) { + return "TargetList"; + } + if (attributeId == 1L) { + return "CurrentTarget"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1286L) { + if (attributeId == 0L) { + return "CurrentState"; + } + if (attributeId == 1L) { + return "StartTime"; + } + if (attributeId == 2L) { + return "Duration"; + } + if (attributeId == 3L) { + return "SampledPosition"; + } + if (attributeId == 4L) { + return "PlaybackSpeed"; + } + if (attributeId == 5L) { + return "SeekRangeEnd"; + } + if (attributeId == 6L) { + return "SeekRangeStart"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1287L) { + if (attributeId == 0L) { + return "InputList"; + } + if (attributeId == 1L) { + return "CurrentInput"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1288L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1289L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1290L) { + if (attributeId == 0L) { + return "AcceptHeader"; + } + if (attributeId == 1L) { + return "SupportedStreamingProtocols"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1291L) { + if (attributeId == 0L) { + return "OutputList"; + } + if (attributeId == 1L) { + return "CurrentOutput"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1292L) { + if (attributeId == 0L) { + return "CatalogList"; + } + if (attributeId == 1L) { + return "CurrentApp"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1293L) { + if (attributeId == 0L) { + return "VendorName"; + } + if (attributeId == 1L) { + return "VendorID"; + } + if (attributeId == 2L) { + return "ApplicationName"; + } + if (attributeId == 3L) { + return "ProductID"; + } + if (attributeId == 4L) { + return "Application"; + } + if (attributeId == 5L) { + return "Status"; + } + if (attributeId == 6L) { + return "ApplicationVersion"; + } + if (attributeId == 7L) { + return "AllowedVendorList"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 1294L) { + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 2820L) { + if (attributeId == 0L) { + return "MeasurementType"; + } + if (attributeId == 256L) { + return "DcVoltage"; + } + if (attributeId == 257L) { + return "DcVoltageMin"; + } + if (attributeId == 258L) { + return "DcVoltageMax"; + } + if (attributeId == 259L) { + return "DcCurrent"; + } + if (attributeId == 260L) { + return "DcCurrentMin"; + } + if (attributeId == 261L) { + return "DcCurrentMax"; + } + if (attributeId == 262L) { + return "DcPower"; + } + if (attributeId == 263L) { + return "DcPowerMin"; + } + if (attributeId == 264L) { + return "DcPowerMax"; + } + if (attributeId == 512L) { + return "DcVoltageMultiplier"; + } + if (attributeId == 513L) { + return "DcVoltageDivisor"; + } + if (attributeId == 514L) { + return "DcCurrentMultiplier"; + } + if (attributeId == 515L) { + return "DcCurrentDivisor"; + } + if (attributeId == 516L) { + return "DcPowerMultiplier"; + } + if (attributeId == 517L) { + return "DcPowerDivisor"; + } + if (attributeId == 768L) { + return "AcFrequency"; + } + if (attributeId == 769L) { + return "AcFrequencyMin"; + } + if (attributeId == 770L) { + return "AcFrequencyMax"; + } + if (attributeId == 771L) { + return "NeutralCurrent"; + } + if (attributeId == 772L) { + return "TotalActivePower"; + } + if (attributeId == 773L) { + return "TotalReactivePower"; + } + if (attributeId == 774L) { + return "TotalApparentPower"; + } + if (attributeId == 775L) { + return "Measured1stHarmonicCurrent"; + } + if (attributeId == 776L) { + return "Measured3rdHarmonicCurrent"; + } + if (attributeId == 777L) { + return "Measured5thHarmonicCurrent"; + } + if (attributeId == 778L) { + return "Measured7thHarmonicCurrent"; + } + if (attributeId == 779L) { + return "Measured9thHarmonicCurrent"; + } + if (attributeId == 780L) { + return "Measured11thHarmonicCurrent"; + } + if (attributeId == 781L) { + return "MeasuredPhase1stHarmonicCurrent"; + } + if (attributeId == 782L) { + return "MeasuredPhase3rdHarmonicCurrent"; + } + if (attributeId == 783L) { + return "MeasuredPhase5thHarmonicCurrent"; + } + if (attributeId == 784L) { + return "MeasuredPhase7thHarmonicCurrent"; + } + if (attributeId == 785L) { + return "MeasuredPhase9thHarmonicCurrent"; + } + if (attributeId == 786L) { + return "MeasuredPhase11thHarmonicCurrent"; + } + if (attributeId == 1024L) { + return "AcFrequencyMultiplier"; + } + if (attributeId == 1025L) { + return "AcFrequencyDivisor"; + } + if (attributeId == 1026L) { + return "PowerMultiplier"; + } + if (attributeId == 1027L) { + return "PowerDivisor"; + } + if (attributeId == 1028L) { + return "HarmonicCurrentMultiplier"; + } + if (attributeId == 1029L) { + return "PhaseHarmonicCurrentMultiplier"; + } + if (attributeId == 1280L) { + return "InstantaneousVoltage"; + } + if (attributeId == 1281L) { + return "InstantaneousLineCurrent"; + } + if (attributeId == 1282L) { + return "InstantaneousActiveCurrent"; + } + if (attributeId == 1283L) { + return "InstantaneousReactiveCurrent"; + } + if (attributeId == 1284L) { + return "InstantaneousPower"; + } + if (attributeId == 1285L) { + return "RmsVoltage"; + } + if (attributeId == 1286L) { + return "RmsVoltageMin"; + } + if (attributeId == 1287L) { + return "RmsVoltageMax"; + } + if (attributeId == 1288L) { + return "RmsCurrent"; + } + if (attributeId == 1289L) { + return "RmsCurrentMin"; + } + if (attributeId == 1290L) { + return "RmsCurrentMax"; + } + if (attributeId == 1291L) { + return "ActivePower"; + } + if (attributeId == 1292L) { + return "ActivePowerMin"; + } + if (attributeId == 1293L) { + return "ActivePowerMax"; + } + if (attributeId == 1294L) { + return "ReactivePower"; + } + if (attributeId == 1295L) { + return "ApparentPower"; + } + if (attributeId == 1296L) { + return "PowerFactor"; + } + if (attributeId == 1297L) { + return "AverageRmsVoltageMeasurementPeriod"; + } + if (attributeId == 1299L) { + return "AverageRmsUnderVoltageCounter"; + } + if (attributeId == 1300L) { + return "RmsExtremeOverVoltagePeriod"; + } + if (attributeId == 1301L) { + return "RmsExtremeUnderVoltagePeriod"; + } + if (attributeId == 1302L) { + return "RmsVoltageSagPeriod"; + } + if (attributeId == 1303L) { + return "RmsVoltageSwellPeriod"; + } + if (attributeId == 1536L) { + return "AcVoltageMultiplier"; + } + if (attributeId == 1537L) { + return "AcVoltageDivisor"; + } + if (attributeId == 1538L) { + return "AcCurrentMultiplier"; + } + if (attributeId == 1539L) { + return "AcCurrentDivisor"; + } + if (attributeId == 1540L) { + return "AcPowerMultiplier"; + } + if (attributeId == 1541L) { + return "AcPowerDivisor"; + } + if (attributeId == 1792L) { + return "OverloadAlarmsMask"; + } + if (attributeId == 1793L) { + return "VoltageOverload"; + } + if (attributeId == 1794L) { + return "CurrentOverload"; + } + if (attributeId == 2048L) { + return "AcOverloadAlarmsMask"; + } + if (attributeId == 2049L) { + return "AcVoltageOverload"; + } + if (attributeId == 2050L) { + return "AcCurrentOverload"; + } + if (attributeId == 2051L) { + return "AcActivePowerOverload"; + } + if (attributeId == 2052L) { + return "AcReactivePowerOverload"; + } + if (attributeId == 2053L) { + return "AverageRmsOverVoltage"; + } + if (attributeId == 2054L) { + return "AverageRmsUnderVoltage"; + } + if (attributeId == 2055L) { + return "RmsExtremeOverVoltage"; + } + if (attributeId == 2056L) { + return "RmsExtremeUnderVoltage"; + } + if (attributeId == 2057L) { + return "RmsVoltageSag"; + } + if (attributeId == 2058L) { + return "RmsVoltageSwell"; + } + if (attributeId == 2305L) { + return "LineCurrentPhaseB"; + } + if (attributeId == 2306L) { + return "ActiveCurrentPhaseB"; + } + if (attributeId == 2307L) { + return "ReactiveCurrentPhaseB"; + } + if (attributeId == 2309L) { + return "RmsVoltagePhaseB"; + } + if (attributeId == 2310L) { + return "RmsVoltageMinPhaseB"; + } + if (attributeId == 2311L) { + return "RmsVoltageMaxPhaseB"; + } + if (attributeId == 2312L) { + return "RmsCurrentPhaseB"; + } + if (attributeId == 2313L) { + return "RmsCurrentMinPhaseB"; + } + if (attributeId == 2314L) { + return "RmsCurrentMaxPhaseB"; + } + if (attributeId == 2315L) { + return "ActivePowerPhaseB"; + } + if (attributeId == 2316L) { + return "ActivePowerMinPhaseB"; + } + if (attributeId == 2317L) { + return "ActivePowerMaxPhaseB"; + } + if (attributeId == 2318L) { + return "ReactivePowerPhaseB"; + } + if (attributeId == 2319L) { + return "ApparentPowerPhaseB"; + } + if (attributeId == 2320L) { + return "PowerFactorPhaseB"; + } + if (attributeId == 2321L) { + return "AverageRmsVoltageMeasurementPeriodPhaseB"; + } + if (attributeId == 2322L) { + return "AverageRmsOverVoltageCounterPhaseB"; + } + if (attributeId == 2323L) { + return "AverageRmsUnderVoltageCounterPhaseB"; + } + if (attributeId == 2324L) { + return "RmsExtremeOverVoltagePeriodPhaseB"; + } + if (attributeId == 2325L) { + return "RmsExtremeUnderVoltagePeriodPhaseB"; + } + if (attributeId == 2326L) { + return "RmsVoltageSagPeriodPhaseB"; + } + if (attributeId == 2327L) { + return "RmsVoltageSwellPeriodPhaseB"; + } + if (attributeId == 2561L) { + return "LineCurrentPhaseC"; + } + if (attributeId == 2562L) { + return "ActiveCurrentPhaseC"; + } + if (attributeId == 2563L) { + return "ReactiveCurrentPhaseC"; + } + if (attributeId == 2565L) { + return "RmsVoltagePhaseC"; + } + if (attributeId == 2566L) { + return "RmsVoltageMinPhaseC"; + } + if (attributeId == 2567L) { + return "RmsVoltageMaxPhaseC"; + } + if (attributeId == 2568L) { + return "RmsCurrentPhaseC"; + } + if (attributeId == 2569L) { + return "RmsCurrentMinPhaseC"; + } + if (attributeId == 2570L) { + return "RmsCurrentMaxPhaseC"; + } + if (attributeId == 2571L) { + return "ActivePowerPhaseC"; + } + if (attributeId == 2572L) { + return "ActivePowerMinPhaseC"; + } + if (attributeId == 2573L) { + return "ActivePowerMaxPhaseC"; + } + if (attributeId == 2574L) { + return "ReactivePowerPhaseC"; + } + if (attributeId == 2575L) { + return "ApparentPowerPhaseC"; + } + if (attributeId == 2576L) { + return "PowerFactorPhaseC"; + } + if (attributeId == 2577L) { + return "AverageRmsVoltageMeasurementPeriodPhaseC"; + } + if (attributeId == 2578L) { + return "AverageRmsOverVoltageCounterPhaseC"; + } + if (attributeId == 2579L) { + return "AverageRmsUnderVoltageCounterPhaseC"; + } + if (attributeId == 2580L) { + return "RmsExtremeOverVoltagePeriodPhaseC"; + } + if (attributeId == 2581L) { + return "RmsExtremeUnderVoltagePeriodPhaseC"; + } + if (attributeId == 2582L) { + return "RmsVoltageSagPeriodPhaseC"; + } + if (attributeId == 2583L) { + return "RmsVoltageSwellPeriodPhaseC"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 4166L) { + if (attributeId == 0L) { + return "IdleModeInterval"; + } + if (attributeId == 1L) { + return "ActiveModeInterval"; + } + if (attributeId == 2L) { + return "ActiveModeThreshold"; + } + if (attributeId == 3L) { + return "ExpectedClients"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + if (clusterId == 4294048773L) { + if (attributeId == 0L) { + return "Boolean"; + } + if (attributeId == 1L) { + return "Bitmap8"; + } + if (attributeId == 2L) { + return "Bitmap16"; + } + if (attributeId == 3L) { + return "Bitmap32"; + } + if (attributeId == 4L) { + return "Bitmap64"; + } + if (attributeId == 5L) { + return "Int8u"; + } + if (attributeId == 6L) { + return "Int16u"; + } + if (attributeId == 7L) { + return "Int24u"; + } + if (attributeId == 8L) { + return "Int32u"; + } + if (attributeId == 9L) { + return "Int40u"; + } + if (attributeId == 10L) { + return "Int48u"; + } + if (attributeId == 11L) { + return "Int56u"; + } + if (attributeId == 12L) { + return "Int64u"; + } + if (attributeId == 13L) { + return "Int8s"; + } + if (attributeId == 14L) { + return "Int16s"; + } + if (attributeId == 15L) { + return "Int24s"; + } + if (attributeId == 16L) { + return "Int32s"; + } + if (attributeId == 17L) { + return "Int40s"; + } + if (attributeId == 18L) { + return "Int48s"; + } + if (attributeId == 19L) { + return "Int56s"; + } + if (attributeId == 20L) { + return "Int64s"; + } + if (attributeId == 21L) { + return "Enum8"; + } + if (attributeId == 22L) { + return "Enum16"; + } + if (attributeId == 23L) { + return "FloatSingle"; + } + if (attributeId == 24L) { + return "FloatDouble"; + } + if (attributeId == 25L) { + return "OctetString"; + } + if (attributeId == 26L) { + return "ListInt8u"; + } + if (attributeId == 27L) { + return "ListOctetString"; + } + if (attributeId == 28L) { + return "ListStructOctetString"; + } + if (attributeId == 29L) { + return "LongOctetString"; + } + if (attributeId == 30L) { + return "CharString"; + } + if (attributeId == 31L) { + return "LongCharString"; + } + if (attributeId == 32L) { + return "EpochUs"; + } + if (attributeId == 33L) { + return "EpochS"; + } + if (attributeId == 34L) { + return "VendorId"; + } + if (attributeId == 35L) { + return "ListNullablesAndOptionalsStruct"; + } + if (attributeId == 36L) { + return "EnumAttr"; + } + if (attributeId == 37L) { + return "StructAttr"; + } + if (attributeId == 38L) { + return "RangeRestrictedInt8u"; + } + if (attributeId == 39L) { + return "RangeRestrictedInt8s"; + } + if (attributeId == 40L) { + return "RangeRestrictedInt16u"; + } + if (attributeId == 41L) { + return "RangeRestrictedInt16s"; + } + if (attributeId == 42L) { + return "ListLongOctetString"; + } + if (attributeId == 43L) { + return "ListFabricScoped"; + } + if (attributeId == 48L) { + return "TimedWriteBoolean"; + } + if (attributeId == 49L) { + return "GeneralErrorBoolean"; + } + if (attributeId == 50L) { + return "ClusterErrorBoolean"; + } + if (attributeId == 255L) { + return "Unsupported"; + } + if (attributeId == 16384L) { + return "NullableBoolean"; + } + if (attributeId == 16385L) { + return "NullableBitmap8"; + } + if (attributeId == 16386L) { + return "NullableBitmap16"; + } + if (attributeId == 16387L) { + return "NullableBitmap32"; + } + if (attributeId == 16388L) { + return "NullableBitmap64"; + } + if (attributeId == 16389L) { + return "NullableInt8u"; + } + if (attributeId == 16390L) { + return "NullableInt16u"; + } + if (attributeId == 16391L) { + return "NullableInt24u"; + } + if (attributeId == 16392L) { + return "NullableInt32u"; + } + if (attributeId == 16393L) { + return "NullableInt40u"; + } + if (attributeId == 16394L) { + return "NullableInt48u"; + } + if (attributeId == 16395L) { + return "NullableInt56u"; + } + if (attributeId == 16396L) { + return "NullableInt64u"; + } + if (attributeId == 16397L) { + return "NullableInt8s"; + } + if (attributeId == 16398L) { + return "NullableInt16s"; + } + if (attributeId == 16399L) { + return "NullableInt24s"; + } + if (attributeId == 16400L) { + return "NullableInt32s"; + } + if (attributeId == 16401L) { + return "NullableInt40s"; + } + if (attributeId == 16402L) { + return "NullableInt48s"; + } + if (attributeId == 16403L) { + return "NullableInt56s"; + } + if (attributeId == 16404L) { + return "NullableInt64s"; + } + if (attributeId == 16405L) { + return "NullableEnum8"; + } + if (attributeId == 16406L) { + return "NullableEnum16"; + } + if (attributeId == 16407L) { + return "NullableFloatSingle"; + } + if (attributeId == 16408L) { + return "NullableFloatDouble"; + } + if (attributeId == 16409L) { + return "NullableOctetString"; + } + if (attributeId == 16414L) { + return "NullableCharString"; + } + if (attributeId == 16420L) { + return "NullableEnumAttr"; + } + if (attributeId == 16421L) { + return "NullableStruct"; + } + if (attributeId == 16422L) { + return "NullableRangeRestrictedInt8u"; + } + if (attributeId == 16423L) { + return "NullableRangeRestrictedInt8s"; + } + if (attributeId == 16424L) { + return "NullableRangeRestrictedInt16u"; + } + if (attributeId == 16425L) { + return "NullableRangeRestrictedInt16s"; + } + if (attributeId == 16426L) { + return "WriteOnlyInt8u"; + } + if (attributeId == 65528L) { + return "GeneratedCommandList"; + } + if (attributeId == 65529L) { + return "AcceptedCommandList"; + } + if (attributeId == 65530L) { + return "EventList"; + } + if (attributeId == 65531L) { + return "AttributeList"; + } + if (attributeId == 65532L) { + return "FeatureMap"; + } + if (attributeId == 65533L) { + return "ClusterRevision"; + } + return ""; + } + return ""; + } + + /** + * Translates cluster ID and event ID to an attribute name in upper camel case. If no matching IDs + * are found, returns an empty string. + */ + public static String eventIdToName(long clusterId, long eventId) { + if (clusterId == 3L) { + return ""; + } + if (clusterId == 4L) { + return ""; + } + if (clusterId == 5L) { + return ""; + } + if (clusterId == 6L) { + return ""; + } + if (clusterId == 7L) { + return ""; + } + if (clusterId == 8L) { + return ""; + } + if (clusterId == 15L) { + return ""; + } + if (clusterId == 29L) { + return ""; + } + if (clusterId == 30L) { + return ""; + } + if (clusterId == 31L) { + if (eventId == 0L) { + return "AccessControlEntryChanged"; + } + if (eventId == 1L) { + return "AccessControlExtensionChanged"; + } + return ""; + } + if (clusterId == 37L) { + if (eventId == 0L) { + return "StateChanged"; + } + if (eventId == 1L) { + return "ActionFailed"; + } + return ""; + } + if (clusterId == 40L) { + if (eventId == 0L) { + return "StartUp"; + } + if (eventId == 1L) { + return "ShutDown"; + } + if (eventId == 2L) { + return "Leave"; + } + if (eventId == 3L) { + return "ReachableChanged"; + } + return ""; + } + if (clusterId == 41L) { + return ""; + } + if (clusterId == 42L) { + if (eventId == 0L) { + return "StateTransition"; + } + if (eventId == 1L) { + return "VersionApplied"; + } + if (eventId == 2L) { + return "DownloadError"; + } + return ""; + } + if (clusterId == 43L) { + return ""; + } + if (clusterId == 44L) { + return ""; + } + if (clusterId == 45L) { + return ""; + } + if (clusterId == 46L) { + return ""; + } + if (clusterId == 47L) { + if (eventId == 0L) { + return "WiredFaultChange"; + } + if (eventId == 1L) { + return "BatFaultChange"; + } + if (eventId == 2L) { + return "BatChargeFaultChange"; + } + return ""; + } + if (clusterId == 48L) { + return ""; + } + if (clusterId == 49L) { + return ""; + } + if (clusterId == 50L) { + return ""; + } + if (clusterId == 51L) { + if (eventId == 0L) { + return "HardwareFaultChange"; + } + if (eventId == 1L) { + return "RadioFaultChange"; + } + if (eventId == 2L) { + return "NetworkFaultChange"; + } + if (eventId == 3L) { + return "BootReason"; + } + return ""; + } + if (clusterId == 52L) { + if (eventId == 0L) { + return "SoftwareFault"; + } + return ""; + } + if (clusterId == 53L) { + if (eventId == 0L) { + return "ConnectionStatus"; + } + if (eventId == 1L) { + return "NetworkFaultChange"; + } + return ""; + } + if (clusterId == 54L) { + if (eventId == 0L) { + return "Disconnection"; + } + if (eventId == 1L) { + return "AssociationFailure"; + } + if (eventId == 2L) { + return "ConnectionStatus"; + } + return ""; + } + if (clusterId == 55L) { + return ""; + } + if (clusterId == 57L) { + if (eventId == 0L) { + return "StartUp"; + } + if (eventId == 1L) { + return "ShutDown"; + } + if (eventId == 2L) { + return "Leave"; + } + if (eventId == 3L) { + return "ReachableChanged"; + } + return ""; + } + if (clusterId == 59L) { + if (eventId == 0L) { + return "SwitchLatched"; + } + if (eventId == 1L) { + return "InitialPress"; + } + if (eventId == 2L) { + return "LongPress"; + } + if (eventId == 3L) { + return "ShortRelease"; + } + if (eventId == 4L) { + return "LongRelease"; + } + if (eventId == 5L) { + return "MultiPressOngoing"; + } + if (eventId == 6L) { + return "MultiPressComplete"; + } + return ""; + } + if (clusterId == 60L) { + return ""; + } + if (clusterId == 62L) { + return ""; + } + if (clusterId == 63L) { + return ""; + } + if (clusterId == 64L) { + return ""; + } + if (clusterId == 65L) { + return ""; + } + if (clusterId == 69L) { + if (eventId == 0L) { + return "StateChange"; + } + return ""; + } + if (clusterId == 80L) { + return ""; + } + if (clusterId == 257L) { + if (eventId == 0L) { + return "DoorLockAlarm"; + } + if (eventId == 1L) { + return "DoorStateChange"; + } + if (eventId == 2L) { + return "LockOperation"; + } + if (eventId == 3L) { + return "LockOperationError"; + } + if (eventId == 4L) { + return "LockUserChange"; + } + return ""; + } + if (clusterId == 258L) { + return ""; + } + if (clusterId == 259L) { + return ""; + } + if (clusterId == 512L) { + if (eventId == 0L) { + return "SupplyVoltageLow"; + } + if (eventId == 1L) { + return "SupplyVoltageHigh"; + } + if (eventId == 2L) { + return "PowerMissingPhase"; + } + if (eventId == 3L) { + return "SystemPressureLow"; + } + if (eventId == 4L) { + return "SystemPressureHigh"; + } + if (eventId == 5L) { + return "DryRunning"; + } + if (eventId == 6L) { + return "MotorTemperatureHigh"; + } + if (eventId == 7L) { + return "PumpMotorFatalFailure"; + } + if (eventId == 8L) { + return "ElectronicTemperatureHigh"; + } + if (eventId == 9L) { + return "PumpBlocked"; + } + if (eventId == 10L) { + return "SensorFailure"; + } + if (eventId == 11L) { + return "ElectronicNonFatalFailure"; + } + if (eventId == 12L) { + return "ElectronicFatalFailure"; + } + if (eventId == 13L) { + return "GeneralFault"; + } + if (eventId == 14L) { + return "Leakage"; + } + if (eventId == 15L) { + return "AirDetection"; + } + if (eventId == 16L) { + return "TurbineOperation"; + } + return ""; + } + if (clusterId == 513L) { + return ""; + } + if (clusterId == 514L) { + return ""; + } + if (clusterId == 516L) { + return ""; + } + if (clusterId == 768L) { + return ""; + } + if (clusterId == 769L) { + return ""; + } + if (clusterId == 1024L) { + return ""; + } + if (clusterId == 1026L) { + return ""; + } + if (clusterId == 1027L) { + return ""; + } + if (clusterId == 1028L) { + return ""; + } + if (clusterId == 1029L) { + return ""; + } + if (clusterId == 1030L) { + return ""; + } + if (clusterId == 1283L) { + return ""; + } + if (clusterId == 1284L) { + return ""; + } + if (clusterId == 1285L) { + return ""; + } + if (clusterId == 1286L) { + return ""; + } + if (clusterId == 1287L) { + return ""; + } + if (clusterId == 1288L) { + return ""; + } + if (clusterId == 1289L) { + return ""; + } + if (clusterId == 1290L) { + return ""; + } + if (clusterId == 1291L) { + return ""; + } + if (clusterId == 1292L) { + return ""; + } + if (clusterId == 1293L) { + return ""; + } + if (clusterId == 1294L) { + return ""; + } + if (clusterId == 2820L) { + return ""; + } + if (clusterId == 4166L) { + return ""; + } + if (clusterId == 4294048773L) { + if (eventId == 1L) { + return "TestEvent"; + } + if (eventId == 2L) { + return "TestFabricScopedEvent"; + } + return ""; + } + return ""; + } +} diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 67727e6b56cf13..2c20053185065f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -15074,6 +15074,104 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { this.callback = callback; } +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedSampleMeiClusterAddArgumentsResponseCallback implements ChipClusters.SampleMeiCluster.AddArgumentsResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer returnValue) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo returnValueResponseValue = new CommandResponseInfo("returnValue", "Integer"); + responseValues.put(returnValueResponseValue, returnValue); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } + + public static class DelegatedSampleMeiClusterGeneratedCommandListAttributeCallback implements ChipClusters.SampleMeiCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedSampleMeiClusterAcceptedCommandListAttributeCallback implements ChipClusters.SampleMeiCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedSampleMeiClusterEventListAttributeCallback implements ChipClusters.SampleMeiCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + +@Override + public void onSuccess( List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedSampleMeiClusterAttributeListAttributeCallback implements ChipClusters.SampleMeiCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + @Override public void onSuccess( List valueList) { Map responseValues = new LinkedHashMap<>(); @@ -15392,6 +15490,9 @@ public Map initializeClusterMap() { ClusterInfo faultInjectionClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.FaultInjectionCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("faultInjection", faultInjectionClusterInfo); + ClusterInfo sampleMeiClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.SampleMeiCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("sampleMei", sampleMeiClusterInfo); return clusterMap; } @@ -15493,6 +15594,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { ); faultInjectionClusterInteractionInfoMap.put("failRandomlyAtFault", faultInjectionfailRandomlyAtFaultInteractionInfo); commandMap.put("faultInjection", faultInjectionClusterInteractionInfoMap); + Map sampleMeiClusterInteractionInfoMap = new LinkedHashMap<>(); + Map sampleMeipingCommandParams = new LinkedHashMap(); + InteractionInfo sampleMeipingInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster) + .ping((DefaultClusterCallback) callback + + ); + }, + () -> new DelegatedDefaultClusterCallback(), + sampleMeipingCommandParams + ); + sampleMeiClusterInteractionInfoMap.put("ping", sampleMeipingInteractionInfo); + Map sampleMeiaddArgumentsCommandParams = new LinkedHashMap(); + CommandParameterInfo sampleMeiaddArgumentsarg1CommandParameterInfo = new CommandParameterInfo("arg1", Integer.class, Integer.class); + sampleMeiaddArgumentsCommandParams.put("arg1",sampleMeiaddArgumentsarg1CommandParameterInfo); + + CommandParameterInfo sampleMeiaddArgumentsarg2CommandParameterInfo = new CommandParameterInfo("arg2", Integer.class, Integer.class); + sampleMeiaddArgumentsCommandParams.put("arg2",sampleMeiaddArgumentsarg2CommandParameterInfo); + + InteractionInfo sampleMeiaddArgumentsInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.SampleMeiCluster) cluster) + .addArguments((ChipClusters.SampleMeiCluster.AddArgumentsResponseCallback) callback + , (Integer) + commandArguments.get("arg1") + , (Integer) + commandArguments.get("arg2") + + ); + }, + () -> new DelegatedSampleMeiClusterAddArgumentsResponseCallback(), + sampleMeiaddArgumentsCommandParams + ); + sampleMeiClusterInteractionInfoMap.put("addArguments", sampleMeiaddArgumentsInteractionInfo); + commandMap.put("sampleMei", sampleMeiClusterInteractionInfoMap); return commandMap; } diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 16efbfaa43c3e5..d86b766bd87f68 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -12100,6 +12100,71 @@ class ChipClusters: }, }, } + _SAMPLE_MEI_CLUSTER_INFO = { + "clusterName": "SampleMei", + "clusterId": 0xFFF1FC20, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "Ping", + "args": { + }, + }, + 0x00000002: { + "commandId": 0x00000002, + "commandName": "AddArguments", + "args": { + "arg1": "int", + "arg2": "int", + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "FlipFlop", + "attributeId": 0x00000000, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _CLUSTER_ID_DICT = { 0x00000003: _IDENTIFY_CLUSTER_INFO, @@ -12199,6 +12264,7 @@ class ChipClusters: 0x00000B04: _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, 0xFFF1FC05: _UNIT_TESTING_CLUSTER_INFO, 0xFFF1FC06: _FAULT_INJECTION_CLUSTER_INFO, + 0xFFF1FC20: _SAMPLE_MEI_CLUSTER_INFO, } _CLUSTER_NAME_DICT = { @@ -12299,6 +12365,7 @@ class ChipClusters: "ElectricalMeasurement": _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, "UnitTesting": _UNIT_TESTING_CLUSTER_INFO, "FaultInjection": _FAULT_INJECTION_CLUSTER_INFO, + "SampleMei": _SAMPLE_MEI_CLUSTER_INFO, } def __init__(self, chipstack): diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index a3a72f4f87fee1..8012a493d3db29 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -40618,3 +40618,190 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 + +@dataclass +class SampleMei(Cluster): + id: typing.ClassVar[int] = 0xFFF1FC20 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="flipFlop", Tag=0x00000000, Type=bool), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + flipFlop: 'bool' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Commands: + @dataclass + class Ping(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0xFFF1FC20 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + @dataclass + class AddArgumentsResponse(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0xFFF1FC20 + command_id: typing.ClassVar[int] = 0x00000001 + is_client: typing.ClassVar[bool] = False + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="returnValue", Tag=0, Type=uint), + ]) + + returnValue: 'uint' = 0 + + @dataclass + class AddArguments(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0xFFF1FC20 + command_id: typing.ClassVar[int] = 0x00000002 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = 'AddArgumentsResponse' + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="arg1", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="arg2", Tag=1, Type=uint), + ]) + + arg1: 'uint' = 0 + arg2: 'uint' = 0 + + class Attributes: + @dataclass + class FlipFlop(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC20 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=bool) + + value: 'bool' = False + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC20 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC20 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC20 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC20 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC20 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0xFFF1FC20 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 22376a7ff87412..3e23efcf1dbc43 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7400,6 +7400,7 @@ - LaundryWasherControls - RVCOperationalState - DishwasherAlarm + - SampleMEI attributes: # EventList generally not stable yet. Scenes: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index abf35d26b40424..66dfabb230d236 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5453,6 +5453,36 @@ static BOOL AttributeIsSpecifiedInUnitTestingCluster(AttributeId aAttributeId) } } } +static BOOL AttributeIsSpecifiedInSampleMEICluster(AttributeId aAttributeId) +{ + using namespace Clusters::SampleMei; + switch (aAttributeId) { + case Attributes::FlipFlop::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) { @@ -5736,6 +5766,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::UnitTesting::Id: { return AttributeIsSpecifiedInUnitTestingCluster(aAttributeId); } + case Clusters::SampleMei::Id: { + return AttributeIsSpecifiedInSampleMEICluster(aAttributeId); + } default: { return NO; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 8df1187874fd12..85158a4548c461 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -15771,6 +15771,31 @@ static id _Nullable DecodeAttributeValueForUnitTestingCluster( *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForSampleMEICluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::SampleMei; + switch (aAttributeId) { +#if MTR_ENABLE_PROVISIONAL + case Attributes::FlipFlop::Id: { + using TypeInfo = Attributes::FlipFlop::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } +#endif // MTR_ENABLE_PROVISIONAL + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader & aReader, CHIP_ERROR * aError) { @@ -16059,6 +16084,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::UnitTesting::Id: { return DecodeAttributeValueForUnitTestingCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::SampleMei::Id: { + return DecodeAttributeValueForSampleMEICluster(aPath.mAttributeId, aReader, aError); + } default: { break; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 8385b0ac441938..3afa8df46adf40 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -25034,6 +25034,130 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @end +/** + * Cluster Sample MEI + * + * The Sample MEI cluster showcases a cluster manufacturer extensions + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterSampleMEI : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; + +/** + * Command Ping + * + * Simple command without any parameters and without a response. + */ +- (void)pingWithParams:(MTRSampleMEIClusterPingParams * _Nullable)params + completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)pingWithCompletion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +/** + * Command AddArguments + * + * Command that takes two uint8 arguments and returns their sum. + */ +- (void)addArgumentsWithParams:(MTRSampleMEIClusterAddArgumentsParams *)params + completion:(void (^)(MTRSampleMEIClusterAddArgumentsResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFlipFlopWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeFlipFlopWithValue:(NSNumber * _Nonnull)value + completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeFlipFlopWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFlipFlopWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFlipFlopWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, + NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler + MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion + MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler + MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, + NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + MTR_DEPRECATED("Please use MTRBaseClusterBasicInformation", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @interface MTRBaseClusterBasic : MTRBaseClusterBasicInformation @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 5e6aa53256bb6f..81828982cc015c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -140982,4 +140982,438 @@ - (nullable instancetype)initWithDevice:(MTRBaseDevice *)device endpoint:(uint16 @end +@implementation MTRBaseClusterSampleMEI + +- (instancetype)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithEndpointID:endpointID queue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + } + return self; +} + +- (void)pingWithCompletion:(MTRStatusCompletion)completion +{ + [self pingWithParams:nil completion:completion]; +} +- (void)pingWithParams:(MTRSampleMEIClusterPingParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRCommandSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable value, NSError * _Nullable error) { + completion(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, CommandSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + SampleMei::Commands::Ping::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)addArgumentsWithParams:(MTRSampleMEIClusterAddArgumentsParams *)params + completion:(void (^)(MTRSampleMEIClusterAddArgumentsResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + // Make a copy of params before we go async. + params = [params copy]; + auto * bridge = new MTRSampleMEIClusterAddArgumentsResponseCallbackBridge(self.callbackQueue, completion, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, + SampleMEIClusterAddArgumentsResponseCallbackType successCb, MTRErrorCallback failureCb, + MTRCallbackBridgeBase * bridge) { + auto * typedBridge = static_cast(bridge); + Optional timedInvokeTimeoutMs; + Optional invokeTimeout; + ListFreer listFreer; + SampleMei::Commands::AddArguments::Type request; + if (params != nil) { + if (params.timedInvokeTimeoutMs != nil) { + params.timedInvokeTimeoutMs = MTRClampedNumber(params.timedInvokeTimeoutMs, @(1), @(UINT16_MAX)); + timedInvokeTimeoutMs.SetValue(params.timedInvokeTimeoutMs.unsignedShortValue); + } + if (params.serverSideProcessingTimeout != nil) { + // Clamp to a number of seconds that will not overflow 32-bit + // int when converted to ms. + auto * serverSideProcessingTimeout = MTRClampedNumber(params.serverSideProcessingTimeout, @(0), @(UINT16_MAX)); + invokeTimeout.SetValue(Seconds16(serverSideProcessingTimeout.unsignedShortValue)); + } + } + request.arg1 = params.arg1.unsignedCharValue; + request.arg2 = params.arg2.unsignedCharValue; + + return MTRStartInvokeInteraction(typedBridge, request, exchangeManager, session, successCb, failureCb, self.endpoint, + timedInvokeTimeoutMs, invokeTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)readAttributeFlipFlopWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SampleMei::Attributes::FlipFlop::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)writeAttributeFlipFlopWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeFlipFlopWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeFlipFlopWithValue:(NSNumber * _Nonnull)value + params:(MTRWriteParams * _Nullable)params + completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge( + self.callbackQueue, + ^(id _Nullable ignored, NSError * _Nullable error) { + completion(error); + }, + ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, + MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil) { + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = SampleMei::Attributes::FlipFlop::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpoint); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); + }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeFlipFlopWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SampleMei::Attributes::FlipFlop::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeFlipFlopWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRBooleanAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(BooleanAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SampleMei::Attributes::FlipFlop::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SampleMei::Attributes::GeneratedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SampleMei::Attributes::GeneratedCommandList::TypeInfo; + MTRSubscribeAttribute(params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, + TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSampleMEIGeneratedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SampleMEIGeneratedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SampleMei::Attributes::GeneratedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SampleMei::Attributes::AcceptedCommandList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SampleMei::Attributes::AcceptedCommandList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSampleMEIAcceptedCommandListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SampleMEIAcceptedCommandListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SampleMei::Attributes::AcceptedCommandList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SampleMei::Attributes::EventList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SampleMei::Attributes::EventList::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSampleMEIEventListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(SampleMEIEventListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SampleMei::Attributes::EventList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SampleMei::Attributes::AttributeList::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SampleMei::Attributes::AttributeList::TypeInfo; + MTRSubscribeAttribute( + params, subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRSampleMEIAttributeListListAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction(clusterStateCacheContainer.baseDevice, + ^(SampleMEIAttributeListListAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SampleMei::Attributes::AttributeList::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SampleMei::Attributes::FeatureMap::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SampleMei::Attributes::FeatureMap::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt32uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int32uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SampleMei::Attributes::FeatureMap::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + MTRReadParams * params = [[MTRReadParams alloc] init]; + using TypeInfo = SampleMei::Attributes::ClusterRevision::TypeInfo; + return MTRReadAttribute( + params, completion, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), TypeInfo::GetAttributeId()); +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = SampleMei::Attributes::ClusterRevision::TypeInfo; + MTRSubscribeAttribute(params, + subscriptionEstablished, reportHandler, self.callbackQueue, self.device, self.endpoint, TypeInfo::GetClusterId(), + TypeInfo::GetAttributeId()); +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer + endpoint:(NSNumber *)endpoint + queue:(dispatch_queue_t)queue + completion: + (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + auto * bridge = new MTRInt16uAttributeCallbackBridge(queue, completion); + std::move(*bridge).DispatchLocalAction( + clusterStateCacheContainer.baseDevice, ^(Int16uAttributeCallback successCb, MTRErrorCallback failureCb) { + if (clusterStateCacheContainer.cppClusterStateCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = SampleMei::Attributes::ClusterRevision::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = clusterStateCacheContainer.cppClusterStateCache->Get(path, value); + if (err == CHIP_NO_ERROR) { + successCb(bridge, value); + } + return err; + } + return CHIP_ERROR_NOT_FOUND; + }); +} + +@end + // NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h index 9d33718463d50f..29f0d7e466b672 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters_Internal.h @@ -391,3 +391,7 @@ @interface MTRBaseClusterUnitTesting () @property (nonatomic, strong, readonly) MTRBaseDevice * device; @end + +@interface MTRBaseClusterSampleMEI () +@property (nonatomic, strong, readonly) MTRBaseDevice * device; +@end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h index 44679818f4d78b..e8bd7d7267f71f 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.h @@ -157,6 +157,8 @@ typedef void (*UnitTestingClusterTestEmitTestEventResponseCallbackType)( void *, const chip::app::Clusters::UnitTesting::Commands::TestEmitTestEventResponse::DecodableType &); typedef void (*UnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackType)( void *, const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType &); +typedef void (*SampleMEIClusterAddArgumentsResponseCallbackType)( + void *, const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType &); typedef void (*IdentifyClusterEffectIdentifierEnumAttributeCallback)(void *, chip::app::Clusters::Identify::EffectIdentifierEnum); typedef void (*NullableIdentifyClusterEffectIdentifierEnumAttributeCallback)( @@ -1845,6 +1847,14 @@ typedef void (*UnitTestingEventListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*UnitTestingAttributeListListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SampleMEIGeneratedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SampleMEIAcceptedCommandListListAttributeCallback)( + void * context, const chip::app::DataModel::DecodableList & data); +typedef void (*SampleMEIEventListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); +typedef void (*SampleMEIAttributeListListAttributeCallback)(void * context, + const chip::app::DataModel::DecodableList & data); class MTRDefaultSuccessCallbackBridge : public MTRCallbackBridge { @@ -18791,6 +18801,136 @@ class MTRUnitTestingAttributeListListAttributeCallbackSubscriptionBridge MTRSubscriptionEstablishedHandler mEstablishedHandler; }; +class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIGeneratedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSampleMEIGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSampleMEIGeneratedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIGeneratedCommandListListAttributeCallbackSubscriptionBridge + : public MTRSampleMEIGeneratedCommandListListAttributeCallbackBridge +{ +public: + MTRSampleMEIGeneratedCommandListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSampleMEIGeneratedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSampleMEIGeneratedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSampleMEIGeneratedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIAcceptedCommandListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSampleMEIAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSampleMEIAcceptedCommandListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIAcceptedCommandListListAttributeCallbackSubscriptionBridge + : public MTRSampleMEIAcceptedCommandListListAttributeCallbackBridge +{ +public: + MTRSampleMEIAcceptedCommandListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSampleMEIAcceptedCommandListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSampleMEIAcceptedCommandListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSampleMEIAcceptedCommandListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIEventListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSampleMEIEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSampleMEIEventListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIEventListListAttributeCallbackSubscriptionBridge + : public MTRSampleMEIEventListListAttributeCallbackBridge +{ +public: + MTRSampleMEIEventListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSampleMEIEventListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSampleMEIEventListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSampleMEIEventListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + +class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIAttributeListListAttributeCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSampleMEIAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSampleMEIAttributeListListAttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, const chip::app::DataModel::DecodableList & value); +}; + +class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIAttributeListListAttributeCallbackSubscriptionBridge + : public MTRSampleMEIAttributeListListAttributeCallbackBridge +{ +public: + MTRSampleMEIAttributeListListAttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + MTRActionBlock action, + MTRSubscriptionEstablishedHandler establishedHandler) : + MTRSampleMEIAttributeListListAttributeCallbackBridge(queue, handler, action), + mEstablishedHandler(establishedHandler) + {} + + void OnSubscriptionEstablished(); + using MTRSampleMEIAttributeListListAttributeCallbackBridge::KeepAliveOnCallback; + using MTRSampleMEIAttributeListListAttributeCallbackBridge::OnDone; + +private: + MTRSubscriptionEstablishedHandler mEstablishedHandler; +}; + class MTRGroupsClusterAddGroupResponseCallbackBridge : public MTRCallbackBridge { public: @@ -19719,6 +19859,20 @@ class MTRUnitTestingClusterTestEmitTestFabricScopedEventResponseCallbackBridge const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType & data); }; +class MTR_PROVISIONALLY_AVAILABLE MTRSampleMEIClusterAddArgumentsResponseCallbackBridge + : public MTRCallbackBridge +{ +public: + MTRSampleMEIClusterAddArgumentsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler) : + MTRCallbackBridge(queue, handler, OnSuccessFn){}; + + MTRSampleMEIClusterAddArgumentsResponseCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, MTRActionBlock action) : + MTRCallbackBridge(queue, handler, action, OnSuccessFn){}; + + static void OnSuccessFn(void * context, + const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType & data); +}; + class MTRIdentifyClusterEffectIdentifierEnumAttributeCallbackBridge : public MTRCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm index 7c1c7daec4dc44..1030ef7ffac311 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCallbackBridge.mm @@ -19608,6 +19608,158 @@ } } +void MTRSampleMEIGeneratedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRSampleMEIGeneratedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRSampleMEIAcceptedCommandListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRSampleMEIAcceptedCommandListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRSampleMEIEventListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRSampleMEIEventListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + +void MTRSampleMEIAttributeListListAttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::DecodableList & value) +{ + NSArray * _Nonnull objCValue; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = value.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + objCValue = array_0; + } + DispatchSuccess(context, objCValue); +}; + +void MTRSampleMEIAttributeListListAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished() +{ + if (!mQueue) { + return; + } + + if (mEstablishedHandler != nil) { + dispatch_async(mQueue, mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + mEstablishedHandler = nil; + } +} + void MTRGroupsClusterAddGroupResponseCallbackBridge::OnSuccessFn( void * context, const chip::app::Clusters::Groups::Commands::AddGroupResponse::DecodableType & data) { @@ -20428,6 +20580,19 @@ DispatchSuccess(context, response); }; +void MTRSampleMEIClusterAddArgumentsResponseCallbackBridge::OnSuccessFn( + void * context, const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType & data) +{ + auto * response = [MTRSampleMEIClusterAddArgumentsResponseParams new]; + CHIP_ERROR err = [response _setFieldsFromDecodableStruct:data]; + if (err != CHIP_NO_ERROR) { + OnFailureFn(context, err); + return; + } + SetAttestationChallengeIfNeeded(context, response); + DispatchSuccess(context, response); +}; + void MTRIdentifyClusterEffectIdentifierEnumAttributeCallbackBridge::OnSuccessFn( void * context, chip::app::Clusters::Identify::EffectIdentifierEnum value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 6f7d4d529419c2..ee2cc2a922214d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -317,6 +317,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAccountLoginID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000050E, MTRClusterIDTypeElectricalMeasurementID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000B04, MTRClusterIDTypeUnitTestingID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0xFFF1FC05, + MTRClusterIDTypeSampleMEIID MTR_PROVISIONALLY_AVAILABLE = 0xFFF1FC20, }; #pragma mark - Attributes IDs @@ -8636,6 +8637,21 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterUnitTestingAttributeClusterRevisionID API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster SampleMEI attributes + MTRAttributeIDTypeClusterSampleMEIAttributeFlipFlopID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterSampleMEIAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterSampleMEIAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterSampleMEIAttributeEventListID MTR_PROVISIONALLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterSampleMEIAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterSampleMEIAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterSampleMEIAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE + = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + }; #pragma mark - Commands IDs @@ -10296,6 +10312,11 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000015, + // Cluster SampleMEI commands + MTRCommandIDTypeClusterSampleMEICommandPingID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRCommandIDTypeClusterSampleMEICommandAddArgumentsResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRCommandIDTypeClusterSampleMEICommandAddArgumentsID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + }; #pragma mark - Events IDs diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 14355f269b5f41..c3ad09b1751900 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -8984,6 +8984,58 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @end +/** + * Cluster Sample MEI + * The Sample MEI cluster showcases a cluster manufacturer extensions + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterSampleMEI : MTRCluster + +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; + +- (void)pingWithParams:(MTRSampleMEIClusterPingParams * _Nullable)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)pingWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)addArgumentsWithParams:(MTRSampleMEIClusterAddArgumentsParams *)params + expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries + expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs + completion:(void (^)(MTRSampleMEIClusterAddArgumentsResponseParams * _Nullable data, + NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary *)readAttributeFlipFlopWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeFlipFlopWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeFlipFlopWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params + MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params + MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params + MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params + MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + MTR_DEPRECATED("Please use MTRClusterBasicInformation", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) @interface MTRClusterBasic : MTRClusterBasicInformation @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 54316e5bba43da..b012fde1e2ee20 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -31347,4 +31347,183 @@ - (void)testEmitTestFabricScopedEventRequestWithParams:(MTRTestClusterClusterTes } @end +@implementation MTRClusterSampleMEI + +- (instancetype)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue +{ + if (self = [super initWithEndpointID:endpointID queue:queue]) { + if (device == nil) { + return nil; + } + + _device = device; + } + return self; +} + +- (void)pingWithExpectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion +{ + [self pingWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)pingWithParams:(MTRSampleMEIClusterPingParams * _Nullable)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(MTRStatusCompletion)completion +{ + NSString * logPrefix = + [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, self.endpoint, + (unsigned int) MTRClusterIDTypeSampleMEIID, (unsigned int) MTRCommandIDTypeClusterSampleMEICommandPingID]; + // Make a copy of params before we go async. + params = [params copy]; + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + auto * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:baseDevice + endpointID:@(self.endpoint) + queue:self.device.queue]; + [cluster pingWithParams:params + completion:^(NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, nil, error); + dispatch_async(self.callbackQueue, ^{ + completion(error); + }); + [workItem endWork]; + }]; + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (void)addArgumentsWithParams:(MTRSampleMEIClusterAddArgumentsParams *)params + expectedValues:(NSArray *> *)expectedValues + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + completion:(void (^)(MTRSampleMEIClusterAddArgumentsResponseParams * _Nullable data, + NSError * _Nullable error))completion +{ + NSString * logPrefix = + [NSString stringWithFormat:@"MTRDevice command %u %u %u %u", self.device.deviceController.fabricIndex, self.endpoint, + (unsigned int) MTRClusterIDTypeSampleMEIID, (unsigned int) MTRCommandIDTypeClusterSampleMEICommandAddArgumentsID]; + // Make a copy of params before we go async. + params = [params copy]; + MTRAsyncCallbackQueueWorkItem * workItem = [[MTRAsyncCallbackQueueWorkItem alloc] initWithQueue:self.device.queue]; + MTRAsyncCallbackReadyHandler readyHandler = ^(MTRDevice * device, NSUInteger retryCount) { + MTRClustersLogDequeue(logPrefix, self.device.asyncCallbackWorkQueue); + auto * baseDevice = [[MTRBaseDevice alloc] initWithNodeID:self.device.nodeID controller:self.device.deviceController]; + auto * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:baseDevice + endpointID:@(self.endpoint) + queue:self.device.queue]; + [cluster + addArgumentsWithParams:params + completion:^(MTRSampleMEIClusterAddArgumentsResponseParams * _Nullable value, NSError * _Nullable error) { + MTRClustersLogCompletion(logPrefix, value, error); + dispatch_async(self.callbackQueue, ^{ + completion(value, error); + }); + [workItem endWork]; + }]; + }; + workItem.readyHandler = readyHandler; + MTRClustersLogEnqueue(logPrefix, self.device.asyncCallbackWorkQueue); + [self.device.asyncCallbackWorkQueue enqueueWorkItem:workItem]; + + if (!expectedValueIntervalMs || ([expectedValueIntervalMs compare:@(0)] == NSOrderedAscending)) { + expectedValues = nil; + } else { + expectedValueIntervalMs = MTRClampedNumber(expectedValueIntervalMs, @(1), @(UINT32_MAX)); + } + if (expectedValues) { + [self.device setExpectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs]; + } +} + +- (NSDictionary *)readAttributeFlipFlopWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) + clusterID:@(MTRClusterIDTypeSampleMEIID) + attributeID:@(MTRAttributeIDTypeClusterSampleMEIAttributeFlipFlopID) + params:params]; +} + +- (void)writeAttributeFlipFlopWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeFlipFlopWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeFlipFlopWithValue:(NSDictionary *)dataValueDictionary + expectedValueInterval:(NSNumber *)expectedValueIntervalMs + params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:@(self.endpoint) + clusterID:@(MTRClusterIDTypeSampleMEIID) + attributeID:@(MTRAttributeIDTypeClusterSampleMEIAttributeFlipFlopID) + value:dataValueDictionary + expectedValueInterval:expectedValueIntervalMs + timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary *)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) + clusterID:@(MTRClusterIDTypeSampleMEIID) + attributeID:@(MTRAttributeIDTypeClusterSampleMEIAttributeGeneratedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) + clusterID:@(MTRClusterIDTypeSampleMEIID) + attributeID:@(MTRAttributeIDTypeClusterSampleMEIAttributeAcceptedCommandListID) + params:params]; +} + +- (NSDictionary *)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) + clusterID:@(MTRClusterIDTypeSampleMEIID) + attributeID:@(MTRAttributeIDTypeClusterSampleMEIAttributeEventListID) + params:params]; +} + +- (NSDictionary *)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) + clusterID:@(MTRClusterIDTypeSampleMEIID) + attributeID:@(MTRAttributeIDTypeClusterSampleMEIAttributeAttributeListID) + params:params]; +} + +- (NSDictionary *)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) + clusterID:@(MTRClusterIDTypeSampleMEIID) + attributeID:@(MTRAttributeIDTypeClusterSampleMEIAttributeFeatureMapID) + params:params]; +} + +- (NSDictionary *)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:@(self.endpoint) + clusterID:@(MTRClusterIDTypeSampleMEIID) + attributeID:@(MTRAttributeIDTypeClusterSampleMEIAttributeClusterRevisionID) + params:params]; +} + +@end + // NOLINTEND(clang-analyzer-cplusplus.NewDeleteLeaks) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h index db2545a83c9ade..25b5147c8b8801 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters_Internal.h @@ -392,3 +392,7 @@ @interface MTRClusterUnitTesting () @property (nonatomic, readonly) MTRDevice * device; @end + +@interface MTRClusterSampleMEI () +@property (nonatomic, readonly) MTRDevice * device; +@end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 05ce7492877a47..d0ce3a054d2207 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -9968,4 +9968,83 @@ MTR_DEPRECATED("Please use MTRUnitTestingClusterTestEmitTestFabricScopedEventReq : MTRUnitTestingClusterTestEmitTestFabricScopedEventRequestParams @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRSampleMEIClusterPingParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRSampleMEIClusterAddArgumentsResponseParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull returnValue MTR_PROVISIONALLY_AVAILABLE; + +/** + * Initialize an MTRSampleMEIClusterAddArgumentsResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. + * + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. + * + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. + */ +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; +@end + +MTR_PROVISIONALLY_AVAILABLE +@interface MTRSampleMEIClusterAddArgumentsParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull arg1 MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nonnull arg2 MTR_PROVISIONALLY_AVAILABLE; +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index 23b319ffafaab0..642903ad36a54b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -15182,6 +15182,146 @@ - (NSString *)description @end @implementation MTRTestClusterClusterTestEmitTestFabricScopedEventRequestParams +@end +@implementation MTRSampleMEIClusterPingParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRSampleMEIClusterPingParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end +@implementation MTRSampleMEIClusterAddArgumentsResponseParams +- (instancetype)init +{ + if (self = [super init]) { + + _returnValue = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRSampleMEIClusterAddArgumentsResponseParams alloc] init]; + + other.returnValue = self.returnValue; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: returnValue:%@; >", NSStringFromClass([self class]), _returnValue]; + return descriptionString; +} + +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error +{ + if (!(self = [super init])) { + return nil; + } + + using DecodableType = chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; + if (buffer.IsNull()) { + return nil; + } + + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } + } + } + + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; + } + return nil; +} + +@end + +@implementation MTRSampleMEIClusterAddArgumentsResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType &)decodableStruct +{ + { + self.returnValue = [NSNumber numberWithUnsignedChar:decodableStruct.returnValue]; + } + return CHIP_NO_ERROR; +} +@end +@implementation MTRSampleMEIClusterAddArgumentsParams +- (instancetype)init +{ + if (self = [super init]) { + + _arg1 = @(0); + + _arg2 = @(0); + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRSampleMEIClusterAddArgumentsParams alloc] init]; + + other.arg1 = self.arg1; + other.arg2 = self.arg2; + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = + [NSString stringWithFormat:@"<%@: arg1:%@; arg2:%@; >", NSStringFromClass([self class]), _arg1, _arg2]; + return descriptionString; +} + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 16acf214e7f7b8..0436ad228dc4b9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -482,4 +482,11 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRSampleMEIClusterAddArgumentsResponseParams (InternalMethods) + +- (CHIP_ERROR)_setFieldsFromDecodableStruct: + (const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType &)decodableStruct; + +@end + NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 09fa6200501c0b..97c4f4b494a858 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -3326,6 +3326,18 @@ static id _Nullable DecodeEventPayloadForUnitTestingCluster(EventId aEventId, TL *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForSampleMEICluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::SampleMei; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVReader & aReader, CHIP_ERROR * aError) { @@ -3609,6 +3621,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::UnitTesting::Id: { return DecodeEventPayloadForUnitTestingCluster(aPath.mEventId, aReader, aError); } + case Clusters::SampleMei::Id: { + return DecodeEventPayloadForSampleMEICluster(aPath.mEventId, aReader, aError); + } default: { break; } diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 878ef63131deb0..d9055c043433a6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -28850,6 +28850,105 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace FaultInjection +namespace SampleMei { +namespace Attributes { + +namespace FlipFlop { + +EmberAfStatus Get(chip::EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SampleMei::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::SampleMei::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace FlipFlop + +namespace FeatureMap { + +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SampleMei::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::SampleMei::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + EmberAfStatus status = emberAfReadAttribute(endpoint, Clusters::SampleMei::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + *value = Traits::StorageToWorking(temp); + return status; +} +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::SampleMei::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace SampleMei + } // namespace Clusters } // namespace app } // namespace chip diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index f23f87366c526f..604cf366de9fad 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -5006,6 +5006,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace Attributes } // namespace FaultInjection +namespace SampleMei { +namespace Attributes { + +namespace FlipFlop { +EmberAfStatus Get(chip::EndpointId endpoint, bool * value); // boolean +EmberAfStatus Set(chip::EndpointId endpoint, bool value); +} // namespace FlipFlop + +namespace FeatureMap { +EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 +EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +} // namespace FeatureMap + +namespace ClusterRevision { +EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // int16u +EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace SampleMei + } // namespace Clusters } // namespace app } // namespace chip diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 6a8b1b36982539..9b692fb362815b 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -809,6 +809,14 @@ void emberAfUnitTestingClusterInitCallback(chip::EndpointId endpoint); */ void emberAfFaultInjectionClusterInitCallback(chip::EndpointId endpoint); +/** @brief Sample MEI Cluster Init + * + * Cluster Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfSampleMeiClusterInitCallback(chip::EndpointId endpoint); + // Cluster Server/Client Init Functions // @@ -8304,6 +8312,84 @@ void emberAfFaultInjectionClusterServerTickCallback(chip::EndpointId endpoint); */ void emberAfFaultInjectionClusterClientTickCallback(chip::EndpointId endpoint); +// +// Sample MEI Cluster +// + +/** @brief Sample MEI Cluster Server Init + * + * Server Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfSampleMeiClusterServerInitCallback(chip::EndpointId endpoint); + +/** @brief Sample MEI Cluster Server Shutdown + * + * Server Shutdown + * + * @param endpoint Endpoint that is being shutdown + */ +void MatterSampleMeiClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** @brief Sample MEI Cluster Client Init + * + * Client Init + * + * @param endpoint Endpoint that is being initialized + */ +void emberAfSampleMeiClusterClientInitCallback(chip::EndpointId endpoint); + +/** @brief Sample MEI Cluster Server Attribute Changed + * + * Server Attribute Changed + * + * @param attributePath Concrete attribute path that changed + */ +void MatterSampleMeiClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** @brief Sample MEI Cluster Server Pre Attribute Changed + * + * Server Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterSampleMeiClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Sample MEI Cluster Client Pre Attribute Changed + * + * Client Pre Attribute Changed + * + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterSampleMeiClusterClientPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** @brief Sample MEI Cluster Server Tick + * + * Server Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfSampleMeiClusterServerTickCallback(chip::EndpointId endpoint); + +/** @brief Sample MEI Cluster Client Tick + * + * Client Tick + * + * @param endpoint Endpoint that is being served + */ +void emberAfSampleMeiClusterClientTickCallback(chip::EndpointId endpoint); + // Cluster Commands Callback /** diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index c5badb6f9d7091..60f0c614cb7118 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -4119,6 +4119,8 @@ enum class FaultType : uint8_t }; } // namespace FaultInjection +namespace SampleMei {} // namespace SampleMei + } // namespace Clusters } // namespace app } // namespace chip diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 8fac2b4581f03a..7e1e535894cc59 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -25542,6 +25542,159 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace FaultInjection +namespace SampleMei { + +namespace Commands { +namespace Ping { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(aWriter.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace Ping. +namespace AddArgumentsResponse { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kReturnValue), returnValue)); + ReturnErrorOnFailure(aWriter.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kReturnValue): + ReturnErrorOnFailure(DataModel::Decode(reader, returnValue)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace AddArgumentsResponse. +namespace AddArguments { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg1), arg1)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kArg2), arg2)); + ReturnErrorOnFailure(aWriter.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + TLV::TLVType outer; + VerifyOrReturnError(TLV::kTLVType_Structure == reader.GetType(), CHIP_ERROR_WRONG_TLV_TYPE); + ReturnErrorOnFailure(reader.EnterContainer(outer)); + while ((err = reader.Next()) == CHIP_NO_ERROR) + { + if (!TLV::IsContextTag(reader.GetTag())) + { + continue; + } + switch (TLV::TagNumFromTag(reader.GetTag())) + { + case to_underlying(Fields::kArg1): + ReturnErrorOnFailure(DataModel::Decode(reader, arg1)); + break; + case to_underlying(Fields::kArg2): + ReturnErrorOnFailure(DataModel::Decode(reader, arg2)); + break; + default: + break; + } + } + + VerifyOrReturnError(err == CHIP_END_OF_TLV, err); + ReturnErrorOnFailure(reader.ExitContainer(outer)); + return CHIP_NO_ERROR; +} +} // namespace AddArguments. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::FlipFlop::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, flipFlop)); + break; + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, generatedCommandList)); + break; + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, acceptedCommandList)); + break; + case Attributes::EventList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, eventList)); + break; + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, attributeList)); + break; + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, featureMap)); + break; + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + ReturnErrorOnFailure(DataModel::Decode(reader, clusterRevision)); + break; + default: + break; + } + + return CHIP_NO_ERROR; +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace SampleMei } // namespace Clusters @@ -26041,6 +26194,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::SampleMei::Id: { + switch (aCommand) + { + default: + return false; + } + } } return false; } 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 be7ffc777ee112..e09134e1b2713f 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 @@ -35628,6 +35628,196 @@ struct TypeInfo }; } // namespace Attributes } // namespace FaultInjection +namespace SampleMei { + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace Ping { +struct Type; +struct DecodableType; +} // namespace Ping + +namespace AddArgumentsResponse { +struct Type; +struct DecodableType; +} // namespace AddArgumentsResponse + +namespace AddArguments { +struct Type; +struct DecodableType; +} // namespace AddArguments + +} // namespace Commands + +namespace Commands { +namespace Ping { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::Ping::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::Ping::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace Ping +namespace AddArgumentsResponse { +enum class Fields : uint8_t +{ + kReturnValue = 0, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AddArgumentsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } + + uint8_t returnValue = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AddArgumentsResponse::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } + + uint8_t returnValue = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AddArgumentsResponse +namespace AddArguments { +enum class Fields : uint8_t +{ + kArg1 = 0, + kArg2 = 1, +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::AddArguments::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } + + uint8_t arg1 = static_cast(0); + uint8_t arg2 = static_cast(0); + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::AddArguments::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } + + uint8_t arg1 = static_cast(0); + uint8_t arg2 = static_cast(0); + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace AddArguments +} // namespace Commands + +namespace Attributes { + +namespace FlipFlop { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::FlipFlop::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace FlipFlop +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::SampleMei::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::FlipFlop::TypeInfo::DecodableType flipFlop = static_cast(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace SampleMei } // namespace Clusters diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 5e335aeb3d8d18..2032a2c22bfbf6 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -6857,6 +6857,40 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace FaultInjection +namespace SampleMei { +namespace Attributes { + +namespace FlipFlop { +static constexpr AttributeId Id = 0x00000000; +} // namespace FlipFlop + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace SampleMei + } // namespace Clusters } // namespace app } // namespace chip diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 5260a7b57ed419..903a673b79e570 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -316,6 +316,9 @@ static constexpr ClusterId Id = 0xFFF1FC05; namespace FaultInjection { static constexpr ClusterId Id = 0xFFF1FC06; } // namespace FaultInjection +namespace SampleMei { +static constexpr ClusterId Id = 0xFFF1FC20; +} // namespace SampleMei } // namespace Clusters } // namespace app diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index 0efc20b73ca8ee..2b957cf72375ed 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1479,6 +1479,24 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace FaultInjection +namespace SampleMei { +namespace Commands { + +namespace Ping { +static constexpr CommandId Id = 0x00000000; +} // namespace Ping + +namespace AddArgumentsResponse { +static constexpr CommandId Id = 0x00000001; +} // namespace AddArgumentsResponse + +namespace AddArguments { +static constexpr CommandId Id = 0x00000002; +} // namespace AddArguments + +} // namespace Commands +} // namespace SampleMei + } // namespace Clusters } // namespace app } // namespace chip diff --git a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h index 8df369813fe69b..f3dbf7e60bc35d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/print-cluster.h +++ b/zzz_generated/app-common/app-common/zap-generated/print-cluster.h @@ -659,6 +659,12 @@ #define CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER #endif +#if defined(ZCL_USING_SAMPLE_MEI_CLUSTER_SERVER) || defined(ZCL_USING_SAMPLE_MEI_CLUSTER_CLIENT) +#define CHIP_PRINTCLUSTER_SAMPLE_MEI_CLUSTER { chip::app::Clusters::SampleMei::Id, "Sample MEI" }, +#else +#define CHIP_PRINTCLUSTER_SAMPLE_MEI_CLUSTER +#endif + #define CLUSTER_IDS_TO_NAMES \ CHIP_PRINTCLUSTER_IDENTIFY_CLUSTER \ CHIP_PRINTCLUSTER_GROUPS_CLUSTER \ @@ -756,6 +762,7 @@ CHIP_PRINTCLUSTER_ACCOUNT_LOGIN_CLUSTER \ CHIP_PRINTCLUSTER_ELECTRICAL_MEASUREMENT_CLUSTER \ CHIP_PRINTCLUSTER_UNIT_TESTING_CLUSTER \ - CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER + CHIP_PRINTCLUSTER_FAULT_INJECTION_CLUSTER \ + CHIP_PRINTCLUSTER_SAMPLE_MEI_CLUSTER #define MAX_CLUSTER_NAME_LENGTH 58 diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index fdcedab3338bc3..5ea3aa9d7c9afb 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -131,6 +131,7 @@ | ElectricalMeasurement | 0x0B04 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| +| SampleMei | 0xFFF1FC20| \*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*\ @@ -11383,6 +11384,99 @@ class FaultInjectionFailRandomlyAtFault : public ClusterCommand chip::app::Clusters::FaultInjection::Commands::FailRandomlyAtFault::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster SampleMei | 0xFFF1FC20 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Ping | 0x00 | +| * AddArguments | 0x02 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * FlipFlop | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command Ping + */ +class SampleMeiPing : public ClusterCommand +{ +public: + SampleMeiPing(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("ping", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::SampleMei::Commands::Ping::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::SampleMei::Commands::Ping::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::SampleMei::Commands::Ping::Type mRequest; +}; + +/* + * Command AddArguments + */ +class SampleMeiAddArguments : public ClusterCommand +{ +public: + SampleMeiAddArguments(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("add-arguments", credsIssuerConfig) + { + AddArgument("Arg1", 0, UINT8_MAX, &mRequest.arg1); + AddArgument("Arg2", 0, UINT8_MAX, &mRequest.arg2); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::SampleMei::Commands::AddArguments::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::SampleMei::Commands::AddArguments::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::SampleMei::Commands::AddArguments::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Register all Clusters commands | \*----------------------------------------------------------------------------*/ @@ -21360,6 +21454,63 @@ void registerClusterFaultInjection(Commands & commands, CredentialIssuerCommands commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterSampleMei(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::SampleMei; + + const char * clusterName = "SampleMei"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "flip-flop", Attributes::FlipFlop::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique>(Id, "flip-flop", 0, 1, Attributes::FlipFlop::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "flip-flop", Attributes::FlipFlop::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterAny(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { @@ -21482,4 +21633,5 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterElectricalMeasurement(commands, credsIssuerConfig); registerClusterUnitTesting(commands, credsIssuerConfig); registerClusterFaultInjection(commands, credsIssuerConfig); + registerClusterSampleMei(commands, credsIssuerConfig); } 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 a26f2ea8bf7c96..7b4d3fc30a3108 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -5077,6 +5077,14 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const SampleMei::Commands::AddArgumentsResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("returnValue", indent + 1, value.returnValue)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributePath & path, chip::TLV::TLVReader * data) { @@ -13490,6 +13498,47 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case SampleMei::Id: { + switch (path.mAttributeId) + { + case SampleMei::Attributes::FlipFlop::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FlipFlop", 1, value); + } + case SampleMei::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("GeneratedCommandList", 1, value); + } + case SampleMei::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AcceptedCommandList", 1, value); + } + case SampleMei::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case SampleMei::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AttributeList", 1, value); + } + case SampleMei::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case SampleMei::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } default: break; } @@ -13997,6 +14046,17 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } + case SampleMei::Id: { + switch (path.mCommandId) + { + case SampleMei::Commands::AddArgumentsResponse::Id: { + SampleMei::Commands::AddArgumentsResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AddArgumentsResponse", 1, value); + } + } + break; + } default: break; } 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 a5fbdc0c4166bf..96f8b52b007164 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -557,3 +557,5 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Commands::TestEmitTestFabricScopedEventResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::DecodableType & value); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index ecdb4adc9b032f..4bbfdba0783824 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -134,6 +134,7 @@ | ElectricalMeasurement | 0x0B04 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| +| SampleMei | 0xFFF1FC20| \*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*\ @@ -161588,6 +161589,813 @@ class SubscribeAttributeUnitTestingClusterRevision : public SubscribeAttribute { } }; +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster SampleMei | 0xFFF1FC20 | +|------------------------------------------------------------------------------| +| Commands: | | +| * Ping | 0x00 | +| * AddArguments | 0x02 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * FlipFlop | 0x0000 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command Ping + */ +class SampleMeiPing : public ClusterCommand { +public: + SampleMeiPing() + : ClusterCommand("ping") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::SampleMei::Commands::Ping::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSampleMEIClusterPingParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster pingWithParams:params + completion:^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/* + * Command AddArguments + */ +class SampleMeiAddArguments : public ClusterCommand { +public: + SampleMeiAddArguments() + : ClusterCommand("add-arguments") + { + AddArgument("Arg1", 0, UINT8_MAX, &mRequest.arg1); + AddArgument("Arg2", 0, UINT8_MAX, &mRequest.arg2); + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::SampleMei::Commands::AddArguments::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSampleMEIClusterAddArgumentsParams alloc] init]; + params.timedInvokeTimeoutMs + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.arg1 = [NSNumber numberWithUnsignedChar:mRequest.arg1]; + params.arg2 = [NSNumber numberWithUnsignedChar:mRequest.arg2]; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster + addArgumentsWithParams:params + completion:^( + MTRSampleMEIClusterAddArgumentsResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId + = chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId + = chip::app::Clusters::SampleMei::Commands::AddArgumentsResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: + chip::app::Clusters::SampleMei::Commands::AddArguments::Type mRequest; +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FlipFlop + */ +class ReadSampleMeiFlipFlop : public ReadAttribute { +public: + ReadSampleMeiFlipFlop() + : ReadAttribute("flip-flop") + { + } + + ~ReadSampleMeiFlipFlop() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::SampleMei::Attributes::FlipFlop::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, + clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeFlipFlopWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.FlipFlop response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("SampleMEI FlipFlop read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteSampleMeiFlipFlop : public WriteAttribute { +public: + WriteSampleMeiFlipFlop() + : WriteAttribute("flip-flop") + { + AddArgument("attr-name", "flip-flop"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteSampleMeiFlipFlop() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::SampleMei::Attributes::FlipFlop::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, + attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout + = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeFlipFlopWithValue:value + params:params + completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("SampleMEI FlipFlop write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON( + @(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeSampleMeiFlipFlop : public SubscribeAttribute { +public: + SubscribeAttributeSampleMeiFlipFlop() + : SubscribeAttribute("flip-flop") + { + } + + ~SubscribeAttributeSampleMeiFlipFlop() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::SampleMei::Attributes::FlipFlop::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, + attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFlipFlopWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.FlipFlop response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadSampleMeiGeneratedCommandList : public ReadAttribute { +public: + ReadSampleMeiGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadSampleMeiGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::SampleMei::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, + clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("SampleMEI GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSampleMeiGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeSampleMeiGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeSampleMeiGeneratedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::SampleMei::Attributes::GeneratedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, + attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadSampleMeiAcceptedCommandList : public ReadAttribute { +public: + ReadSampleMeiAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadSampleMeiAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::SampleMei::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, + clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("SampleMEI AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSampleMeiAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeSampleMeiAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeSampleMeiAcceptedCommandList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::SampleMei::Attributes::AcceptedCommandList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, + attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadSampleMeiEventList : public ReadAttribute { +public: + ReadSampleMeiEventList() + : ReadAttribute("event-list") + { + } + + ~ReadSampleMeiEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::SampleMei::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, + clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("SampleMEI EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSampleMeiEventList : public SubscribeAttribute { +public: + SubscribeAttributeSampleMeiEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeSampleMeiEventList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::SampleMei::Attributes::EventList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, + attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadSampleMeiAttributeList : public ReadAttribute { +public: + ReadSampleMeiAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadSampleMeiAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::SampleMei::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, + clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("SampleMEI AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSampleMeiAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeSampleMeiAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeSampleMeiAttributeList() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::SampleMei::Attributes::AttributeList::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, + attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadSampleMeiFeatureMap : public ReadAttribute { +public: + ReadSampleMeiFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadSampleMeiFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::SampleMei::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, + clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("SampleMEI FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSampleMeiFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeSampleMeiFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeSampleMeiFeatureMap() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::SampleMei::Attributes::FeatureMap::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, + attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadSampleMeiClusterRevision : public ReadAttribute { +public: + ReadSampleMeiClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadSampleMeiClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::SampleMei::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, + clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("SampleMEI ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeSampleMeiClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeSampleMeiClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeSampleMeiClusterRevision() {} + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::SampleMei::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::SampleMei::Attributes::ClusterRevision::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, + attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterSampleMEI alloc] initWithDevice:device + endpointID:@(endpointId) + queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { + mSubscriptionEstablished = YES; + } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"SampleMEI.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL + /*----------------------------------------------------------------------------*\ | Register all Clusters commands | \*----------------------------------------------------------------------------*/ @@ -167543,6 +168351,58 @@ void registerClusterUnitTesting(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterSampleMei(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::SampleMei; + + const char * clusterName = "SampleMei"; + + commands_list clusterCommands + = { make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterAny(Commands & commands) { @@ -167658,4 +168518,5 @@ void registerClusters(Commands & commands) registerClusterAccountLogin(commands); registerClusterElectricalMeasurement(commands); registerClusterUnitTesting(commands); + registerClusterSampleMei(commands); } From 89ebe1b65e1b214af31bc487234321b0a534a4ea Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Tue, 12 Sep 2023 11:57:51 -0700 Subject: [PATCH 068/134] Update .pullapprove.yml --- .pullapprove.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.pullapprove.yml b/.pullapprove.yml index 1dfcc84b50e31b..f7da2711417441 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -15,9 +15,6 @@ overrides: ############################################################ # Draft PRs ############################################################ - - if: "draft or 'WIP' in title" - status: pending - explanation: "PR is draft, pending review" - if: "draft" status: pending explanation: "PR is draft, pending review" From 7f750af2e95010f4e9f38e2771dce4a812816168 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Tue, 12 Sep 2023 20:05:20 +0100 Subject: [PATCH 069/134] UDPEndPointImplLwIP: Support LWIP_TCPIP_CORE_LOCKING=0 (#29057) Wrap calls to LwIP APIs in `tcpip_api_call()`, as required. When `LWIP_TCPIP_CORE_LOCKING` is enabled, this internally becomes `LOCK_TCPIP_CORE/UNLOCK_TCPIP_CORE` and when it isn't, it posts a message to the TCPIP task to run the function. Added CHIP stack locking to the UDP receive function. --- src/inet/BUILD.gn | 1 + src/inet/EndPointStateLwIP.cpp | 85 +++++++++++++ src/inet/EndPointStateLwIP.h | 7 +- src/inet/TCPEndPointImplLwIP.cpp | 7 ++ src/inet/UDPEndPointImplLwIP.cpp | 208 ++++++++++++++----------------- 5 files changed, 191 insertions(+), 117 deletions(-) create mode 100644 src/inet/EndPointStateLwIP.cpp diff --git a/src/inet/BUILD.gn b/src/inet/BUILD.gn index f8f81f94e3c44a..1ba8ea5687e2e3 100644 --- a/src/inet/BUILD.gn +++ b/src/inet/BUILD.gn @@ -103,6 +103,7 @@ static_library("inet") { ] if (chip_system_config_use_lwip) { + sources += [ "EndPointStateLwIP.cpp" ] public_deps += [ "${chip_root}/src/lwip" ] } diff --git a/src/inet/EndPointStateLwIP.cpp b/src/inet/EndPointStateLwIP.cpp new file mode 100644 index 00000000000000..34fba243353701 --- /dev/null +++ b/src/inet/EndPointStateLwIP.cpp @@ -0,0 +1,85 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +#include +#include + +#include + +namespace chip { +namespace Inet { + +err_t EndPointStateLwIP::RunOnTCPIPRet(std::function fn) +{ + assertChipStackLockedByCurrentThread(); +#if LWIP_TCPIP_CORE_LOCKING + err_t err; + LOCK_TCPIP_CORE(); + err = fn(); + UNLOCK_TCPIP_CORE(); + return err; +#else + // Post a message to the TCPIP task and wait for it to run. + static sys_sem_t sTCPIPSem; + static bool sTCPIPSemInited = false; + if (!sTCPIPSemInited) + { + err_t err = sys_sem_new(&sTCPIPSem, 0); + if (err != ERR_OK) + { + return err; + } + sTCPIPSemInited = true; + } + + // tcpip_callback takes a C function pointer, so we can't pass a capturing lambda to it. + // Just store the state the function we pass to it needs in statics. + // This should be safe, since that function will execute before we return and there is no + // re-entry into this method. + static std::function sTCPIPFunction; + static err_t sTCPIPFunctionResult; + VerifyOrDie(sTCPIPFunction == nullptr); + + sTCPIPFunction = fn; + const err_t err = tcpip_callback( + [](void * aCtx) { + sTCPIPFunctionResult = sTCPIPFunction(); + sys_sem_signal(&sTCPIPSem); + }, + nullptr); + if (err != ERR_OK) + { + return err; + } + sys_arch_sem_wait(&sTCPIPSem, 0); + sTCPIPFunction = nullptr; + return sTCPIPFunctionResult; +#endif +} + +void EndPointStateLwIP::RunOnTCPIP(std::function fn) +{ + VerifyOrDie(RunOnTCPIPRet([&fn]() { + fn(); + return ERR_OK; + }) == ERR_OK); +} + +} // namespace Inet +} // namespace chip diff --git a/src/inet/EndPointStateLwIP.h b/src/inet/EndPointStateLwIP.h index d42f613931484e..ddc862d65ef386 100644 --- a/src/inet/EndPointStateLwIP.h +++ b/src/inet/EndPointStateLwIP.h @@ -22,8 +22,9 @@ #pragma once -#include +#include +#include #include struct udp_pcb; @@ -46,6 +47,10 @@ class DLL_EXPORT EndPointStateLwIP UDP = 1, TCP = 2 } mLwIPEndPointType; + + // Synchronously runs a function within the TCPIP task's context. + static void RunOnTCPIP(std::function); + static err_t RunOnTCPIPRet(std::function); }; } // namespace Inet diff --git a/src/inet/TCPEndPointImplLwIP.cpp b/src/inet/TCPEndPointImplLwIP.cpp index 757b7d8d5c95de..a80253643864b8 100644 --- a/src/inet/TCPEndPointImplLwIP.cpp +++ b/src/inet/TCPEndPointImplLwIP.cpp @@ -37,6 +37,13 @@ #include #include +static_assert(LWIP_VERSION_MAJOR > 1, "CHIP requires LwIP 2.0 or later"); + +#if !(CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L) +// TODO: Update to use RunOnTCPIP. +static_assert(LWIP_TCPIP_CORE_LOCKING, "CHIP requires config LWIP_TCPIP_CORE_LOCKING enabled"); +#endif + namespace chip { namespace Inet { diff --git a/src/inet/UDPEndPointImplLwIP.cpp b/src/inet/UDPEndPointImplLwIP.cpp index 8db3d7e593e2b0..f808bf5ed9bb1c 100755 --- a/src/inet/UDPEndPointImplLwIP.cpp +++ b/src/inet/UDPEndPointImplLwIP.cpp @@ -36,15 +36,10 @@ #include #include #include -#include #include static_assert(LWIP_VERSION_MAJOR > 1, "CHIP requires LwIP 2.0 or later"); -#if !(CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L) -static_assert(LWIP_TCPIP_CORE_LOCKING, "CHIP requires config LWIP_TCPIP_CORE_LOCKING enabled"); -#endif - #if !defined(RAW_FLAGS_MULTICAST_LOOP) || !defined(UDP_FLAGS_MULTICAST_LOOP) || !defined(raw_clear_flags) || \ !defined(raw_set_flags) || !defined(udp_clear_flags) || !defined(udp_set_flags) #define HAVE_LWIP_MULTICAST_LOOP 0 @@ -66,27 +61,11 @@ static_assert(LWIP_TCPIP_CORE_LOCKING, "CHIP requires config LWIP_TCPIP_CORE_LOC namespace chip { namespace Inet { -namespace { -/** - * @brief - * RAII locking for LwIP core to simplify management of - * LOCK_TCPIP_CORE()/UNLOCK_TCPIP_CORE() calls. - */ -class ScopedLwIPLock -{ -public: - ScopedLwIPLock() { LOCK_TCPIP_CORE(); } - ~ScopedLwIPLock() { UNLOCK_TCPIP_CORE(); } -}; -} // anonymous namespace - EndpointQueueFilter * UDPEndPointImplLwIP::sQueueFilter = nullptr; CHIP_ERROR UDPEndPointImplLwIP::BindImpl(IPAddressType addressType, const IPAddress & address, uint16_t port, InterfaceId interfaceId) { - ScopedLwIPLock lwipLock; - // Make sure we have the appropriate type of PCB. CHIP_ERROR res = GetPCB(addressType); @@ -99,7 +78,7 @@ CHIP_ERROR UDPEndPointImplLwIP::BindImpl(IPAddressType addressType, const IPAddr if (res == CHIP_NO_ERROR) { - res = chip::System::MapErrorLwIP(udp_bind(mUDP, &ipAddr, port)); + res = chip::System::MapErrorLwIP(RunOnTCPIPRet([this, &ipAddr, port]() { return udp_bind(mUDP, &ipAddr, port); })); } if (res == CHIP_NO_ERROR) @@ -112,10 +91,7 @@ CHIP_ERROR UDPEndPointImplLwIP::BindImpl(IPAddressType addressType, const IPAddr CHIP_ERROR UDPEndPointImplLwIP::BindInterfaceImpl(IPAddressType addrType, InterfaceId intfId) { - // A lock is required because the LwIP thread may be referring to intf_filter, - // while this code running in the Inet application is potentially modifying it. // NOTE: this only supports LwIP interfaces whose number is no bigger than 9. - ScopedLwIPLock lwipLock; // Make sure we have the appropriate type of PCB. CHIP_ERROR err = GetPCB(addrType); @@ -139,16 +115,16 @@ CHIP_ERROR UDPEndPointImplLwIP::LwIPBindInterface(struct udp_pcb * aUDP, Interfa } } - udp_bind_netif(aUDP, netifp); + RunOnTCPIP([aUDP, netifp]() { udp_bind_netif(aUDP, netifp); }); return CHIP_NO_ERROR; } InterfaceId UDPEndPointImplLwIP::GetBoundInterface() const { - ScopedLwIPLock lwipLock; - #if HAVE_LWIP_UDP_BIND_NETIF - return InterfaceId(netif_get_by_index(mUDP->netif_idx)); + struct netif * netif; + RunOnTCPIP([this, &netif]() { netif = netif_get_by_index(mUDP->netif_idx); }); + return InterfaceId(netif); #else return InterfaceId(mUDP->intf_filter); #endif @@ -161,14 +137,14 @@ uint16_t UDPEndPointImplLwIP::GetBoundPort() const CHIP_ERROR UDPEndPointImplLwIP::ListenImpl() { - ScopedLwIPLock lwipLock; - - udp_recv(mUDP, LwIPReceiveUDPMessage, this); + RunOnTCPIP([this]() { udp_recv(mUDP, LwIPReceiveUDPMessage, this); }); return CHIP_NO_ERROR; } CHIP_ERROR UDPEndPointImplLwIP::SendMsgImpl(const IPPacketInfo * pktInfo, System::PacketBufferHandle && msg) { + assertChipStackLockedByCurrentThread(); + const IPAddress & destAddr = pktInfo->DestAddress; if (!msg.HasSoleOwnership()) @@ -185,50 +161,47 @@ CHIP_ERROR UDPEndPointImplLwIP::SendMsgImpl(const IPPacketInfo * pktInfo, System CHIP_ERROR res = CHIP_NO_ERROR; err_t lwipErr = ERR_VAL; - // Adding a scope here to unlock the LwIP core when the lock is no longer required. + // Make sure we have the appropriate type of PCB based on the destination address. + res = GetPCB(destAddr.Type()); + if (res != CHIP_NO_ERROR) { - ScopedLwIPLock lwipLock; - - // Make sure we have the appropriate type of PCB based on the destination address. - res = GetPCB(destAddr.Type()); - if (res != CHIP_NO_ERROR) - { - return res; - } + return res; + } - // Send the message to the specified address/port. - // If an outbound interface has been specified, call a specific version of the UDP sendto() - // function that accepts the target interface. - // If a source address has been specified, temporarily override the local_ip of the PCB. - // This results in LwIP using the given address being as the source address for the generated - // packet, as if the PCB had been bound to that address. - const IPAddress & srcAddr = pktInfo->SrcAddress; - const uint16_t & destPort = pktInfo->DestPort; - const InterfaceId & intfId = pktInfo->Interface; + // Send the message to the specified address/port. + // If an outbound interface has been specified, call a specific version of the UDP sendto() + // function that accepts the target interface. + // If a source address has been specified, temporarily override the local_ip of the PCB. + // This results in LwIP using the given address being as the source address for the generated + // packet, as if the PCB had been bound to that address. + const IPAddress & srcAddr = pktInfo->SrcAddress; + const uint16_t & destPort = pktInfo->DestPort; + const InterfaceId & intfId = pktInfo->Interface; - ip_addr_t lwipSrcAddr = srcAddr.ToLwIPAddr(); - ip_addr_t lwipDestAddr = destAddr.ToLwIPAddr(); + ip_addr_t lwipSrcAddr = srcAddr.ToLwIPAddr(); + ip_addr_t lwipDestAddr = destAddr.ToLwIPAddr(); - ip_addr_t boundAddr; - ip_addr_copy(boundAddr, mUDP->local_ip); + ip_addr_t boundAddr; + ip_addr_copy(boundAddr, mUDP->local_ip); - if (!ip_addr_isany(&lwipSrcAddr)) - { - ip_addr_copy(mUDP->local_ip, lwipSrcAddr); - } + if (!ip_addr_isany(&lwipSrcAddr)) + { + ip_addr_copy(mUDP->local_ip, lwipSrcAddr); + } + lwipErr = RunOnTCPIPRet([this, &intfId, &msg, &lwipDestAddr, destPort]() { if (intfId.IsPresent()) { - lwipErr = udp_sendto_if(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort, - intfId.GetPlatformInterface()); + return udp_sendto_if(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort, + intfId.GetPlatformInterface()); } else { - lwipErr = udp_sendto(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort); + return udp_sendto(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort); } + }); - ip_addr_copy(mUDP->local_ip, boundAddr); - } + ip_addr_copy(mUDP->local_ip, boundAddr); if (lwipErr != ERR_OK) { @@ -240,30 +213,31 @@ CHIP_ERROR UDPEndPointImplLwIP::SendMsgImpl(const IPPacketInfo * pktInfo, System void UDPEndPointImplLwIP::CloseImpl() { - ScopedLwIPLock lwipLock; + assertChipStackLockedByCurrentThread(); // Since UDP PCB is released synchronously here, but UDP endpoint itself might have to wait // for destruction asynchronously, there could be more allocated UDP endpoints than UDP PCBs. - if (mUDP != nullptr) + if (mUDP == nullptr) { - udp_remove(mUDP); - mUDP = nullptr; - mLwIPEndPointType = LwIPEndPointType::Unknown; - - // If there is a UDPEndPointImplLwIP::LwIPReceiveUDPMessage - // event pending in the event queue (SystemLayer::ScheduleLambda), we - // schedule a release call to the end of the queue, to ensure that the - // queued pointer to UDPEndPointImplLwIP is not dangling. - if (mDelayReleaseCount != 0) + return; + } + RunOnTCPIP([this]() { udp_remove(mUDP); }); + mUDP = nullptr; + mLwIPEndPointType = LwIPEndPointType::Unknown; + + // If there is a UDPEndPointImplLwIP::LwIPReceiveUDPMessage + // event pending in the event queue (SystemLayer::ScheduleLambda), we + // schedule a release call to the end of the queue, to ensure that the + // queued pointer to UDPEndPointImplLwIP is not dangling. + if (mDelayReleaseCount != 0) + { + Retain(); + CHIP_ERROR err = GetSystemLayer().ScheduleLambda([this] { Release(); }); + if (err != CHIP_NO_ERROR) { - Retain(); - CHIP_ERROR err = GetSystemLayer().ScheduleLambda([this] { Release(); }); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Inet, "Unable to schedule lambda: %" CHIP_ERROR_FORMAT, err.Format()); - // There is nothing we can do here, accept the chance of racing - Release(); - } + ChipLogError(Inet, "Unable to schedule lambda: %" CHIP_ERROR_FORMAT, err.Format()); + // There is nothing we can do here, accept the chance of racing + Release(); } } } @@ -306,7 +280,7 @@ void UDPEndPointImplLwIP::HandleDataReceived(System::PacketBufferHandle && msg, CHIP_ERROR UDPEndPointImplLwIP::GetPCB(IPAddressType addrType) { - // IMPORTANT: This method MUST be called with the LwIP stack LOCKED! + assertChipStackLockedByCurrentThread(); // If a PCB hasn't been allocated yet... if (mUDP == nullptr) @@ -314,12 +288,12 @@ CHIP_ERROR UDPEndPointImplLwIP::GetPCB(IPAddressType addrType) // Allocate a PCB of the appropriate type. if (addrType == IPAddressType::kIPv6) { - mUDP = udp_new_ip_type(IPADDR_TYPE_V6); + RunOnTCPIP([this]() { mUDP = udp_new_ip_type(IPADDR_TYPE_V6); }); } #if INET_CONFIG_ENABLE_IPV4 else if (addrType == IPAddressType::kIPv4) { - mUDP = udp_new_ip_type(IPADDR_TYPE_V4); + RunOnTCPIP([this]() { mUDP = udp_new_ip_type(IPADDR_TYPE_V4); }); } #endif // INET_CONFIG_ENABLE_IPV4 else @@ -474,26 +448,25 @@ CHIP_ERROR UDPEndPointImplLwIP::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInt { #if LWIP_IPV4 && LWIP_IGMP const ip4_addr_t lIPv4Address = aAddress.ToIPv4(); - err_t lStatus; - + struct netif * lNetif = nullptr; + if (aInterfaceId.IsPresent()) { - ScopedLwIPLock lwipLock; + lNetif = FindNetifFromInterfaceId(aInterfaceId); + VerifyOrReturnError(lNetif != nullptr, INET_ERROR_UNKNOWN_INTERFACE); + } - if (aInterfaceId.IsPresent()) + err_t lStatus = RunOnTCPIPRet([lNetif, &lIPv4Address, join]() { + if (lNetif != nullptr) { - - struct netif * const lNetif = FindNetifFromInterfaceId(aInterfaceId); - VerifyOrReturnError(lNetif != nullptr, INET_ERROR_UNKNOWN_INTERFACE); - - lStatus = join ? igmp_joingroup_netif(lNetif, &lIPv4Address) // - : igmp_leavegroup_netif(lNetif, &lIPv4Address); + return join ? igmp_joingroup_netif(lNetif, &lIPv4Address) // + : igmp_leavegroup_netif(lNetif, &lIPv4Address); } else { - lStatus = join ? igmp_joingroup(IP4_ADDR_ANY4, &lIPv4Address) // - : igmp_leavegroup(IP4_ADDR_ANY4, &lIPv4Address); + return join ? igmp_joingroup(IP4_ADDR_ANY4, &lIPv4Address) // + : igmp_leavegroup(IP4_ADDR_ANY4, &lIPv4Address); } - } + }); if (lStatus == ERR_MEM) { @@ -510,24 +483,25 @@ CHIP_ERROR UDPEndPointImplLwIP::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInt { #ifdef HAVE_IPV6_MULTICAST const ip6_addr_t lIPv6Address = aAddress.ToIPv6(); - err_t lStatus; - + struct netif * lNetif = nullptr; + if (aInterfaceId.IsPresent()) { - ScopedLwIPLock lwipLock; + lNetif = FindNetifFromInterfaceId(aInterfaceId); + VerifyOrReturnError(lNetif != nullptr, INET_ERROR_UNKNOWN_INTERFACE); + } - if (aInterfaceId.IsPresent()) + err_t lStatus = RunOnTCPIPRet([lNetif, &lIPv6Address, join]() { + if (lNetif != nullptr) { - struct netif * const lNetif = FindNetifFromInterfaceId(aInterfaceId); - VerifyOrReturnError(lNetif != nullptr, INET_ERROR_UNKNOWN_INTERFACE); - lStatus = join ? mld6_joingroup_netif(lNetif, &lIPv6Address) // - : mld6_leavegroup_netif(lNetif, &lIPv6Address); + return join ? mld6_joingroup_netif(lNetif, &lIPv6Address) // + : mld6_leavegroup_netif(lNetif, &lIPv6Address); } else { - lStatus = join ? mld6_joingroup(IP6_ADDR_ANY6, &lIPv6Address) // - : mld6_leavegroup(IP6_ADDR_ANY6, &lIPv6Address); + return join ? mld6_joingroup(IP6_ADDR_ANY6, &lIPv6Address) // + : mld6_leavegroup(IP6_ADDR_ANY6, &lIPv6Address); } - } + }); if (lStatus == ERR_MEM) { @@ -544,18 +518,20 @@ struct netif * UDPEndPointImplLwIP::FindNetifFromInterfaceId(InterfaceId aInterf { struct netif * lRetval = nullptr; + RunOnTCPIP([aInterfaceId, &lRetval]() { #if defined(NETIF_FOREACH) - NETIF_FOREACH(lRetval) - { - if (lRetval == aInterfaceId.GetPlatformInterface()) + NETIF_FOREACH(lRetval) { - break; + if (lRetval == aInterfaceId.GetPlatformInterface()) + { + break; + } } - } #else // defined(NETIF_FOREACH) - for (lRetval = netif_list; lRetval != nullptr && lRetval != aInterfaceId.GetPlatformInterface(); lRetval = lRetval->next) - ; + for (lRetval = netif_list; lRetval != nullptr && lRetval != aInterfaceId.GetPlatformInterface(); lRetval = lRetval->next) + ; #endif // defined(NETIF_FOREACH) + }); return (lRetval); } From b19e6f0b69579176fc97817fc0b1d52ab013ecbe Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Tue, 12 Sep 2023 16:37:44 -0400 Subject: [PATCH 070/134] [Scenes] Added the color-control cluster handler for scenes EFS (#29026) * Added the color-control cluster handler for scenes EFS * Reworked the logic when applying scene and added checks on boundaries * Modified SerializeSave to explicitely use default value on Attributes::Get failure * Removed enum for attribute index as no longer needed, reverted the changes in the move to commands introduced by the helpers * Fix commenting --- .../color-control-server.cpp | 684 ++++++++++++++---- .../color-control-server.h | 11 + 2 files changed, 541 insertions(+), 154 deletions(-) diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp index bd0ac0293e5ea0..cc8c9ab935550b 100644 --- a/src/app/clusters/color-control-server/color-control-server.cpp +++ b/src/app/clusters/color-control-server/color-control-server.cpp @@ -25,11 +25,337 @@ #include #include +#ifdef EMBER_AF_PLUGIN_SCENES +#include +#endif + using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::ColorControl; using chip::Protocols::InteractionModel::Status; +#ifdef EMBER_AF_PLUGIN_SCENES +class DefaultColorControlSceneHandler : public scenes::DefaultSceneHandlerImpl +{ +public: + // As per spec, 9 attributes are scenable in the color control cluster, if new scenables attributes are added, this value should + // be updated. + static constexpr uint8_t kColorControlScenableAttributesCount = 9; + + DefaultColorControlSceneHandler() = default; + ~DefaultColorControlSceneHandler() override {} + + // Default function for ColorControl cluster, only puts the ColorControl cluster ID in the span if supported on the caller + // endpoint + void GetSupportedClusters(EndpointId endpoint, Span & clusterBuffer) override + { + ClusterId * buffer = clusterBuffer.data(); + if (emberAfContainsServer(endpoint, ColorControl::Id) && clusterBuffer.size() >= 1) + { + buffer[0] = ColorControl::Id; + clusterBuffer.reduce_size(1); + } + else + { + clusterBuffer.reduce_size(0); + } + } + + // Default function for ColorControl cluster, only checks if ColorControl is enabled on the endpoint + bool SupportsCluster(EndpointId endpoint, ClusterId cluster) override + { + return (cluster == ColorControl::Id) && (emberAfContainsServer(endpoint, ColorControl::Id)); + } + + /// @brief Serialize the Cluster's EFS value + /// @param endpoint target endpoint + /// @param cluster target cluster + /// @param serialisedBytes data to serialize into EFS + /// @return CHIP_NO_ERROR if successfully serialized the data, CHIP_ERROR_INVALID_ARGUMENT otherwise + CHIP_ERROR SerializeSave(EndpointId endpoint, ClusterId cluster, MutableByteSpan & serializedBytes) override + { + using AttributeValuePair = Scenes::Structs::AttributeValuePair::Type; + + AttributeValuePair pairs[kColorControlScenableAttributesCount]; + + size_t attributeCount = 0; + + if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kXy)) + { + uint16_t xValue; + if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentX::Get(endpoint, &xValue)) + { + xValue = 0x616B; // Default X value according to spec + } + AddAttributeValuePair(pairs, Attributes::CurrentX::Id, xValue, attributeCount); + + uint16_t yValue; + if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentY::Get(endpoint, &yValue)) + { + yValue = 0x607D; // Default Y value according to spec + } + AddAttributeValuePair(pairs, Attributes::CurrentY::Id, yValue, attributeCount); + } + + if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kEnhancedHue)) + { + uint16_t hueValue = 0x0000; + Attributes::EnhancedCurrentHue::Get(endpoint, &hueValue); + AddAttributeValuePair(pairs, Attributes::EnhancedCurrentHue::Id, hueValue, attributeCount); + } + + if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kHueAndSaturation)) + { + uint8_t saturationValue; + if (EMBER_ZCL_STATUS_SUCCESS != Attributes::CurrentSaturation::Get(endpoint, &saturationValue)) + { + saturationValue = 0x00; + } + AddAttributeValuePair(pairs, Attributes::CurrentSaturation::Id, saturationValue, attributeCount); + } + + if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorLoop)) + { + uint8_t loopActiveValue; + if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopActive::Get(endpoint, &loopActiveValue)) + { + loopActiveValue = 0x00; + } + AddAttributeValuePair(pairs, Attributes::ColorLoopActive::Id, loopActiveValue, attributeCount); + + uint8_t loopDirectionValue; + if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopDirection::Get(endpoint, &loopDirectionValue)) + { + loopDirectionValue = 0x00; + } + AddAttributeValuePair(pairs, Attributes::ColorLoopDirection::Id, loopDirectionValue, attributeCount); + + uint16_t loopTimeValue; + if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorLoopTime::Get(endpoint, &loopTimeValue)) + { + loopTimeValue = 0x0019; // Default loop time value according to spec + } + AddAttributeValuePair(pairs, Attributes::ColorLoopTime::Id, loopTimeValue, attributeCount); + } + + if (ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorTemperature)) + { + uint16_t temperatureValue; + if (EMBER_ZCL_STATUS_SUCCESS != Attributes::ColorTemperatureMireds::Get(endpoint, &temperatureValue)) + { + temperatureValue = 0x00FA; // Default temperature value according to spec + } + AddAttributeValuePair(pairs, Attributes::ColorTemperatureMireds::Id, temperatureValue, attributeCount); + } + + uint8_t modeValue; + if (EMBER_ZCL_STATUS_SUCCESS != Attributes::EnhancedColorMode::Get(endpoint, &modeValue)) + { + modeValue = ColorControlServer::ColorMode::COLOR_MODE_CIE_XY; // Default mode value according to spec + } + AddAttributeValuePair(pairs, Attributes::EnhancedColorMode::Id, modeValue, attributeCount); + + app::DataModel::List attributeValueList(pairs, attributeCount); + + return EncodeAttributeValueList(attributeValueList, serializedBytes); + } + + /// @brief Default EFS interaction when applying scene to the ColorControl Cluster + /// @param endpoint target endpoint + /// @param cluster target cluster + /// @param serialisedBytes Data from nvm + /// @param timeMs transition time in ms + /// @return CHIP_NO_ERROR if value as expected, CHIP_ERROR_INVALID_ARGUMENT otherwise + CHIP_ERROR ApplyScene(EndpointId endpoint, ClusterId cluster, const ByteSpan & serializedBytes, + scenes::TransitionTimeMs timeMs) override + { + app::DataModel::DecodableList attributeValueList; + + ReturnErrorOnFailure(DecodeAttributeValueList(serializedBytes, attributeValueList)); + + size_t attributeCount = 0; + auto pair_iterator = attributeValueList.begin(); + + // The color control cluster should have a maximum of 9 scenable attributes + ReturnErrorOnFailure(attributeValueList.ComputeSize(&attributeCount)); + VerifyOrReturnError(attributeCount <= kColorControlScenableAttributesCount, CHIP_ERROR_BUFFER_TOO_SMALL); + // Retrieve the buffers for different modes +#ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV + ColorControlServer::ColorHueTransitionState * colorHueTransitionState = + ColorControlServer::Instance().getColorHueTransitionState(endpoint); + ColorControlServer::Color16uTransitionState * colorSaturationTransitionState = + ColorControlServer::Instance().getSaturationTransitionState(endpoint); +#endif +#ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY + ColorControlServer::Color16uTransitionState * colorXTransitionState = + ColorControlServer::Instance().getXTransitionState(endpoint); + ColorControlServer::Color16uTransitionState * colorYTransitionState = + ColorControlServer::Instance().getYTransitionState(endpoint); +#endif +#ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP + ColorControlServer::Color16uTransitionState * colorTempTransitionState = + ColorControlServer::Instance().getTempTransitionState(endpoint); +#endif + + // Initialize action attributes to default values in case they are not in the scene + uint8_t targetColorMode = 0x00; + uint8_t loopActiveValue = 0x00; + uint8_t loopDirectionValue = 0x00; + uint16_t loopTimeValue = 0x0019; // Default loop time value according to spec + + while (pair_iterator.Next()) + { + auto & decodePair = pair_iterator.GetValue(); + + switch (decodePair.attributeID) + { + case Attributes::CurrentX::Id: + if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_X_AND_CURRENT_Y)) + { + if (decodePair.attributeValue) + colorXTransitionState->finalValue = + std::min(static_cast(decodePair.attributeValue), colorXTransitionState->highLimit); + } + break; + case Attributes::CurrentY::Id: + if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_X_AND_CURRENT_Y)) + { + colorYTransitionState->finalValue = + std::min(static_cast(decodePair.attributeValue), colorYTransitionState->highLimit); + } + break; + case Attributes::EnhancedCurrentHue::Id: + if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_ENHANCED_CURRENT_HUE_AND_CURRENT_SATURATION)) + { + colorHueTransitionState->finalEnhancedHue = static_cast(decodePair.attributeValue); + } + break; + case Attributes::CurrentSaturation::Id: + if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION)) + { + colorSaturationTransitionState->finalValue = + std::min(static_cast(decodePair.attributeValue), colorSaturationTransitionState->highLimit); + } + break; + case Attributes::ColorLoopActive::Id: + loopActiveValue = static_cast(decodePair.attributeValue); + break; + case Attributes::ColorLoopDirection::Id: + loopDirectionValue = static_cast(decodePair.attributeValue); + break; + case Attributes::ColorLoopTime::Id: + loopTimeValue = static_cast(decodePair.attributeValue); + break; + case Attributes::ColorTemperatureMireds::Id: + if (SupportsColorMode(endpoint, EMBER_ZCL_ENHANCED_COLOR_MODE_COLOR_TEMPERATURE)) + { + colorTempTransitionState->finalValue = + std::min(static_cast(decodePair.attributeValue), colorTempTransitionState->highLimit); + } + break; + case Attributes::EnhancedColorMode::Id: + if (decodePair.attributeValue <= static_cast(ColorControlServer::ColorMode::COLOR_MODE_EHSV)) + { + targetColorMode = static_cast(decodePair.attributeValue); + } + break; + default: + return CHIP_ERROR_INVALID_ARGUMENT; + break; + } + } + ReturnErrorOnFailure(pair_iterator.GetStatus()); + + // Switch to the mode saved in the scene + if (SupportsColorMode(endpoint, targetColorMode)) + { + ColorControlServer::Instance().handleModeSwitch(endpoint, targetColorMode); + } + else + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + uint16_t transitionTime10th = static_cast(timeMs / 100); + + if (loopActiveValue == 1 && ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorLoop)) + { + // Set Loop Scene Attributes and start loop if scene stored active loop + Attributes::ColorLoopDirection::Set(endpoint, loopDirectionValue); + Attributes::ColorLoopTime::Set(endpoint, loopTimeValue); + // Tries to apply color control loop + ColorControlServer::Instance().startColorLoop(endpoint, true); + } + else + { + // Execute movement to value depending on the mode in the saved scene + switch (targetColorMode) + { + case ColorControlServer::ColorMode::COLOR_MODE_HSV: +#ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV + ColorControlServer::Instance().moveToSaturation(static_cast(colorSaturationTransitionState->finalValue), + transitionTime10th, endpoint); +#endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV + break; + case ColorControlServer::ColorMode::COLOR_MODE_CIE_XY: +#ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY + ColorControlServer::Instance().moveToColor(colorXTransitionState->finalValue, colorYTransitionState->finalValue, + transitionTime10th, endpoint); +#endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY + break; + case ColorControlServer::ColorMode::COLOR_MODE_TEMPERATURE: +#ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP + ColorControlServer::Instance().moveToColorTemp( + endpoint, static_cast(colorTempTransitionState->finalValue), transitionTime10th); +#endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP + break; + case ColorControlServer::ColorMode::COLOR_MODE_EHSV: +#ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV + ColorControlServer::Instance().moveToHueAndSaturation( + colorHueTransitionState->finalEnhancedHue, static_cast(colorSaturationTransitionState->finalValue), + transitionTime10th, true, endpoint); +#endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV + break; + default: + return CHIP_ERROR_INVALID_ARGUMENT; + } + } + return CHIP_NO_ERROR; + } + +private: + bool SupportsColorMode(EndpointId endpoint, uint8_t mode) + { + switch (mode) + { + case EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_HUE_AND_CURRENT_SATURATION: + return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kHueAndSaturation); + break; + case EMBER_ZCL_ENHANCED_COLOR_MODE_CURRENT_X_AND_CURRENT_Y: + return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kXy); + break; + case EMBER_ZCL_ENHANCED_COLOR_MODE_COLOR_TEMPERATURE: + return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kColorTemperature); + break; + case EMBER_ZCL_ENHANCED_COLOR_MODE_ENHANCED_CURRENT_HUE_AND_CURRENT_SATURATION: + return ColorControlServer::Instance().HasFeature(endpoint, ColorControlServer::Feature::kEnhancedHue); + break; + default: + return false; + } + } + + void AddAttributeValuePair(Scenes::Structs::AttributeValuePair::Type * pairs, AttributeId id, uint32_t value, + size_t & attributeCount) + { + pairs[attributeCount].attributeID = id; + pairs[attributeCount].attributeValue = value; + attributeCount++; + } +}; +static DefaultColorControlSceneHandler sColorControlSceneHandler; +#endif // EMBER_AF_PLUGIN_SCENES + /********************************************************** * Matter timer scheduling glue logic *********************************************************/ @@ -79,6 +405,16 @@ ColorControlServer & ColorControlServer::Instance() return instance; } +chip::scenes::SceneHandler * ColorControlServer::GetSceneHandler() +{ + +#ifdef EMBER_AF_PLUGIN_SCENES + return &sColorControlSceneHandler; +#else + return nullptr; +#endif // EMBER_AF_PLUGIN_SCENES +} + bool ColorControlServer::HasFeature(chip::EndpointId endpoint, Feature feature) { bool success; @@ -850,6 +1186,130 @@ EmberEventControl * ColorControlServer::configureHSVEventControl(EndpointId endp return controller; } +/** + * @brief executes move to saturation command + * + * @param saturation target saturation + * @param transitionTime transition time in 10th of seconds + * @param endpoint target endpoint where to execute move + * @return Status::Success if successful,Status::UnsupportedEndpoint if the saturation transition state doesn't exist, + * Status::ConstraintError if the saturation is above maximum + */ +Status ColorControlServer::moveToSaturation(uint8_t saturation, uint16_t transitionTime, EndpointId endpoint) +{ + Color16uTransitionState * colorSaturationTransitionState = getSaturationTransitionState(endpoint); + VerifyOrReturnError(nullptr != colorSaturationTransitionState, Status::UnsupportedEndpoint); + + // New command. Need to stop any active transitions. + stopAllColorTransitions(endpoint); + + // Handle color mode transition, if necessary. + handleModeSwitch(endpoint, COLOR_MODE_HSV); + + // now, kick off the state machine. + initSaturationTransitionState(endpoint, colorSaturationTransitionState); + colorSaturationTransitionState->finalValue = saturation; + colorSaturationTransitionState->stepsRemaining = max(transitionTime, 1); + colorSaturationTransitionState->stepsTotal = colorSaturationTransitionState->stepsRemaining; + colorSaturationTransitionState->timeRemaining = transitionTime; + colorSaturationTransitionState->endpoint = endpoint; + colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; + colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; + + SetHSVRemainingTime(endpoint); + + // kick off the state machine: + scheduleTimerCallbackMs(configureHSVEventControl(endpoint), transitionTime ? TRANSITION_UPDATE_TIME_MS.count() : 0); + + return Status::Success; +} + +/** + * @brief executes move to hue and saturatioan command + * + * @param[in] hue target hue + * @param[in] saturation target saturation + * @param[in] transitionTime transition time in 10th of seconds + * @param[in] isEnhanced If True, function was called by EnhancedMoveHue command and rate is a uint16 value. If False function + * was called by MoveHue command and rate is a uint8 value + * @param[in] endpoint + * @return Status::Success if successful,Status::UnsupportedEndpoint if the saturation transition state doesn't exist, + * Status::ConstraintError if the saturation is above maximum + */ +Status ColorControlServer::moveToHueAndSaturation(uint16_t hue, uint8_t saturation, uint16_t transitionTime, bool isEnhanced, + EndpointId endpoint) +{ + uint16_t currentHue = 0; + uint16_t halfWay = isEnhanced ? HALF_MAX_UINT16T : HALF_MAX_UINT8T; + bool moveUp; + + Color16uTransitionState * colorSaturationTransitionState = getSaturationTransitionState(endpoint); + ColorHueTransitionState * colorHueTransitionState = getColorHueTransitionState(endpoint); + + VerifyOrReturnError(nullptr != colorSaturationTransitionState, Status::UnsupportedEndpoint); + VerifyOrReturnError(nullptr != colorHueTransitionState, Status::UnsupportedEndpoint); + + // New command. Need to stop any active transitions. + stopAllColorTransitions(endpoint); + + // Handle color mode transition, if necessary. + if (isEnhanced) + { + handleModeSwitch(endpoint, ColorMode::COLOR_MODE_EHSV); + } + else + { + handleModeSwitch(endpoint, ColorMode::COLOR_MODE_HSV); + } + + // now, kick off the state machine. + initHueTransitionState(endpoint, colorHueTransitionState, isEnhanced); + + if (isEnhanced) + { + currentHue = colorHueTransitionState->currentEnhancedHue; + colorHueTransitionState->finalEnhancedHue = hue; + } + else + { + currentHue = static_cast(colorHueTransitionState->currentHue); + colorHueTransitionState->finalHue = static_cast(hue); + } + + // compute shortest direction + if (hue > currentHue) + { + moveUp = (hue - currentHue) < halfWay; + } + else + { + moveUp = (currentHue - hue) > halfWay; + } + + colorHueTransitionState->up = moveUp; + colorHueTransitionState->stepsRemaining = max(transitionTime, 1); + colorHueTransitionState->stepsTotal = colorHueTransitionState->stepsRemaining; + colorHueTransitionState->timeRemaining = transitionTime; + colorHueTransitionState->endpoint = endpoint; + colorHueTransitionState->repeat = false; + + initSaturationTransitionState(endpoint, colorSaturationTransitionState); + colorSaturationTransitionState->finalValue = saturation; + colorSaturationTransitionState->stepsRemaining = colorHueTransitionState->stepsRemaining; + colorSaturationTransitionState->stepsTotal = colorHueTransitionState->stepsRemaining; + colorSaturationTransitionState->timeRemaining = transitionTime; + colorSaturationTransitionState->endpoint = endpoint; + colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; + colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; + + SetHSVRemainingTime(endpoint); + + // kick off the state machine: + scheduleTimerCallbackMs(configureHSVEventControl(endpoint), transitionTime ? TRANSITION_UPDATE_TIME_MS.count() : 0); + + return Status::Success; +} + /** * @brief Executes move Hue Command * @@ -858,8 +1318,8 @@ EmberEventControl * ColorControlServer::configureHSVEventControl(EndpointId endp * @param[in] rate * @param[in] optionsMask * @param[in] optionsOverride - * @param[in] isEnhanced If True, function was called by EnhancedMoveHue command and rate is a uint16 value. If False function was - * called by MoveHue command and rate is a uint8 value + * @param[in] isEnhanced If True, function was called by EnhancedMoveHue command and rate is a uint16 value. If False function + * was called by MoveHue command and rate is a uint8 value * @return true Success * @return false Failed */ @@ -963,8 +1423,8 @@ bool ColorControlServer::moveHueCommand(app::CommandHandler * commandObj, const * @param[in] transitionTime * @param[in] optionsMask * @param[in] optionsOverride - * @param[in] isEnhanced If True, function was called by EnhancedMoveHue command and rate is a uint16 value. If False function was - * called by MoveHue command and rate is a uint8 value + * @param[in] isEnhanced If True, function was called by EnhancedMoveHue command and rate is a uint16 value. If False function + * was called by MoveHue command and rate is a uint8 value * @return true Success * @return false Failed */ @@ -1089,14 +1549,15 @@ bool ColorControlServer::moveToHueCommand(app::CommandHandler * commandObj, cons /** * @brief executes move to hue and saturatioan command * - * @param[in] endpoint + * @param[in] commandObj + * @param[in] commandPath * @param[in] hue * @param[in] saturation * @param[in] transitionTime * @param[in] optionsMask * @param[in] optionsOverride - * @param[in] isEnhanced If True, function was called by EnhancedMoveHue command and rate is a uint16 value. If False function was - * called by MoveHue command and rate is a uint8 value + * @param[in] isEnhanced If True, function was called by EnhancedMoveHue command and rate is a uint16 value. If False function + * was called by MoveHue command and rate is a uint8 value * @return true Success * @return false Failed */ @@ -1105,19 +1566,6 @@ bool ColorControlServer::moveToHueAndSaturationCommand(app::CommandHandler * com uint8_t saturation, uint16_t transitionTime, uint8_t optionsMask, uint8_t optionsOverride, bool isEnhanced) { - EndpointId endpoint = commandPath.mEndpointId; - - Status status = Status::Success; - uint16_t currentHue = 0; - uint16_t halfWay = isEnhanced ? HALF_MAX_UINT16T : HALF_MAX_UINT8T; - bool moveUp; - - Color16uTransitionState * colorSaturationTransitionState = getSaturationTransitionState(endpoint); - ColorHueTransitionState * colorHueTransitionState = getColorHueTransitionState(endpoint); - - VerifyOrExit(colorSaturationTransitionState != nullptr, status = Status::UnsupportedEndpoint); - VerifyOrExit(colorHueTransitionState != nullptr, status = Status::UnsupportedEndpoint); - // limit checking: hue and saturation are 0..254. Spec dictates we ignore // this and report a constraint error. if ((!isEnhanced && hue > MAX_HUE_VALUE) || saturation > MAX_SATURATION_VALUE) @@ -1126,71 +1574,15 @@ bool ColorControlServer::moveToHueAndSaturationCommand(app::CommandHandler * com return true; } - if (!shouldExecuteIfOff(endpoint, optionsMask, optionsOverride)) + if (!shouldExecuteIfOff(commandPath.mEndpointId, optionsMask, optionsOverride)) { commandObj->AddStatus(commandPath, Status::Success); return true; } - - // New command. Need to stop any active transitions. - stopAllColorTransitions(endpoint); - - // Handle color mode transition, if necessary. - if (isEnhanced) - { - handleModeSwitch(endpoint, ColorControlServer::ColorMode::COLOR_MODE_EHSV); - } - else - { - handleModeSwitch(endpoint, ColorControlServer::ColorMode::COLOR_MODE_HSV); - } - - // now, kick off the state machine. - initHueTransitionState(endpoint, colorHueTransitionState, isEnhanced); - - if (isEnhanced) - { - currentHue = colorHueTransitionState->currentEnhancedHue; - colorHueTransitionState->finalEnhancedHue = hue; - } - else - { - currentHue = static_cast(colorHueTransitionState->currentHue); - colorHueTransitionState->finalHue = static_cast(hue); - } - - // compute shortest direction - if (hue > currentHue) - { - moveUp = (hue - currentHue) < halfWay; - } - else - { - moveUp = (currentHue - hue) > halfWay; - } - - colorHueTransitionState->up = moveUp; - colorHueTransitionState->stepsRemaining = max(transitionTime, 1); - colorHueTransitionState->stepsTotal = colorHueTransitionState->stepsRemaining; - colorHueTransitionState->timeRemaining = transitionTime; - colorHueTransitionState->endpoint = endpoint; - colorHueTransitionState->repeat = false; - - initSaturationTransitionState(endpoint, colorSaturationTransitionState); - colorSaturationTransitionState->finalValue = saturation; - colorSaturationTransitionState->stepsRemaining = colorHueTransitionState->stepsRemaining; - colorSaturationTransitionState->stepsTotal = colorHueTransitionState->stepsRemaining; - colorSaturationTransitionState->timeRemaining = transitionTime; - colorSaturationTransitionState->endpoint = endpoint; - colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; - colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - - SetHSVRemainingTime(endpoint); - - // kick off the state machine: - scheduleTimerCallbackMs(configureHSVEventControl(endpoint), transitionTime ? TRANSITION_UPDATE_TIME_MS.count() : 0); - -exit: + Status status = moveToHueAndSaturation(hue, saturation, transitionTime, isEnhanced, commandPath.mEndpointId); +#ifdef EMBER_AF_PLUGIN_SCENES + Scenes::ScenesServer::Instance().MakeSceneInvalid(commandPath.mEndpointId); +#endif // EMBER_AF_PLUGIN_SCENES commandObj->AddStatus(commandPath, status); return true; } @@ -1204,8 +1596,8 @@ bool ColorControlServer::moveToHueAndSaturationCommand(app::CommandHandler * com * @param[in] transitionTime * @param[in] optionsMask * @param[in] optionsOverride - * @param[in] isEnhanced If True, function was called by EnhancedMoveHue command and rate is a uint16 value. If False function was - * called by MoveHue command and rate is a uint8 value + * @param[in] isEnhanced If True, function was called by EnhancedMoveHue command and rate is a uint16 value. If False function + * was called by MoveHue command and rate is a uint8 value * @return true Success * @return false Failed */ @@ -1370,62 +1762,32 @@ bool ColorControlServer::moveSaturationCommand(app::CommandHandler * commandObj, /** * @brief executes move to saturation command * - * @param saturation - * @param transitionTime - * @param optionsMask - * @param optionsOverride + * @param commandObj + * @param commandPath + * @param commandData * @return true * @return false */ bool ColorControlServer::moveToSaturationCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::MoveToSaturation::DecodableType & commandData) { - uint8_t saturation = commandData.saturation; - uint16_t transitionTime = commandData.transitionTime; - uint8_t optionsMask = commandData.optionsMask; - uint8_t optionsOverride = commandData.optionsOverride; - EndpointId endpoint = commandPath.mEndpointId; - Status status = Status::Success; - - Color16uTransitionState * colorSaturationTransitionState = getSaturationTransitionState(endpoint); - VerifyOrExit(colorSaturationTransitionState != nullptr, status = Status::UnsupportedEndpoint); - - // limit checking: hue and saturation are 0..254. Spec dictates we ignore + // limit checking: saturation is 0..254. Spec dictates we ignore // this and report a malformed packet. - if (saturation > MAX_SATURATION_VALUE) + if (commandData.saturation > MAX_SATURATION_VALUE) { commandObj->AddStatus(commandPath, Status::ConstraintError); return true; } - if (!shouldExecuteIfOff(endpoint, optionsMask, optionsOverride)) + if (!shouldExecuteIfOff(commandPath.mEndpointId, commandData.optionsMask, commandData.optionsOverride)) { commandObj->AddStatus(commandPath, Status::Success); return true; } - - // New command. Need to stop any active transitions. - stopAllColorTransitions(endpoint); - - // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_HSV); - - // now, kick off the state machine. - initSaturationTransitionState(endpoint, colorSaturationTransitionState); - colorSaturationTransitionState->finalValue = saturation; - colorSaturationTransitionState->stepsRemaining = max(transitionTime, 1); - colorSaturationTransitionState->stepsTotal = colorSaturationTransitionState->stepsRemaining; - colorSaturationTransitionState->timeRemaining = transitionTime; - colorSaturationTransitionState->endpoint = endpoint; - colorSaturationTransitionState->lowLimit = MIN_SATURATION_VALUE; - colorSaturationTransitionState->highLimit = MAX_SATURATION_VALUE; - - SetHSVRemainingTime(endpoint); - - // kick off the state machine: - scheduleTimerCallbackMs(configureHSVEventControl(endpoint), transitionTime ? TRANSITION_UPDATE_TIME_MS.count() : 0); - -exit: + Status status = moveToSaturation(commandData.saturation, commandData.transitionTime, commandPath.mEndpointId); +#ifdef EMBER_AF_PLUGIN_SCENES + Scenes::ScenesServer::Instance().MakeSceneInvalid(commandPath.mEndpointId); +#endif // EMBER_AF_PLUGIN_SCENES commandObj->AddStatus(commandPath, status); return true; } @@ -1607,6 +1969,9 @@ bool ColorControlServer::colorLoopCommand(app::CommandHandler * commandObj, cons } exit: +#ifdef EMBER_AF_PLUGIN_SCENES + Scenes::ScenesServer::Instance().MakeSceneInvalid(endpoint); +#endif // EMBER_AF_PLUGIN_SCENES commandObj->AddStatus(commandPath, status); return true; } @@ -1751,34 +2116,28 @@ EmberEventControl * ColorControlServer::configureXYEventControl(EndpointId endpo return controller; } -bool ColorControlServer::moveToColorCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - const Commands::MoveToColor::DecodableType & commandData) +/** + * @brief executes move to saturation command + * + * @param colorX target X + * @param colorY target Y + * @param transitionTime transition time in 10th of seconds + * @param endpoint target endpoint where to execute move + * @return Status::Success if successful,Status::UnsupportedEndpoint XY is not supported on the endpoint + */ +Status ColorControlServer::moveToColor(uint16_t colorX, uint16_t colorY, uint16_t transitionTime, EndpointId endpoint) { - uint16_t colorX = commandData.colorX; - uint16_t colorY = commandData.colorY; - uint16_t transitionTime = commandData.transitionTime; - uint8_t optionsMask = commandData.optionsMask; - uint8_t optionsOverride = commandData.optionsOverride; - EndpointId endpoint = commandPath.mEndpointId; - Status status = Status::Success; - Color16uTransitionState * colorXTransitionState = getXTransitionState(endpoint); Color16uTransitionState * colorYTransitionState = getYTransitionState(endpoint); - VerifyOrExit(colorXTransitionState != nullptr, status = Status::UnsupportedEndpoint); - VerifyOrExit(colorYTransitionState != nullptr, status = Status::UnsupportedEndpoint); - - if (!shouldExecuteIfOff(endpoint, optionsMask, optionsOverride)) - { - commandObj->AddStatus(commandPath, Status::Success); - return true; - } + VerifyOrReturnError(nullptr != colorXTransitionState, Status::UnsupportedEndpoint); + VerifyOrReturnError(nullptr != colorYTransitionState, Status::UnsupportedEndpoint); // New command. Need to stop any active transitions. stopAllColorTransitions(endpoint); // Handle color mode transition, if necessary. - handleModeSwitch(endpoint, COLOR_MODE_CIE_XY); + handleModeSwitch(endpoint, ColorMode::COLOR_MODE_CIE_XY); // now, kick off the state machine. Attributes::CurrentX::Get(endpoint, &(colorXTransitionState->initialValue)); @@ -1806,7 +2165,22 @@ bool ColorControlServer::moveToColorCommand(app::CommandHandler * commandObj, co // kick off the state machine: scheduleTimerCallbackMs(configureXYEventControl(endpoint), transitionTime ? TRANSITION_UPDATE_TIME_MS.count() : 0); -exit: + return Status::Success; +} + +bool ColorControlServer::moveToColorCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, + const Commands::MoveToColor::DecodableType & commandData) +{ + if (!shouldExecuteIfOff(commandPath.mEndpointId, commandData.optionsMask, commandData.optionsOverride)) + { + commandObj->AddStatus(commandPath, Status::Success); + return true; + } + + Status status = moveToColor(commandData.colorX, commandData.colorY, commandData.transitionTime, commandPath.mEndpointId); +#ifdef EMBER_AF_PLUGIN_SCENES + Scenes::ScenesServer::Instance().MakeSceneInvalid(commandPath.mEndpointId); +#endif // EMBER_AF_PLUGIN_SCENES commandObj->AddStatus(commandPath, status); return true; } @@ -2041,13 +2415,14 @@ ColorControlServer::Color16uTransitionState * ColorControlServer::getTempTransit * @param aEndpoint * @param colorTemperature * @param transitionTime + * @return Status::Success if successful, Status::UnsupportedEndpoint if the endpoint doesn't support color temperature */ Status ColorControlServer::moveToColorTemp(EndpointId aEndpoint, uint16_t colorTemperature, uint16_t transitionTime) { EndpointId endpoint = aEndpoint; Color16uTransitionState * colorTempTransitionState = getTempTransitionState(endpoint); - VerifyOrReturnError(colorTempTransitionState != nullptr, Status::UnsupportedEndpoint); + VerifyOrReturnError(nullptr != colorTempTransitionState, Status::UnsupportedEndpoint); uint16_t temperatureMin = MIN_TEMPERATURE_VALUE; Attributes::ColorTempPhysicalMinMireds::Get(endpoint, &temperatureMin); @@ -2323,21 +2698,17 @@ bool ColorControlServer::moveColorTempCommand(app::CommandHandler * commandObj, bool ColorControlServer::moveToColorTempCommand(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::MoveToColorTemperature::DecodableType & commandData) { - uint16_t colorTemperature = commandData.colorTemperatureMireds; - uint16_t transitionTime = commandData.transitionTime; - uint8_t optionsMask = commandData.optionsMask; - uint8_t optionsOverride = commandData.optionsOverride; - EndpointId endpoint = commandPath.mEndpointId; - - if (!shouldExecuteIfOff(endpoint, optionsMask, optionsOverride)) + if (!shouldExecuteIfOff(commandPath.mEndpointId, commandData.optionsMask, commandData.optionsOverride)) { commandObj->AddStatus(commandPath, Status::Success); return true; } - Status error = moveToColorTemp(endpoint, colorTemperature, transitionTime); - - commandObj->AddStatus(commandPath, error); + Status status = moveToColorTemp(commandPath.mEndpointId, commandData.colorTemperatureMireds, commandData.transitionTime); +#ifdef EMBER_AF_PLUGIN_SCENES + Scenes::ScenesServer::Instance().MakeSceneInvalid(commandPath.mEndpointId); +#endif // EMBER_AF_PLUGIN_SCENES + commandObj->AddStatus(commandPath, status); return true; } @@ -2686,6 +3057,11 @@ void emberAfColorControlClusterServerInitCallback(EndpointId endpoint) #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP ColorControlServer::Instance().startUpColorTempCommand(endpoint); #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP +#ifdef EMBER_AF_PLUGIN_SCENES + // Registers Scene handlers for the color control cluster on the server + app::Clusters::Scenes::ScenesServer::Instance().RegisterSceneHandler(endpoint, + ColorControlServer::Instance().GetSceneHandler()); +#endif } void MatterColorControlClusterServerShutdownCallback(EndpointId endpoint) diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h index 814bdfd5c1b7f5..2ec0f5e63b4a3f 100644 --- a/src/app/clusters/color-control-server/color-control-server.h +++ b/src/app/clusters/color-control-server/color-control-server.h @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -133,6 +134,8 @@ class ColorControlServer *********************************************************/ static ColorControlServer & Instance(); + chip::scenes::SceneHandler * GetSceneHandler(); + bool HasFeature(chip::EndpointId endpoint, Feature feature); chip::Protocols::InteractionModel::Status stopAllColorTransitions(chip::EndpointId endpoint); bool stopMoveStepCommand(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, @@ -207,6 +210,10 @@ class ColorControlServer void cancelEndpointTimerCallback(EmberEventControl * control); #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV + chip::Protocols::InteractionModel::Status moveToSaturation(uint8_t saturation, uint16_t transitionTime, + chip::EndpointId endpoint); + chip::Protocols::InteractionModel::Status moveToHueAndSaturation(uint16_t hue, uint8_t saturation, uint16_t transitionTime, + bool isEnhanced, chip::EndpointId endpoint); ColorHueTransitionState * getColorHueTransitionState(chip::EndpointId endpoint); Color16uTransitionState * getSaturationTransitionState(chip::EndpointId endpoint); uint8_t getSaturation(chip::EndpointId endpoint); @@ -225,6 +232,8 @@ class ColorControlServer #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_HSV #ifdef EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_XY + chip::Protocols::InteractionModel::Status moveToColor(uint16_t colorX, uint16_t colorY, uint16_t transitionTime, + chip::EndpointId endpoint); Color16uTransitionState * getXTransitionState(chip::EndpointId endpoint); Color16uTransitionState * getYTransitionState(chip::EndpointId endpoint); uint16_t findNewColorValueFromStep(uint16_t oldValue, int16_t step); @@ -262,6 +271,8 @@ class ColorControlServer #endif // EMBER_AF_PLUGIN_COLOR_CONTROL_SERVER_TEMP EmberEventControl eventControls[kColorControlClusterServerMaxEndpointCount]; + + friend class DefaultColorControlSceneHandler; }; /********************************************************** From c0bf847ca39f568f5a7fecbd52c474ddaf541620 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Tue, 12 Sep 2023 16:52:59 -0400 Subject: [PATCH 071/134] Make ReadClient::Callback non-movable (#29191) The purpose of this interface is be called polymorphically through a pointer. Moving it will invalidate the original instance and is very likely to be a bug. Make this type non-movable; this will fail compilation if a derived class is stored in an inappropriate container that moves its elements. As an example, ClusterStateCache is also currently movable, but moving it retains a pointer to the moved-from instance via mBufferedReader, so any further usage is likely to result in a invalid memory access. --- src/app/ClusterStateCache.h | 13 +++++++++++++ src/app/ReadClient.cpp | 1 - src/app/ReadClient.h | 8 ++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/app/ClusterStateCache.h b/src/app/ClusterStateCache.h index 9e08abacde7768..2a96a949193f4f 100644 --- a/src/app/ClusterStateCache.h +++ b/src/app/ClusterStateCache.h @@ -71,6 +71,14 @@ class ClusterStateCache : protected ReadClient::Callback class Callback : public ReadClient::Callback { public: + Callback() = default; + + // Callbacks are not expected to be copyable or movable. + Callback(const Callback &) = delete; + Callback(Callback &&) = delete; + Callback & operator=(const Callback &) = delete; + Callback & operator=(Callback &&) = delete; + /* * Called anytime an attribute value has changed in the cache */ @@ -103,6 +111,11 @@ class ClusterStateCache : protected ReadClient::Callback mHighestReceivedEventNumber = highestReceivedEventNumber; } + ClusterStateCache(const ClusterStateCache &) = delete; + ClusterStateCache(ClusterStateCache &&) = delete; + ClusterStateCache & operator=(const ClusterStateCache &) = delete; + ClusterStateCache & operator=(ClusterStateCache &&) = delete; + void SetHighestReceivedEventNumber(EventNumber highestReceivedEventNumber) { mHighestReceivedEventNumber.SetValue(highestReceivedEventNumber); diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index c9df6638b708ef..caac866aeba08c 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -45,7 +45,6 @@ ReadClient::ReadClient(InteractionModelEngine * apImEngine, Messaging::ExchangeM mOnConnectionFailureCallback(HandleDeviceConnectionFailure, this) { mpExchangeMgr = apExchangeMgr; - mpCallback = apCallback; mInteractionType = aInteractionType; mpImEngine = apImEngine; diff --git a/src/app/ReadClient.h b/src/app/ReadClient.h index 71844713ff1461..85bcd124e5190f 100644 --- a/src/app/ReadClient.h +++ b/src/app/ReadClient.h @@ -72,6 +72,14 @@ class ReadClient : public Messaging::ExchangeDelegate class Callback { public: + Callback() = default; + + // Callbacks are not expected to be copyable or movable. + Callback(const Callback &) = delete; + Callback(Callback &&) = delete; + Callback & operator=(const Callback &) = delete; + Callback & operator=(Callback &&) = delete; + virtual ~Callback() = default; /** From 6315ea5dfcac8c434a2e3b6dd3c33d8187e5afa2 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Wed, 13 Sep 2023 09:14:12 +1200 Subject: [PATCH 072/134] Darwin: Bug fixes in BleConnectionDelegateImpl (#29059) * Avoid clearing the `ble` global if it points to a different instance. * Capture the CBPeripheral strong ref instead of the void * in dispatches. * Also read characteristic value before dispatching and improve logging. --- src/platform/Darwin/BleConnectionDelegate.h | 3 ++ .../Darwin/BleConnectionDelegateImpl.mm | 31 ++++++++++++------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/platform/Darwin/BleConnectionDelegate.h b/src/platform/Darwin/BleConnectionDelegate.h index a86743720a1497..de97ac383729c1 100644 --- a/src/platform/Darwin/BleConnectionDelegate.h +++ b/src/platform/Darwin/BleConnectionDelegate.h @@ -31,6 +31,9 @@ class BleConnectionDelegateImpl : public Ble::BleConnectionDelegate virtual void NewConnection(Ble::BleLayer * bleLayer, void * appState, const SetupDiscriminator & connDiscriminator); virtual void NewConnection(Ble::BleLayer * bleLayer, void * appState, BLE_CONNECTION_OBJECT connObj); virtual CHIP_ERROR CancelConnection(); + +private: + CHIP_ERROR DoCancel(); }; } // namespace Internal diff --git a/src/platform/Darwin/BleConnectionDelegateImpl.mm b/src/platform/Darwin/BleConnectionDelegateImpl.mm index 1d4e76618ac321..6045c87bdff3d4 100644 --- a/src/platform/Darwin/BleConnectionDelegateImpl.mm +++ b/src/platform/Darwin/BleConnectionDelegateImpl.mm @@ -103,7 +103,7 @@ - (void)removePeripheralsFromCache; // Make a copy of the device discriminator for the block to capture. SetupDiscriminator deviceDiscriminator = inDeviceDiscriminator; - ChipLogProgress(Ble, "%s", __FUNCTION__); + ChipLogProgress(Ble, "ConnectionDelegate NewConnection with discriminator"); if (!bleWorkQueue) { bleWorkQueue = dispatch_queue_create(kBleWorkQueueName, DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); } @@ -134,12 +134,13 @@ - (void)removePeripheralsFromCache; { assertChipStackLockedByCurrentThread(); - ChipLogProgress(Ble, "%s", __FUNCTION__); + ChipLogProgress(Ble, "ConnectionDelegate NewConnection with conn obj: %p", connObj); if (!bleWorkQueue) { bleWorkQueue = dispatch_queue_create(kBleWorkQueueName, DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); } + CBPeripheral * peripheral = (__bridge CBPeripheral *) connObj; // bridge (and retain) before dispatching dispatch_async(bleWorkQueue, ^{ // The BLE_CONNECTION_OBJECT represent a CBPeripheral object. In order for it to be valid the central // manager needs to still be running. @@ -157,7 +158,7 @@ - (void)removePeripheralsFromCache; ble.appState = appState; ble.onConnectionComplete = OnConnectionComplete; ble.onConnectionError = OnConnectionError; - [ble updateWithPeripheral:(__bridge CBPeripheral *) connObj]; + [ble updateWithPeripheral:peripheral]; }); } @@ -165,7 +166,7 @@ - (void)removePeripheralsFromCache; { assertChipStackLockedByCurrentThread(); - ChipLogProgress(Ble, "%s", __FUNCTION__); + ChipLogProgress(Ble, "ConnectionDelegate StartScan%s", (delegate ? " with delegate" : "")); if (!bleWorkQueue) { bleWorkQueue = dispatch_queue_create(kBleWorkQueueName, DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); @@ -191,15 +192,19 @@ - (void)removePeripheralsFromCache; void BleConnectionDelegateImpl::StopScan() { - assertChipStackLockedByCurrentThread(); - CancelConnection(); + ChipLogProgress(Ble, "ConnectionDelegate StopScan"); + DoCancel(); } CHIP_ERROR BleConnectionDelegateImpl::CancelConnection() { - assertChipStackLockedByCurrentThread(); + ChipLogProgress(Ble, "ConnectionDelegate CancelConnection"); + return DoCancel(); + } - ChipLogProgress(Ble, "%s", __FUNCTION__); + CHIP_ERROR BleConnectionDelegateImpl::DoCancel() + { + assertChipStackLockedByCurrentThread(); if (bleWorkQueue == nil) { return CHIP_NO_ERROR; } @@ -284,6 +289,7 @@ - (void)setupTimer:(uint64_t)timeout _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, _workQueue); dispatch_source_set_event_handler(_timer, ^{ + ChipLogProgress(Ble, "ConnectionDelegate timeout"); [self stop]; [self dispatchConnectionError:BLE_ERROR_APP_CLOSED_CONNECTION]; }); @@ -374,7 +380,7 @@ - (void)centralManager:(CBCentralManager *)central } const uint8_t * bytes = (const uint8_t *) [serviceData bytes]; - if ([serviceData length] != 8) { + if ([serviceData length] != sizeof(ChipBLEDeviceIdentificationInfo)) { NSMutableString * hexString = [NSMutableString stringWithCapacity:([serviceData length] * 2)]; for (NSUInteger i = 0; i < [serviceData length]; i++) { [hexString appendString:[NSString stringWithFormat:@"%02lx", (unsigned long) bytes[i]]]; @@ -521,10 +527,11 @@ - (void)peripheral:(CBPeripheral *)peripheral chip::Ble::ChipBleUUID svcId; chip::Ble::ChipBleUUID charId; [BleConnection fillServiceWithCharacteristicUuids:characteristic svcId:&svcId charId:&charId]; + auto * value = characteristic.value; // read immediately before dispatching dispatch_async(_chipWorkQueue, ^{ // build a inet buffer from the rxEv and send to blelayer. - auto msgBuf = chip::System::PacketBufferHandle::NewWithData(characteristic.value.bytes, characteristic.value.length); + auto msgBuf = chip::System::PacketBufferHandle::NewWithData(value.bytes, value.length); if (msgBuf.IsNull()) { ChipLogError(Ble, "Failed at allocating buffer for incoming BLE data"); @@ -583,7 +590,9 @@ - (void)stop _centralManager.delegate = nil; _centralManager = nil; _peripheral = nil; - chip::DeviceLayer::Internal::ble = nil; + if (chip::DeviceLayer::Internal::ble == self) { + chip::DeviceLayer::Internal::ble = nil; + } }); }); } From a94fec9be86602d96fcd156ab145f2f6c4ab0790 Mon Sep 17 00:00:00 2001 From: abiradarti <104591549+abiradarti@users.noreply.github.com> Date: Tue, 12 Sep 2023 18:36:04 -0500 Subject: [PATCH 073/134] [TI] CC2674 migration support (#28975) * cc2674 migration support * spelling fixes * Restyled by gn * renamed migration file and added to toc * more restyling * more restyling pt2 * more restyling pt3 * more restyling pt4 * more restyling pt5 * more restyling pt6 * Restyled by prettier-markdown * Restyled by prettier-markdown * added toc * Restyled by prettier-markdown * Restyled by prettier-markdown * fixed path to ti overview img * more path changes for ti md files * Restyled by prettier-markdown * Restyled by prettier-markdown * Fix restyled issue. * build and publish fix --------- Co-authored-by: Restyled.io Co-authored-by: Boris Zbarsky --- .github/.wordlist.txt | 1 + docs/guides/README.md | 2 +- docs/guides/darwin.md | 2 +- docs/guides/index.md | 3 +- docs/guides/ti/matter_cc2674_migration.md | 109 ++++++++++++++++++ docs/guides/{ => ti}/ti_platform_overview.md | 24 +++- .../cc13xx_26xx/cc13x4_26x4/ble_user_config.c | 2 +- .../ti_simplelink_sdk/ti_simplelink_board.gni | 26 +++-- .../ti_simplelink_sdk/ti_simplelink_sdk.gni | 85 ++++++++++---- 9 files changed, 216 insertions(+), 38 deletions(-) create mode 100644 docs/guides/ti/matter_cc2674_migration.md rename docs/guides/{ => ti}/ti_platform_overview.md (88%) diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index f5dc5a1ac9c7cb..1e24bdb65838d1 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1430,6 +1430,7 @@ UnitLocalization unpair unprovisioned Unsecure +Unselect untrusted updateAvailable updateNotAvailable diff --git a/docs/guides/README.md b/docs/guides/README.md index da96c5a8eb7b20..a643a0e846d7cb 100644 --- a/docs/guides/README.md +++ b/docs/guides/README.md @@ -23,7 +23,7 @@ - [Silicon Labs - Building](./silabs_efr32_building.md) - [Silicon Labs - Software Update](./silabs_efr32_software_update.md) - [STMicroelectronics (STM32)](./stm32_getting_started_guide.md) -- [TI - Platform Overview](./ti_platform_overview.md) +- [TI - Platform Overview](./ti/ti_platform_overview.md) - [Open IoT SDK - Platform Overview](./openiotsdk_platform_overview.md) - [Open IoT SDK - Examples](./openiotsdk_examples.md) - [Open IoT SDK - Unit Tests](./openiotsdk_unit_tests.md) diff --git a/docs/guides/darwin.md b/docs/guides/darwin.md index 197023c3c99580..74ed819c9f875f 100644 --- a/docs/guides/darwin.md +++ b/docs/guides/darwin.md @@ -267,7 +267,7 @@ Example: - [SiliconLabs](./silabs_efr32_building.md) - [Simulated Linux](./simulated_device_linux.md) - [Telink](/examples/lighting-app/telink/README.md) -- [TI Platform](./ti_platform_overview.md) +- [TI Platform](./ti/ti_platform_overview.md) - [TI All Clusters](/examples/all-clusters-app/cc13x4_26x4/README.md) - [Tizen](/examples/lighting-app/tizen/README.md) diff --git a/docs/guides/index.md b/docs/guides/index.md index 275ead9feaabd3..a818ee2b777912 100644 --- a/docs/guides/index.md +++ b/docs/guides/index.md @@ -10,6 +10,7 @@ and features. * esp32/README +ti/ti_platform_overview ``` ## Build Guides @@ -39,7 +40,7 @@ esp32/README - [Silicon Labs - Documentation](https://github.com/SiliconLabs/matter#readme) - [Silicon Labs - Building](./silabs_efr32_building.md) - [Silicon Labs - Software Update](./silabs_efr32_software_update.md) -- [TI - Platform Overview](./ti_platform_overview.md) +- [TI - Platform Overview](./ti/ti_platform_overview.md) ## Tool Guides diff --git a/docs/guides/ti/matter_cc2674_migration.md b/docs/guides/ti/matter_cc2674_migration.md new file mode 100644 index 00000000000000..0590037ea03157 --- /dev/null +++ b/docs/guides/ti/matter_cc2674_migration.md @@ -0,0 +1,109 @@ +# Running Matter Examples on the TI SimpleLink CC2674P10 and CC2674R10 + +The existing Matter project examples are based on LP_EM_CC1354P10_6. If using +the CC2674P10, the following migration steps are required. Developers are +strongly encouraged to start with a `cc13x4_26x4` example and migrate the +project accordingly. Example projects can be found in the following location: +`matter/examples/[application]/cc13x4_26x4` + +## Dependencies + +The following must be installed on your system before proceeding: + +- [SysConfig](https://www.ti.com/tool/SYSCONFIG) v1.16.2 or later +- [SIMPLELINK-LOWPOWER-F2-SDK](https://www.ti.com/tool/SIMPLELINK-LOWPOWER-SDK) + v7.10.01.24 + +## Matter source code changes + +The following are changes to the Matter source code files which should be +applied to convert a `matter/examples/[application]/cc13x4_26x4` project to the +CC2674P10 device + +- `examples/[application]/cc13x4_26x4/args.gni`, modify/add the following + defines for the CC2674 + - `ti_simplelink_board = CC2674` + - `ti_simplelink_device = CC2674P10RGZ` +- `third_party/ti_simplelink_sdk/repo_cc13xx_cc26xx`, replace this folder + contents with the 7.10.01.24 version from + [TI's downloads page](https://www.ti.com/tool/download/SIMPLELINK-LOWPOWER-F2-SDK/7.10.01.24) + which is required to add support SDK for the CC2674P10 device. + +## Configuring `chip.syscfg` in the SysConfig GUI + +1. To open `matter/examples/[application]/cc13x4_26x4/chip.syscfg` in the GUI, + add the following line to the top of the file: + +``` + // @cliArgs --product /.metadata/product.json --board /ti/boards/LP_EM_CC1354P10_6 --rtos freertos +``` + +2. Open the `syscfg` file using the standalone Sysconfig GUI + (`sysconfig_gui.sh`) from the SysConfig installation folder. +3. Click on _Show Device View_ and then click _Switch_. +4. Select _Board_ as _None_ and _Device_ as _`CC2674P10RGZ`_, Unselect + _`Lock PinMux`_, and click _Confirm_. +5. To fix errors, make the following module changes: + - _RF Design_ and _RF Stacks -> BLE -> Radio_: click on _accepting the + current value_, which should be _`LP_CC2674P10_RGZ`_ in the drop down menu + for _Based On RF Design_ + - _TI DEVICES -> Device Configuration_: Clear + _`XOSC Cap Array Modification`_ + - _TI DRIVERS -> RF_: Set _Global Event Mask_ as _None_ and _No. of Antenna + Switch Control Pins_ as _0_ + - _TI DRIVERS -> UART2 -> `PinMux`_: Set _UART Peripheral_ to _UART0_, _TX + Pin_ to _`DIO_13/19`_, and _RX Pin_ to _`DIO_12/18`_ + - _TI DRIVERS APPS -> Button_: Set _`PinMux`_ of _CONFIG_BTN_LEFT_ to + _`DIO_15`_ and _CONFIG_BTN_RIGHT_ to _`DIO_14`_ + - _TI DRIVERS APPS -> LED_: Set _`PinMux`_ of _CONFIG_LED_RED_ to _`DIO_6`_ + and _CONFIG_LED_RIGHT_ to _`DIO_7`_ +6. Save the SysConfig file (click on _Save As_) and ensure the file name matches + the reference from `BUILD.gn` (default project name is `chip.syscfg`). +7. Open the new SysConfig file with a text editor and remove the generated + arguments. + ``` + /** + * These arguments were used when this file was generated. They will be automatically applied on subsequent loads + * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. + * @cliArgs --device "CC2674P10RGZ" --package "RGZ" --part "Default" --rtos "freertos" --product "simplelink_cc13xx_cc26xx_sdk@7.10.01.24" + * @versions {"tool":"1.18.0+3130"} + */ + ``` +8. Move the `*.syscfg` file into the + `matter/examples/[application]/cc13x4_26x4/` folder. Make sure that the + `args.gni` parameters are aligned for the `CC2674P10RGZ` as detailed above, + and build the example using the `README.md` instructions. + +## Modifications required for the CC2674R10 + +After applying all items in the "Configuring `chip.syscfg` in the SysConfig GUI" +section, additional steps must also be applied to generate Matter project for +the CC2674R10. + +- `examples/[application]/cc13x4_26x4/args.gni` should have + `ti_simplelink_board` as `CC2674` and `ti_simplelink_device = CC2674R10RGZ`. +- `examples/[application]/cc13x4_26x4/chip.syscfg` opened with a Text Editor + should change `ble.radioConfig.codeExportConfig.$name` to + `ti_devices_radioconfig_code_export_param2` and `ble.rfDesign` to + `LP_EM_CC1354P10_1` + +Furthermore, the subsequent changes apply specifically for the CC2674R10 and +should be addressed from a SysConfig Editor. + +1. Pins will need to be reconfigured as such: + + | SysConfig pin name | R10 `PinMux` | + | ------------------ | ------------ | + | UART_RX | `DIO_2` | + | UART_TX | `DIO_3` | + | CONFIG_BTN_LEFT | `DIO_13` | + | CONFIG_BTN_RIGHT | `DIO_14` | + | CONFIG_LED_RED | `DIO_6` | + | CONFIG_LED_GREEN | `DIO_7` | + +2. _Custom -> IEEE 802.15.4-2006, `250 kbps`, `OQPSK`, `DSSS = 1:8` -> Code + Export Configuration_, acknowledge and dismiss the PA radio setup error +3. _Custom -> IEEE 802.15.4-2006, `250 kbps`, `OQPSK`, `DSSS = 1:8` -> RF + Command Symbols_, change `CMD_RADIO_SETUP` from `RF_cmdRadioSetup` to + `RF_cmdIeeeRadioSetup` and add the following functions from the drop-down: + `CMD_TX_TEST`,`CMD_IEEE_ED_SCAN`, `CMD_IEEE_CSMA`, and `CMD_IEEE_RX_ACK`. diff --git a/docs/guides/ti_platform_overview.md b/docs/guides/ti/ti_platform_overview.md similarity index 88% rename from docs/guides/ti_platform_overview.md rename to docs/guides/ti/ti_platform_overview.md index cc0a05280cbc22..47e140cfa06ba0 100644 --- a/docs/guides/ti_platform_overview.md +++ b/docs/guides/ti/ti_platform_overview.md @@ -1,3 +1,10 @@ +```{toctree} +:glob: +:maxdepth: 1 + +* +``` + # Texas Instruments platform overview The TI platform is a [Matter][matter_gh] platform based on the Texas Instruments @@ -6,7 +13,7 @@ Incorporated SimpleLink SDK. The following diagram is a simplified representation of a Matter application which built on the TI Platform. -![matter_ti_overview_simplified](images/matter_ti_overview_simplified.png) +![matter_ti_overview_simplified](./../images/matter_ti_overview_simplified.png) ## Texas Instruments SimpleLink SDK @@ -96,9 +103,9 @@ handled by the platform implementation files. Sample Matter applications are provided for the TI platform. These can be used as reference for your own application. -- [lock-app](../../examples/lock-app/cc13x2x7_26x2x7/README.md) -- [pump-app](../../examples/pump-app/cc13x2x7_26x2x7/README.md) -- [pump-controller-app](../../examples/pump-controller-app/cc13x2x7_26x2x7/README.md) +- [lock-app](../../../examples/lock-app/cc13x2x7_26x2x7/README.md) +- [pump-app](../../../examples/pump-app/cc13x2x7_26x2x7/README.md) +- [pump-controller-app](../../../examples/pump-controller-app/cc13x2x7_26x2x7/README.md)
@@ -110,6 +117,15 @@ SimpleLink SDK.
+## CC2674 Migration + +For instructions on how to migrate the CC1354P10-6 examples to either the +CC2674P10 or the CC2674R10, please refer to the guide linked below. + +- [TI CC2674 Migration Guide](./matter_cc2674_migration.md) + +
+ ### TI Support For technical support, please consider creating a post on TI's [E2E forum][e2e]. diff --git a/src/platform/cc13xx_26xx/cc13x4_26x4/ble_user_config.c b/src/platform/cc13xx_26xx/cc13x4_26x4/ble_user_config.c index 7f51e3226e565a..d5579bff75cb66 100644 --- a/src/platform/cc13xx_26xx/cc13x4_26x4/ble_user_config.c +++ b/src/platform/cc13xx_26xx/cc13x4_26x4/ble_user_config.c @@ -68,7 +68,7 @@ #ifndef CC23X0 #if !defined(DeviceFamily_CC26X1) #include -#if !defined(DeviceFamily_CC13X4) +#if !defined(DeviceFamily_CC13X4) && !defined(DeviceFamily_CC26X4) #include #endif #else diff --git a/third_party/ti_simplelink_sdk/ti_simplelink_board.gni b/third_party/ti_simplelink_sdk/ti_simplelink_board.gni index a89d2aebc28898..c14d0e1c942142 100644 --- a/third_party/ti_simplelink_sdk/ti_simplelink_board.gni +++ b/third_party/ti_simplelink_sdk/ti_simplelink_board.gni @@ -15,6 +15,7 @@ declare_args() { # TI SimpleLink board used ti_simplelink_board = "" + ti_simplelink_device = "" } if (ti_simplelink_board == "") { @@ -25,14 +26,16 @@ assert(ti_simplelink_board != "", "ti_simplelink_board must be specified") # Differentiate between boards # -# | Development Kit | Device Family | SoC | | -# | ----------------- | --------------- | ---------- | ------------------- | -# | CC1352R1_LAUNCHXL | cc13x2_26x2 | cc1352r1f3 | Thread MTD + no BLE | -# | CC2652R1_LAUNCHXL | cc13x2_26x2 | cc2652r1f3 | Thread MTD + no BLE | -# | LP_CC2652R7 | cc13x2x7_26x2x7 | cc2652r1f7 | Thread FTD + BLE | -# | CC134P10_6_LAUNCHXL| cc13x4_26x4 | cc1354p10 | Thread FTD + BLE | -# | CC3220SF_LAUNCHXL | cc32xx | cc3220SF | Wi-Fi | -# | CC3235SF_LAUNCHXL | cc32xx | cc3235SF | Wi-Fi | +# | Development Kit | Device Family | SoC | | +# | ----------------- | --------------- | ---------- | ------------------- | +# | CC1352R1_LAUNCHXL | cc13x2_26x2 | cc1352r1f3 | Thread MTD + no BLE | +# | CC2652R1_LAUNCHXL | cc13x2_26x2 | cc2652r1f3 | Thread MTD + no BLE | +# | LP_CC2652R7 | cc13x2x7_26x2x7 | cc2652r1f7 | Thread FTD + BLE | +# | CC134P10_6_LAUNCHXL | cc13x4_26x4 | cc1354p10 | Thread FTD + BLE | +# | CC2674 | cc13x4_24x4 | CC2674P10RGZ | Thread FTD + BLE | +# | CC2674 | cc13x4_24x4 | CC2674R10RGZ | Thread FTD + BLE | +# | CC3220SF_LAUNCHXL | cc32xx | cc3220SF | Wi-Fi | +# | CC3235SF_LAUNCHXL | cc32xx | cc3235SF | Wi-Fi | # XXX: Can we do an array with a case statement? if (ti_simplelink_board == "CC1352R1_LAUNCHXL") { @@ -51,12 +54,17 @@ if (ti_simplelink_board == "CC1352R1_LAUNCHXL") { # set -DDeviceFamily_CC26X2? ti_simplelink_soc = "cc2652r1f3" ti_simplelink_bim_name = "cc2652r1lp" -} else if (ti_simplelink_board == "LP_EM_CC1354P10_6") { +} else if (ti_simplelink_board == "LP_EM_CC1354P10_6" || + ti_simplelink_board == "LP_EM_CC1354P10_1") { ti_simplelink_device_family = "cc13x4_26x4" ti_simplelink_soc_family = "cc13x4" ti_simplelink_isa = "m33f" ti_simplelink_soc = "cc1354p10" ti_simplelink_bim_name = "cc1354p10" +} else if (ti_simplelink_board == "CC2674") { + ti_simplelink_device_family = "cc13x4_26x4" #driverlib paths + ti_simplelink_soc_family = "cc13x4" #ble path + ti_simplelink_isa = "m33f" } else if (ti_simplelink_board == "LP_CC2652R7") { ti_simplelink_device_family = "cc13x2x7_26x2x7" ti_simplelink_soc_family = "cc26x2" diff --git a/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni b/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni index 590d4884b867f5..ee16f5179e5859 100644 --- a/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni +++ b/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni @@ -90,7 +90,11 @@ template("ti_sysconfig") { "-fno-exceptions", "-fno-unwind-tables", ] - defines += [ "DeviceFamily_CC13X4" ] + if (ti_simplelink_device == "") { + defines += [ "DeviceFamily_CC13X4" ] + } else { + defines += [ "DeviceFamily_CC26X4" ] + } } else if (ti_simplelink_device_family == "cc32xx") { ldflags += [ "-nostartfiles" ] defines += [ "CC32XXWARE" ] @@ -108,20 +112,37 @@ template("ti_sysconfig") { sources = invoker.sources outputs = gen_outputs - args = [ - ti_sysconfig_root, - "-s", - rebase_path(ti_simplelink_sdk_root + "/.metadata/product.json", - root_build_dir), - "-o", - rebase_path(output_dir, root_build_dir), - "--compiler", - "gcc", - "--board", - "/ti/boards/" + ti_simplelink_board, - "--rtos", - "freertos", - ] + if (ti_simplelink_device == "") { + args = [ + ti_sysconfig_root, + "-s", + rebase_path(ti_simplelink_sdk_root + "/.metadata/product.json", + root_build_dir), + "-o", + rebase_path(output_dir, root_build_dir), + "--compiler", + "gcc", + "--board", + "/ti/boards/" + ti_simplelink_board, + "--rtos", + "freertos", + ] + } else { + args = [ + ti_sysconfig_root, + "-s", + rebase_path(ti_simplelink_sdk_root + "/.metadata/product.json", + root_build_dir), + "-o", + rebase_path(output_dir, root_build_dir), + "--compiler", + "gcc", + "--device", + ti_simplelink_device, + "--rtos", + "freertos", + ] + } foreach(source, sources) { args += [ rebase_path(source, root_build_dir) ] @@ -205,7 +226,17 @@ template("ti_simplelink_sdk") { defines += [ "DeviceFamily_CC13X2X7_CC26X2X7" ] libs += [ "${ti_simplelink_sdk_root}/source/ti/devices/cc13x2x7_cc26x2x7/driverlib/bin/gcc/driverlib.lib" ] } else if (ti_simplelink_device_family == "cc13x4_26x4") { - defines += [ "DeviceFamily_CC13X4" ] + if (ti_simplelink_device == "") { + defines += [ "DeviceFamily_CC13X4" ] + } else { + defines += [ "DeviceFamily_CC26X4" ] + } + if (ti_simplelink_board == "LP_EM_CC1354P10_1" || + (ti_simplelink_board == "CC2674" && + ti_simplelink_device == "CC2674R10RGZ")) { + defines += [ "EM_CC1354P10_1_LP" ] + } + defines += [ "FLASH_ONLY_BUILD" ] libs += [ "${ti_simplelink_sdk_root}/source/ti/devices/cc13x4_cc26x4/driverlib/bin/gcc/driverlib.lib" ] } @@ -439,11 +470,23 @@ template("ti_simplelink_sdk") { "${ti_simplelink_sdk_root}/source/ti/ble5stack/common/cc26xx/freertos/", ] } else if (ti_simplelink_device_family == "cc13x4_26x4") { - libs += [ - "${ti_simplelink_sdk_root}/source/ti/dmm/lib/gcc/m4f/libdmmlib_freertos.a", - "${ti_simplelink_sdk_root}/source/ti/ble5stack_flash/libraries/cc1354p10_6/OneLib.a", - "${ti_simplelink_sdk_root}/source/ti/ble5stack_flash/libraries/cc1354p10_6/StackWrapper.a", - ] + libs += [ "${ti_simplelink_sdk_root}/source/ti/dmm/lib/gcc/m4f/libdmmlib_freertos.a" ] + if (ti_simplelink_board == "LP_EM_CC1354P10_1" || + (ti_simplelink_board == "CC2674" && + ti_simplelink_device == "CC2674R10RGZ")) { + libs += [ + "${ti_simplelink_sdk_root}/source/ti/ble5stack_flash/libraries/cc1354p10_1/OneLib.a", + "${ti_simplelink_sdk_root}/source/ti/ble5stack_flash/libraries/cc1354p10_1/StackWrapper.a", + ] + } else if (ti_simplelink_board == "LP_EM_CC1354P10_6" || + (ti_simplelink_board == "CC2674" && + ti_simplelink_device == "CC2674P10RGZ")) { + libs += [ + "${ti_simplelink_sdk_root}/source/ti/ble5stack_flash/libraries/cc1354p10_6/OneLib.a", + "${ti_simplelink_sdk_root}/source/ti/ble5stack_flash/libraries/cc1354p10_6/StackWrapper.a", + ] + } + defines += [ "ONE_BLE_LIB_SIZE_OPTIMIZATION", "NVOCMP_NVPAGES=3", From d453502d371bfada52293fff022406f15f03490c Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:52:19 +1200 Subject: [PATCH 074/134] Darwin: set is_debug=false for Release builds (#29176) --- src/darwin/Framework/chip_xcode_build_connector.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index 2127313659614c..120496c146e2c0 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -107,7 +107,10 @@ declare -a args=( "mac_deployment_target=\"$LLVM_TARGET_TRIPLE_OS_VERSION$LLVM_TARGET_TRIPLE_SUFFIX\"" ) -[[ $CONFIGURATION == Debug ]] && args+=('is_debug=true') +case "$CONFIGURATION" in + Debug) args+=('is_debug=true') ;; + Release) args+=('is_debug=false') ;; +esac [[ $PLATFORM_FAMILY_NAME != macOS ]] && { args+=( From 6c09e34729a47294e97178e9b2c126d832c2fe52 Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Tue, 12 Sep 2023 22:26:37 -0700 Subject: [PATCH 075/134] Fix the local reference leaks for attribute and event path (#29175) --- src/controller/java/AndroidCallbacks.cpp | 165 +++++++++++++---------- 1 file changed, 93 insertions(+), 72 deletions(-) diff --git a/src/controller/java/AndroidCallbacks.cpp b/src/controller/java/AndroidCallbacks.cpp index 4c3e05051a9d4e..f81b8c2fc5575a 100644 --- a/src/controller/java/AndroidCallbacks.cpp +++ b/src/controller/java/AndroidCallbacks.cpp @@ -42,6 +42,67 @@ static const int MILLIS_SINCE_EPOCH = 1; // Add the bytes for attribute tag(1:control + 8:tag + 8:length) and structure(1:struct + 1:close container) static const int EXTRA_SPACE_FOR_ATTRIBUTE_TAG = 19; +class JniChipAttributePath +{ +public: + JniChipAttributePath(JNIEnv * env, const app::ConcreteDataAttributePath & aPath) : mEnv(env) + { + jclass attributePathCls = nullptr; + ReturnOnFailure(mError = JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/model/ChipAttributePath", + attributePathCls)); + JniClass attributePathJniCls(attributePathCls); + + jmethodID attributePathCtor = + env->GetStaticMethodID(attributePathCls, "newInstance", "(IJJ)Lchip/devicecontroller/model/ChipAttributePath;"); + VerifyOrReturn(attributePathCtor != nullptr, mError = CHIP_JNI_ERROR_METHOD_NOT_FOUND); + mData = env->CallStaticObjectMethod(attributePathCls, attributePathCtor, static_cast(aPath.mEndpointId), + static_cast(aPath.mClusterId), static_cast(aPath.mAttributeId)); + VerifyOrReturn(mData != nullptr, mError = CHIP_JNI_ERROR_NULL_OBJECT); + return; + } + + ~JniChipAttributePath() { mEnv->DeleteLocalRef(mData); } + + CHIP_ERROR GetError() { return mError; } + jobject GetData() { return mData; } + +private: + JNIEnv * mEnv = nullptr; + jobject mData = nullptr; + CHIP_ERROR mError = CHIP_NO_ERROR; +}; + +class JniChipEventPath +{ +public: + JniChipEventPath(JNIEnv * env, const app::ConcreteEventPath & aPath) : mEnv(env) + { + jclass eventPathCls = nullptr; + ReturnOnFailure( + mError = JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/model/ChipEventPath", eventPathCls)); + JniClass eventPathJniCls(eventPathCls); + + jmethodID eventPathCtor = + env->GetStaticMethodID(eventPathCls, "newInstance", "(IJJ)Lchip/devicecontroller/model/ChipEventPath;"); + VerifyOrReturn(eventPathCtor != nullptr, mError = CHIP_JNI_ERROR_METHOD_NOT_FOUND); + + mData = env->CallStaticObjectMethod(eventPathCls, eventPathCtor, static_cast(aPath.mEndpointId), + static_cast(aPath.mClusterId), static_cast(aPath.mEventId)); + VerifyOrReturn(mData != nullptr, mError = CHIP_JNI_ERROR_NULL_OBJECT); + return; + } + + ~JniChipEventPath() { mEnv->DeleteLocalRef(mData); } + + CHIP_ERROR GetError() { return mError; } + jobject GetData() { return mData; } + +private: + JNIEnv * mEnv = nullptr; + jobject mData = nullptr; + CHIP_ERROR mError = CHIP_NO_ERROR; +}; + GetConnectedDeviceCallback::GetConnectedDeviceCallback(jobject wrapperCallback, jobject javaCallback) : mOnSuccess(OnDeviceConnectedFn, this), mOnFailure(OnDeviceConnectionFailureFn, this) { @@ -254,27 +315,27 @@ CHIP_ERROR ConvertReportTlvToJson(const uint32_t id, TLV::TLVReader & data, std: void ReportCallback::OnAttributeData(const app::ConcreteDataAttributePath & aPath, TLV::TLVReader * apData, const app::StatusIB & aStatus) { - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject attributePathObj = nullptr; - err = CreateChipAttributePath(aPath, attributePathObj); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Unable to create Java ChipAttributePath: %s", ErrorStr(err))); + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + JniChipAttributePath attributePathObj(env, aPath); + VerifyOrReturn(attributePathObj.GetError() == CHIP_NO_ERROR, + ChipLogError(Controller, "Unable to create Java ChipAttributePath: %s", ErrorStr(err))); if (aPath.IsListItemOperation()) { - ReportError(attributePathObj, nullptr, CHIP_ERROR_INCORRECT_STATE); + ReportError(attributePathObj.GetData(), nullptr, CHIP_ERROR_INCORRECT_STATE); return; } if (aStatus.mStatus != Protocols::InteractionModel::Status::Success) { - ReportError(attributePathObj, nullptr, aStatus.mStatus); + ReportError(attributePathObj.GetData(), nullptr, aStatus.mStatus); return; } if (apData == nullptr) { - ReportError(attributePathObj, nullptr, CHIP_ERROR_INVALID_ARGUMENT); + ReportError(attributePathObj.GetData(), nullptr, CHIP_ERROR_INVALID_ARGUMENT); return; } @@ -293,9 +354,9 @@ void ReportCallback::OnAttributeData(const app::ConcreteDataAttributePath & aPat err = CHIP_NO_ERROR; } - VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(attributePathObj, nullptr, err)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(attributePathObj.GetData(), nullptr, err)); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe(), - ReportError(attributePathObj, nullptr, CHIP_JNI_ERROR_EXCEPTION_THROWN)); + ReportError(attributePathObj.GetData(), nullptr, CHIP_JNI_ERROR_EXCEPTION_THROWN)); #endif // Create TLV byte array to pass to Java layer size_t bufferLen = readerForJavaTLV.GetRemainingLength() + readerForJavaTLV.GetLengthRead(); @@ -308,14 +369,14 @@ void ReportCallback::OnAttributeData(const app::ConcreteDataAttributePath & aPat TLV::TLVWriter writer; writer.Init(buffer.get(), bufferLen); err = writer.CopyElement(TLV::AnonymousTag(), readerForJavaTLV); - VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(attributePathObj, nullptr, err)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(attributePathObj.GetData(), nullptr, err)); size = writer.GetLengthWritten(); chip::ByteArray jniByteArray(env, reinterpret_cast(buffer.get()), size); // Convert TLV to JSON std::string json; err = ConvertReportTlvToJson(static_cast(aPath.mAttributeId), *apData, json); - VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(attributePathObj, nullptr, err)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(attributePathObj.GetData(), nullptr, err)); UtfString jsonString(env, json.c_str()); // Create AttributeState object @@ -338,6 +399,7 @@ void ReportCallback::OnAttributeData(const app::ConcreteDataAttributePath & aPat env->CallVoidMethod(mNodeStateObj, addAttributeMethod, static_cast(aPath.mEndpointId), static_cast(aPath.mClusterId), static_cast(aPath.mAttributeId), attributeStateObj); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe()); + env->DeleteLocalRef(attributeStateObj); UpdateClusterDataVersion(); } @@ -378,15 +440,15 @@ void ReportCallback::UpdateClusterDataVersion() void ReportCallback::OnEventData(const app::EventHeader & aEventHeader, TLV::TLVReader * apData, const app::StatusIB * apStatus) { - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject eventPathObj = nullptr; - err = CreateChipEventPath(aEventHeader.mPath, eventPathObj); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Unable to create Java ChipEventPath: %s", ErrorStr(err))); + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + JniChipEventPath eventPathObj(env, aEventHeader.mPath); + VerifyOrReturn(eventPathObj.GetError() == CHIP_NO_ERROR, + ChipLogError(Controller, "Unable to create Java ChipEventPath: %s", ErrorStr(err))); if (apData == nullptr) { - ReportError(nullptr, eventPathObj, CHIP_ERROR_INVALID_ARGUMENT); + ReportError(nullptr, eventPathObj.GetData(), CHIP_ERROR_INVALID_ARGUMENT); return; } @@ -409,7 +471,7 @@ void ReportCallback::OnEventData(const app::EventHeader & aEventHeader, TLV::TLV else { ChipLogError(Controller, "Unsupported event timestamp type"); - ReportError(nullptr, eventPathObj, CHIP_ERROR_INVALID_ARGUMENT); + ReportError(nullptr, eventPathObj.GetData(), CHIP_ERROR_INVALID_ARGUMENT); return; } @@ -423,9 +485,9 @@ void ReportCallback::OnEventData(const app::EventHeader & aEventHeader, TLV::TLV { err = CHIP_NO_ERROR; } - VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(nullptr, eventPathObj, err)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(nullptr, eventPathObj.GetData(), err)); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe(), - ReportError(nullptr, eventPathObj, CHIP_JNI_ERROR_EXCEPTION_THROWN)); + ReportError(nullptr, eventPathObj.GetData(), CHIP_JNI_ERROR_EXCEPTION_THROWN)); #endif // Create TLV byte array to pass to Java layer @@ -438,14 +500,14 @@ void ReportCallback::OnEventData(const app::EventHeader & aEventHeader, TLV::TLV TLV::TLVWriter writer; writer.Init(buffer.get(), bufferLen); err = writer.CopyElement(TLV::AnonymousTag(), readerForJavaTLV); - VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(nullptr, eventPathObj, err)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(nullptr, eventPathObj.GetData(), err)); size = writer.GetLengthWritten(); chip::ByteArray jniByteArray(env, reinterpret_cast(buffer.get()), size); // Convert TLV to JSON std::string json; err = ConvertReportTlvToJson(static_cast(aEventHeader.mPath.mEventId), *apData, json); - VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(eventPathObj, nullptr, err)); + VerifyOrReturn(err == CHIP_NO_ERROR, ReportError(eventPathObj.GetData(), nullptr, err)); UtfString jsonString(env, json.c_str()); // Create EventState object @@ -469,27 +531,7 @@ void ReportCallback::OnEventData(const app::EventHeader & aEventHeader, TLV::TLV static_cast(aEventHeader.mPath.mClusterId), static_cast(aEventHeader.mPath.mEventId), eventStateObj); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe()); -} - -CHIP_ERROR CreateChipAttributePath(const app::ConcreteDataAttributePath & aPath, jobject & outObj) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - CHIP_ERROR err = CHIP_NO_ERROR; - - jclass attributePathCls = nullptr; - err = JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/model/ChipAttributePath", attributePathCls); - VerifyOrReturnError(err == CHIP_NO_ERROR, err); - JniClass attributePathJniCls(attributePathCls); - - jmethodID attributePathCtor = - env->GetStaticMethodID(attributePathCls, "newInstance", "(IJJ)Lchip/devicecontroller/model/ChipAttributePath;"); - VerifyOrReturnError(attributePathCtor != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - - outObj = env->CallStaticObjectMethod(attributePathCls, attributePathCtor, static_cast(aPath.mEndpointId), - static_cast(aPath.mClusterId), static_cast(aPath.mAttributeId)); - VerifyOrReturnError(outObj != nullptr, CHIP_JNI_ERROR_NULL_OBJECT); - - return err; + env->DeleteLocalRef(eventStateObj); } CHIP_ERROR InvokeCallback::CreateInvokeElement(const app::ConcreteCommandPath & aPath, TLV::TLVReader * apData, jobject & outObj) @@ -549,27 +591,6 @@ CHIP_ERROR InvokeCallback::CreateInvokeElement(const app::ConcreteCommandPath & return err; } -CHIP_ERROR ReportCallback::CreateChipEventPath(const app::ConcreteEventPath & aPath, jobject & outObj) -{ - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - CHIP_ERROR err = CHIP_NO_ERROR; - - jclass eventPathCls = nullptr; - err = JniReferences::GetInstance().GetClassRef(env, "chip/devicecontroller/model/ChipEventPath", eventPathCls); - VerifyOrReturnError(err == CHIP_NO_ERROR, err); - JniClass eventPathJniCls(eventPathCls); - - jmethodID eventPathCtor = - env->GetStaticMethodID(eventPathCls, "newInstance", "(IJJ)Lchip/devicecontroller/model/ChipEventPath;"); - VerifyOrReturnError(eventPathCtor != nullptr, CHIP_JNI_ERROR_METHOD_NOT_FOUND); - - outObj = env->CallStaticObjectMethod(eventPathCls, eventPathCtor, static_cast(aPath.mEndpointId), - static_cast(aPath.mClusterId), static_cast(aPath.mEventId)); - VerifyOrReturnError(outObj != nullptr, CHIP_JNI_ERROR_NULL_OBJECT); - - return err; -} - void ReportCallback::OnError(CHIP_ERROR aError) { ReportError(nullptr, nullptr, aError); @@ -690,15 +711,15 @@ WriteAttributesCallback::~WriteAttributesCallback() void WriteAttributesCallback::OnResponse(const app::WriteClient * apWriteClient, const app::ConcreteDataAttributePath & aPath, app::StatusIB aStatus) { - CHIP_ERROR err = CHIP_NO_ERROR; - JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); - jobject attributePathObj = nullptr; - err = CreateChipAttributePath(aPath, attributePathObj); - VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Unable to create Java ChipAttributePath: %s", ErrorStr(err))); + CHIP_ERROR err = CHIP_NO_ERROR; + JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread(); + JniChipAttributePath attributePathObj(env, aPath); + VerifyOrReturn(attributePathObj.GetError() == CHIP_NO_ERROR, + ChipLogError(Controller, "Unable to create Java ChipAttributePath: %s", ErrorStr(err))); if (aStatus.mStatus != Protocols::InteractionModel::Status::Success) { - ReportError(attributePathObj, aStatus.mStatus); + ReportError(attributePathObj.GetData(), aStatus.mStatus); return; } @@ -708,7 +729,7 @@ void WriteAttributesCallback::OnResponse(const app::WriteClient * apWriteClient, VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Controller, "Unable to find onError method: %s", ErrorStr(err))); DeviceLayer::StackUnlock unlock; - env->CallVoidMethod(mJavaCallbackRef, onResponseMethod, attributePathObj); + env->CallVoidMethod(mJavaCallbackRef, onResponseMethod, attributePathObj.GetData()); VerifyOrReturn(!env->ExceptionCheck(), env->ExceptionDescribe()); } From 97fb6664d9f31347fa3cff9888070a2a025162fc Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk <66371704+kkasperczyk-no@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:33:41 +0200 Subject: [PATCH 076/134] [zephyr] Added platform configuration to enable ICD support (#29128) Changed Zephyr and nrfconnect platforms configuration to move from supporting SED to ICD: * Removed custom subscriptions handling. * Renamed SED kconfig option names and descriptions to match the ICD related ones. * Introduced new kconfig options allowing to configure idle mode interval, active mode interval, active mode threshold and number of clients per fabric. --- config/nrfconnect/chip-module/CMakeLists.txt | 1 + .../nrfconnect/chip-module/Kconfig.features | 23 ------- config/zephyr/Kconfig | 65 ++++++++++++++----- .../nrfconnect_examples_configuration.md | 6 +- examples/all-clusters-app/telink/prj.conf | 2 +- .../all-clusters-minimal-app/telink/prj.conf | 2 +- examples/bridge-app/telink/prj.conf | 2 +- examples/chef/telink/prj.conf | 2 +- examples/contact-sensor-app/telink/prj.conf | 2 +- .../nrfconnect/CMakeLists.txt | 4 -- examples/light-switch-app/nrfconnect/Kconfig | 5 +- .../nrfconnect/main/AppTask.cpp | 8 --- .../nrfconnect/main/include/AppTask.h | 4 -- examples/light-switch-app/telink/prj.conf | 2 +- examples/lighting-app/telink/prj.conf | 2 +- examples/lock-app/nrfconnect/CMakeLists.txt | 4 -- examples/lock-app/nrfconnect/Kconfig | 5 +- examples/lock-app/nrfconnect/main/AppTask.cpp | 8 --- .../nrfconnect/main/include/AppTask.h | 4 -- examples/lock-app/telink/prj.conf | 2 +- examples/ota-requestor-app/telink/prj.conf | 2 +- examples/platform/nrfconnect/util/ICDUtil.cpp | 40 ------------ .../nrfconnect/util/include/ICDUtil.h | 33 ---------- examples/pump-app/telink/prj.conf | 2 +- examples/pump-controller-app/telink/prj.conf | 2 +- examples/shell/telink/prj.conf | 2 +- examples/smoke-co-alarm-app/telink/prj.conf | 2 +- .../telink/prj.conf | 2 +- examples/thermostat/telink/prj.conf | 2 +- examples/window-app/nrfconnect/CMakeLists.txt | 4 -- .../window-app/nrfconnect/main/AppTask.cpp | 8 --- .../nrfconnect/main/include/AppTask.h | 4 -- examples/window-app/nrfconnect/prj.conf | 9 +-- .../window-app/nrfconnect/prj_no_dfu.conf | 9 +-- .../window-app/nrfconnect/prj_release.conf | 9 +-- examples/window-app/telink/prj.conf | 2 +- src/lib/core/CHIPConfig.h | 2 +- .../Zephyr/CHIPDevicePlatformConfig.h | 4 +- .../nrfconnect/CHIPDevicePlatformConfig.h | 21 +++--- src/platform/nrfconnect/CHIPPlatformConfig.h | 24 +++++++ .../telink/CHIPDevicePlatformConfig.h | 16 ++--- 41 files changed, 121 insertions(+), 231 deletions(-) delete mode 100644 examples/platform/nrfconnect/util/ICDUtil.cpp delete mode 100644 examples/platform/nrfconnect/util/include/ICDUtil.h diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 11642558c3dfb5..0001ff78309a53 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -135,6 +135,7 @@ matter_add_gn_arg_bool ("chip_automation_logging" FALSE) matter_add_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP) matter_add_gn_arg_bool ("chip_enable_wifi" CONFIG_WIFI_NRF700X) matter_add_gn_arg_bool ("chip_system_config_provide_statistics" CONFIG_CHIP_STATISTICS) +matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_ENABLE_ICD_SUPPORT) if (CONFIG_CHIP_FACTORY_DATA) matter_add_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE) diff --git a/config/nrfconnect/chip-module/Kconfig.features b/config/nrfconnect/chip-module/Kconfig.features index 84390e38d2029b..6486d19506bab9 100644 --- a/config/nrfconnect/chip-module/Kconfig.features +++ b/config/nrfconnect/chip-module/Kconfig.features @@ -230,27 +230,4 @@ config CHIP_WIFI_CONNECTION_RECOVERY_JITTER a random jitter interval is added to it to avoid periodicity. The random jitter is selected within range [-JITTER; +JITTER]. -config CHIP_ICD_SUBSCRIPTION_HANDLING - bool "Enables platform specific handling of ICD subscriptions" - help - Enables platform specific implementation that handles ICD subscription requests - and selects subscription report interval value considering maximum interval preferred - by the publisher. - -if CHIP_ICD_SUBSCRIPTION_HANDLING - -config CHIP_MAX_PREFERRED_SUBSCRIPTION_REPORT_INTERVAL - int "Maximum preferred interval of sending subscription reports (s)" - default 60 - help - Provides maximum preferred interval to be used by a publisher for negotiation - of the final maximum subscription report interval, after receiving a subscription - request from the initiator. This value should be selected as a compromise between - keeping the power consumption low due to not sending reports too often, and allowing - the initiator device to detect the publisher absence reasonably fast due to not sending - the reports too rarely. The current algorithm is to select bigger value from the one - requested by the initiator and the one preferred by the publisher. - -endif # CHIP_ICD_SUBSCRIPTION_HANDLING - endif # CHIP diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 12cddf50d1965e..4ebccfa2c0b0c6 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -323,37 +323,66 @@ config CHIP_ENABLE_DNS_CLIENT help Enables using the OpenThread DNS client for the Matter service discovery. -config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT - bool "Thread Sleepy End Device support" +config CHIP_ENABLE_ICD_SUPPORT + bool "Matter Intermittently Connected Devices support" default n - depends on OPENTHREAD_MTD - imply OPENTHREAD_MTD_SED + imply OPENTHREAD_MTD_SED if NET_L2_OPENTHREAD help - Enables the Thread Sleepy End Device (SED) support in Matter. + Enables the Intermittently Connected Device (ICD) support in Matter. -if CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +if CHIP_ENABLE_ICD_SUPPORT -config CHIP_SED_IDLE_INTERVAL - int "Sleepy End Device idle interval (ms)" +config CHIP_ICD_SLOW_POLL_INTERVAL + int "Intermittently Connected Device slow polling interval (ms)" default 1000 help - Provides the Sleepy End Device wake interval in milliseconds while the - device is idle (which means that there is no active exchange to or from - the device, and its commissioning window is closed). + Provides the Intermittently Connected Device slow polling interval in milliseconds while the + device is in the idle mode. It determines the fastest frequency at which the device will be able + to receive the messages in the idle mode. -config CHIP_SED_ACTIVE_INTERVAL - int "Sleepy End Device active interval (ms)" +config CHIP_ICD_FAST_POLLING_INTERVAL + int "Intermittently Connected Device fast polling interval (ms)" default 200 help - Provides the Sleepy End Device wake interval in milliseconds while the - device is active (which means that there is an active exchange to or from - the device, or its commissioning window is open). + Provides the Intermittently Connected Device fast polling interval in milliseconds while the + device is in the active mode. It determines the fastest frequency at which the device will be able + to receive the messages in the active mode. The CHIP_ICD_FAST_POLLING_INTERVAL shall be smaller than + CHIP_ICD_ACTIVE_MODE_INTERVAL. -endif # CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +config CHIP_ICD_IDLE_MODE_INTERVAL + int "Intermittently Connected Device idle mode interval (s)" + default 120 + help + Provides the Intermittently Connected Device idle mode interval in seconds. + It determines the maximum amount of time the device can stay in the idle mode, which means the + device may be unreachable and not able to receive messages. + +config CHIP_ICD_ACTIVE_MODE_INTERVAL + int "Intermittently Connected Device active mode interval (ms)" + default 300 + help + Provides the Intermittently Connected Device active mode interval in milliseconds. + It determines the minimum amount of time the device shall stay in the active mode. + +config CHIP_ICD_ACTIVE_MODE_THRESHOLD + int "Intermittently Connected Device active mode threshold (ms)" + default 300 + help + Provides the Intermittently Connected Device active mode threshold in milliseconds. + It determines the minimum amount of time the device shall stay in the active mode after the network activity. + +config CHIP_ICD_CLIENTS_PER_FABRIC + int "Intermittently Connected Device number of clients per fabric" + default 2 + help + Provides the Intermittently Connected Device number of clients per fabric. It determines the maximum number + of clients per fabric that can be registered to receive notification from a device if their subscription is lost. + +endif # CHIP_ENABLE_ICD_SUPPORT config CHIP_THREAD_SSED bool "Enable Thread Synchronized Sleepy End Device support" - depends on OPENTHREAD_CSL_RECEIVER && CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT + depends on OPENTHREAD_CSL_RECEIVER && CHIP_ENABLE_ICD_SUPPORT help Enables the Thread Synchronized Sleepy End Device support in Matter. diff --git a/docs/guides/nrfconnect_examples_configuration.md b/docs/guides/nrfconnect_examples_configuration.md index 14170f46d480d0..1e74d2f4e097ea 100644 --- a/docs/guides/nrfconnect_examples_configuration.md +++ b/docs/guides/nrfconnect_examples_configuration.md @@ -186,13 +186,13 @@ You can enable the support for Thread Sleepy End Device in Matter by setting the following Kconfig options: - `CONFIG_OPENTHREAD_MTD` -- `CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT` +- `CONFIG_CHIP_ENABLE_ICD_SUPPORT` The following Kconfig options can be used to tune Thread Sleepy End Device wake intervals: -- `CONFIG_CHIP_SED_IDLE_INTERVAL` -- `CONFIG_CHIP_SED_ACTIVE_INTERVAL` +- `CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL` +- `CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL` #### Commissioning with NFC support diff --git a/examples/all-clusters-app/telink/prj.conf b/examples/all-clusters-app/telink/prj.conf index 549cf67ea46cdf..1ae6d5b5cec6a3 100644 --- a/examples/all-clusters-app/telink/prj.conf +++ b/examples/all-clusters-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/all-clusters-minimal-app/telink/prj.conf b/examples/all-clusters-minimal-app/telink/prj.conf index 90d531fa2b1087..c7e50cd1c89afc 100644 --- a/examples/all-clusters-minimal-app/telink/prj.conf +++ b/examples/all-clusters-minimal-app/telink/prj.conf @@ -23,7 +23,7 @@ CONFIG_GPIO=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/bridge-app/telink/prj.conf b/examples/bridge-app/telink/prj.conf index ec4db478cf33b4..e05717bf080a4b 100644 --- a/examples/bridge-app/telink/prj.conf +++ b/examples/bridge-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/chef/telink/prj.conf b/examples/chef/telink/prj.conf index 2aa9402f0f1881..2104d0aaf3a999 100755 --- a/examples/chef/telink/prj.conf +++ b/examples/chef/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/contact-sensor-app/telink/prj.conf b/examples/contact-sensor-app/telink/prj.conf index 63794047c764a2..f5695b45866f39 100755 --- a/examples/contact-sensor-app/telink/prj.conf +++ b/examples/contact-sensor-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/light-switch-app/nrfconnect/CMakeLists.txt b/examples/light-switch-app/nrfconnect/CMakeLists.txt index 2e719072f23fb4..12d4454c91bcd5 100644 --- a/examples/light-switch-app/nrfconnect/CMakeLists.txt +++ b/examples/light-switch-app/nrfconnect/CMakeLists.txt @@ -70,10 +70,6 @@ if(CONFIG_MCUMGR_TRANSPORT_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() -if(CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING) - target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/ICDUtil.cpp) -endif() - chip_configure_data_model(app INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../light-switch-common/light-switch-app.zap diff --git a/examples/light-switch-app/nrfconnect/Kconfig b/examples/light-switch-app/nrfconnect/Kconfig index 73f8d8cf318a65..18fe9b4a7914df 100644 --- a/examples/light-switch-app/nrfconnect/Kconfig +++ b/examples/light-switch-app/nrfconnect/Kconfig @@ -34,7 +34,7 @@ choice OPENTHREAD_DEVICE_TYPE default OPENTHREAD_MTD endchoice -config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +config CHIP_ENABLE_ICD_SUPPORT bool default y @@ -47,9 +47,6 @@ config NRF_WIFI_LOW_POWER endif # CHIP_WIFI -config CHIP_ICD_SUBSCRIPTION_HANDLING - default y - rsource "../../../config/nrfconnect/chip-module/Kconfig.features" rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" source "Kconfig.zephyr" diff --git a/examples/light-switch-app/nrfconnect/main/AppTask.cpp b/examples/light-switch-app/nrfconnect/main/AppTask.cpp index b64f70472558c4..2716458175b20c 100644 --- a/examples/light-switch-app/nrfconnect/main/AppTask.cpp +++ b/examples/light-switch-app/nrfconnect/main/AppTask.cpp @@ -44,10 +44,6 @@ #include "OTAUtil.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include -#endif - #include #include #include @@ -229,10 +225,6 @@ CHIP_ERROR AppTask::Init() ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(RendezvousInformationFlags(RendezvousInformationFlag::kBLE)); -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING - chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&GetICDUtil()); -#endif - // Add CHIP event handler and start CHIP thread. // Note that all the initialization code should happen prior to this point // to avoid data races between the main and the CHIP threads. diff --git a/examples/light-switch-app/nrfconnect/main/include/AppTask.h b/examples/light-switch-app/nrfconnect/main/include/AppTask.h index 240ac589040164..c4018152e23da5 100644 --- a/examples/light-switch-app/nrfconnect/main/include/AppTask.h +++ b/examples/light-switch-app/nrfconnect/main/include/AppTask.h @@ -33,10 +33,6 @@ #include "DFUOverSMP.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include "ICDUtil.h" -#endif - #include struct k_timer; diff --git a/examples/light-switch-app/telink/prj.conf b/examples/light-switch-app/telink/prj.conf index baba7213300e00..7d97baca2ee0cd 100755 --- a/examples/light-switch-app/telink/prj.conf +++ b/examples/light-switch-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/lighting-app/telink/prj.conf b/examples/lighting-app/telink/prj.conf index 141f820ae003dc..79e2714b0fc2a7 100644 --- a/examples/lighting-app/telink/prj.conf +++ b/examples/lighting-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/lock-app/nrfconnect/CMakeLists.txt b/examples/lock-app/nrfconnect/CMakeLists.txt index e1b3e8f2f0e489..daa594239e89b7 100644 --- a/examples/lock-app/nrfconnect/CMakeLists.txt +++ b/examples/lock-app/nrfconnect/CMakeLists.txt @@ -71,7 +71,3 @@ endif() if(CONFIG_MCUMGR_TRANSPORT_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() - -if(CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING) - target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/ICDUtil.cpp) -endif() diff --git a/examples/lock-app/nrfconnect/Kconfig b/examples/lock-app/nrfconnect/Kconfig index 384993c130f77d..061349e92502ea 100644 --- a/examples/lock-app/nrfconnect/Kconfig +++ b/examples/lock-app/nrfconnect/Kconfig @@ -46,7 +46,7 @@ choice OPENTHREAD_DEVICE_TYPE default OPENTHREAD_MTD endchoice -config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +config CHIP_ENABLE_ICD_SUPPORT bool default y @@ -59,9 +59,6 @@ config NRF_WIFI_LOW_POWER endif # CHIP_WIFI -config CHIP_ICD_SUBSCRIPTION_HANDLING - default y - rsource "../../../config/nrfconnect/chip-module/Kconfig.features" rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" source "Kconfig.zephyr" diff --git a/examples/lock-app/nrfconnect/main/AppTask.cpp b/examples/lock-app/nrfconnect/main/AppTask.cpp index 17fa9e31412123..3ef85657363043 100644 --- a/examples/lock-app/nrfconnect/main/AppTask.cpp +++ b/examples/lock-app/nrfconnect/main/AppTask.cpp @@ -45,10 +45,6 @@ #include "OTAUtil.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include -#endif - #include #include #include @@ -222,10 +218,6 @@ CHIP_ERROR AppTask::Init() ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)); -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING - chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&GetICDUtil()); -#endif - // Add CHIP event handler and start CHIP thread. // Note that all the initialization code should happen prior to this point to avoid data races // between the main and the CHIP threads. diff --git a/examples/lock-app/nrfconnect/main/include/AppTask.h b/examples/lock-app/nrfconnect/main/include/AppTask.h index 01d1536bc2545e..a0a50da9ed23db 100644 --- a/examples/lock-app/nrfconnect/main/include/AppTask.h +++ b/examples/lock-app/nrfconnect/main/include/AppTask.h @@ -35,10 +35,6 @@ #include "DFUOverSMP.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include "ICDUtil.h" -#endif - struct k_timer; struct Identify; diff --git a/examples/lock-app/telink/prj.conf b/examples/lock-app/telink/prj.conf index 5de8f1a8f352c1..58aaca9b95d593 100755 --- a/examples/lock-app/telink/prj.conf +++ b/examples/lock-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/ota-requestor-app/telink/prj.conf b/examples/ota-requestor-app/telink/prj.conf index c117dd823f3e85..50796f3077aab1 100755 --- a/examples/ota-requestor-app/telink/prj.conf +++ b/examples/ota-requestor-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/platform/nrfconnect/util/ICDUtil.cpp b/examples/platform/nrfconnect/util/ICDUtil.cpp deleted file mode 100644 index b3dc9c80bbc9dd..00000000000000 --- a/examples/platform/nrfconnect/util/ICDUtil.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ICDUtil.h" - -ICDUtil ICDUtil::sICDUtil; - -CHIP_ERROR ICDUtil::OnSubscriptionRequested(chip::app::ReadHandler & aReadHandler, chip::Transport::SecureSession & aSecureSession) -{ - uint16_t agreedMaxInterval = CONFIG_CHIP_MAX_PREFERRED_SUBSCRIPTION_REPORT_INTERVAL; - uint16_t requestedMinInterval = 0; - uint16_t requestedMaxInterval = 0; - aReadHandler.GetReportingIntervals(requestedMinInterval, requestedMaxInterval); - - if (requestedMaxInterval > agreedMaxInterval) - { - agreedMaxInterval = requestedMaxInterval; - } - else if (agreedMaxInterval > kSubscriptionMaxIntervalPublisherLimit) - { - agreedMaxInterval = kSubscriptionMaxIntervalPublisherLimit; - } - - return aReadHandler.SetMaxReportingInterval(agreedMaxInterval); -} diff --git a/examples/platform/nrfconnect/util/include/ICDUtil.h b/examples/platform/nrfconnect/util/include/ICDUtil.h deleted file mode 100644 index 33db1e97a051ac..00000000000000 --- a/examples/platform/nrfconnect/util/include/ICDUtil.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -class ICDUtil : public chip::app::ReadHandler::ApplicationCallback -{ - CHIP_ERROR OnSubscriptionRequested(chip::app::ReadHandler & aReadHandler, - chip::Transport::SecureSession & aSecureSession) override; - friend ICDUtil & GetICDUtil(); - static ICDUtil sICDUtil; -}; - -inline ICDUtil & GetICDUtil() -{ - return ICDUtil::sICDUtil; -} diff --git a/examples/pump-app/telink/prj.conf b/examples/pump-app/telink/prj.conf index de5cf119a6a831..c105c33dccfe3d 100755 --- a/examples/pump-app/telink/prj.conf +++ b/examples/pump-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/pump-controller-app/telink/prj.conf b/examples/pump-controller-app/telink/prj.conf index 66074d03470303..964b7dca1951f3 100755 --- a/examples/pump-controller-app/telink/prj.conf +++ b/examples/pump-controller-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/shell/telink/prj.conf b/examples/shell/telink/prj.conf index 7814bceb6be45c..d0dccad1087d8c 100755 --- a/examples/shell/telink/prj.conf +++ b/examples/shell/telink/prj.conf @@ -27,7 +27,7 @@ CONFIG_PWM=y # OpenThread configs #CONFIG_OPENTHREAD_MTD=n CONFIG_OPENTHREAD_FTD=y -# CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +# CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/smoke-co-alarm-app/telink/prj.conf b/examples/smoke-co-alarm-app/telink/prj.conf index 819051b9b1cf05..2b83eacd2936bd 100755 --- a/examples/smoke-co-alarm-app/telink/prj.conf +++ b/examples/smoke-co-alarm-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/temperature-measurement-app/telink/prj.conf b/examples/temperature-measurement-app/telink/prj.conf index fe19cab9f70ad2..2780ff4a686b19 100644 --- a/examples/temperature-measurement-app/telink/prj.conf +++ b/examples/temperature-measurement-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/thermostat/telink/prj.conf b/examples/thermostat/telink/prj.conf index 827b3e7cbd32ff..fdf42e9c76466f 100755 --- a/examples/thermostat/telink/prj.conf +++ b/examples/thermostat/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/window-app/nrfconnect/CMakeLists.txt b/examples/window-app/nrfconnect/CMakeLists.txt index 441adc79b3ef95..74b2b9e13a0c6f 100644 --- a/examples/window-app/nrfconnect/CMakeLists.txt +++ b/examples/window-app/nrfconnect/CMakeLists.txt @@ -73,7 +73,3 @@ endif() if(CONFIG_MCUMGR_TRANSPORT_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() - -if(CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING) - target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/ICDUtil.cpp) -endif() diff --git a/examples/window-app/nrfconnect/main/AppTask.cpp b/examples/window-app/nrfconnect/main/AppTask.cpp index ed16dc1311dff8..cda4c0c9e318b8 100644 --- a/examples/window-app/nrfconnect/main/AppTask.cpp +++ b/examples/window-app/nrfconnect/main/AppTask.cpp @@ -35,10 +35,6 @@ #include "OTAUtil.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include -#endif - #include #include #include @@ -202,10 +198,6 @@ CHIP_ERROR AppTask::Init() ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING - chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&GetICDUtil()); -#endif - // Add CHIP event handler and start CHIP thread. // Note that all the initialization code should happen prior to this point to avoid data races // between the main and the CHIP threads diff --git a/examples/window-app/nrfconnect/main/include/AppTask.h b/examples/window-app/nrfconnect/main/include/AppTask.h index 64410f910547a2..fdd94d0c61e416 100644 --- a/examples/window-app/nrfconnect/main/include/AppTask.h +++ b/examples/window-app/nrfconnect/main/include/AppTask.h @@ -32,10 +32,6 @@ #include "DFUOverSMP.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include "ICDUtil.h" -#endif - struct k_timer; struct Identify; diff --git a/examples/window-app/nrfconnect/prj.conf b/examples/window-app/nrfconnect/prj.conf index 052d3fbe841572..48bc61f67d5a47 100644 --- a/examples/window-app/nrfconnect/prj.conf +++ b/examples/window-app/nrfconnect/prj.conf @@ -31,13 +31,10 @@ CONFIG_PWM=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=y -CONFIG_CHIP_SED_IDLE_INTERVAL=500 -CONFIG_CHIP_SED_ACTIVE_INTERVAL=500 - -# Enable ICD subscription platform specific handling -CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING=y +CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL=500 +CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL=500 # Bluetooth Low Energy configuration CONFIG_BT_DEVICE_NAME="MatterWinCov" diff --git a/examples/window-app/nrfconnect/prj_no_dfu.conf b/examples/window-app/nrfconnect/prj_no_dfu.conf index 3183a0e518ac47..570011cc9ef6da 100644 --- a/examples/window-app/nrfconnect/prj_no_dfu.conf +++ b/examples/window-app/nrfconnect/prj_no_dfu.conf @@ -36,13 +36,10 @@ CONFIG_PWM=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=y -CONFIG_CHIP_SED_IDLE_INTERVAL=500 -CONFIG_CHIP_SED_ACTIVE_INTERVAL=500 - -# Enable ICD subscription platform specific handling -CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING=y +CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL=500 +CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL=500 # Bluetooth Low Energy configuration CONFIG_BT_DEVICE_NAME="MatterWinCov" diff --git a/examples/window-app/nrfconnect/prj_release.conf b/examples/window-app/nrfconnect/prj_release.conf index f2393649c1fe0c..8143a5d60ad7e8 100644 --- a/examples/window-app/nrfconnect/prj_release.conf +++ b/examples/window-app/nrfconnect/prj_release.conf @@ -36,13 +36,10 @@ CONFIG_PWM=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=y -CONFIG_CHIP_SED_IDLE_INTERVAL=500 -CONFIG_CHIP_SED_ACTIVE_INTERVAL=500 - -# Enable ICD subscription platform specific handling -CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING=y +CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL=500 +CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL=500 # Bluetooth Low Energy configuration CONFIG_BT_DEVICE_NAME="MatterWinCov" diff --git a/examples/window-app/telink/prj.conf b/examples/window-app/telink/prj.conf index 2a65b939cf343c..12b9e05d5a9964 100644 --- a/examples/window-app/telink/prj.conf +++ b/examples/window-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index b59f3b0ef3bf6f..14453c98a02d73 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1503,7 +1503,7 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; /** * @def CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC * - * @brief Default value for the ICD Management cluster ClientsSupportedPerFabric attribute, in milliseconds + * @brief Default value for the ICD Management cluster ClientsSupportedPerFabric attribute */ #ifndef CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC #define CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC 2 diff --git a/src/platform/Zephyr/CHIPDevicePlatformConfig.h b/src/platform/Zephyr/CHIPDevicePlatformConfig.h index 18df25c480ac6f..3296f3aa8f1c55 100644 --- a/src/platform/Zephyr/CHIPDevicePlatformConfig.h +++ b/src/platform/Zephyr/CHIPDevicePlatformConfig.h @@ -114,10 +114,10 @@ #endif // CONFIG_CHIP_ENABLE_DNS_CLIENT #endif // CONFIG_CHIP_ENABLE_DNSSD_SRP -#ifdef CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +#ifdef CONFIG_CHIP_ENABLE_ICD_SUPPORT #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 #define CHIP_DEVICE_CONFIG_THREAD_SSED CONFIG_CHIP_THREAD_SSED -#endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +#endif // CONFIG_CHIP_ENABLE_ICD_SUPPORT #ifdef CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index 837b963b7a31fc..c260dbe4ac4f58 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -217,25 +217,20 @@ #endif // CONFIG_CHIP_ENABLE_DNS_CLIENT #endif // CONFIG_CHIP_ENABLE_DNSSD_SRP -#ifdef CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT -#define CHIP_DEVICE_CONFIG_ENABLE_SED 1 +#ifdef CONFIG_CHIP_ENABLE_ICD_SUPPORT #define CHIP_DEVICE_CONFIG_THREAD_SSED CONFIG_CHIP_THREAD_SSED -#endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT - -#ifdef CONFIG_NRF_WIFI_LOW_POWER -#define CHIP_DEVICE_CONFIG_ENABLE_SED 1 -#endif // CONFIG_NRF_WIFI_LOW_POWER +#endif // CONFIG_CHIP_ENABLE_ICD_SUPPORT #ifndef CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL -#ifdef CONFIG_CHIP_SED_IDLE_INTERVAL -#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_SED_IDLE_INTERVAL) -#endif // CONFIG_CHIP_SED_IDLE_INTERVAL +#ifdef CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL +#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL) +#endif // CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL #endif // CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL #ifndef CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL -#ifdef CONFIG_CHIP_SED_ACTIVE_INTERVAL -#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_SED_ACTIVE_INTERVAL) -#endif // CONFIG_CHIP_SED_ACTIVE_INTERVAL +#ifdef CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL +#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL) +#endif // CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL #endif // CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL #ifdef CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE diff --git a/src/platform/nrfconnect/CHIPPlatformConfig.h b/src/platform/nrfconnect/CHIPPlatformConfig.h index c2d34bea2ac4c9..d3c7b965217f04 100644 --- a/src/platform/nrfconnect/CHIPPlatformConfig.h +++ b/src/platform/nrfconnect/CHIPPlatformConfig.h @@ -111,3 +111,27 @@ #define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL (1000_ms32) #endif // CHIP_ENABLE_OPENTHREAD #endif // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL + +#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL +#ifdef CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL +#define CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL +#endif // CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL +#endif // CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL + +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL +#ifdef CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL +#define CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL +#endif // CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL +#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL + +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD +#ifdef CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD +#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD +#endif // CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD +#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD + +#ifndef CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC +#ifdef CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC +#define CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC +#endif // CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC +#endif // CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC diff --git a/src/platform/telink/CHIPDevicePlatformConfig.h b/src/platform/telink/CHIPDevicePlatformConfig.h index 2527a3e8fc785a..8670ac640ff62e 100644 --- a/src/platform/telink/CHIPDevicePlatformConfig.h +++ b/src/platform/telink/CHIPDevicePlatformConfig.h @@ -222,19 +222,19 @@ #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #endif // CONFIG_CHIP_EXTENDED_DISCOVERY -#ifdef CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +#ifdef CONFIG_CHIP_ENABLE_ICD_SUPPORT #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 #define CHIP_DEVICE_CONFIG_THREAD_SSED CONFIG_CHIP_THREAD_SSED -#endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +#endif // CONFIG_CHIP_ENABLE_ICD_SUPPORT #ifndef CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL -#ifdef CONFIG_CHIP_SED_IDLE_INTERVAL -#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_SED_IDLE_INTERVAL) -#endif // CONFIG_CHIP_SED_IDLE_INTERVAL +#ifdef CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL +#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL) +#endif // CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL #endif // CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL #ifndef CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL -#ifdef CONFIG_CHIP_SED_ACTIVE_INTERVAL -#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_SED_ACTIVE_INTERVAL) -#endif // CONFIG_CHIP_SED_ACTIVE_INTERVAL +#ifdef CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL +#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL) +#endif // CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL #endif // CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL From caf8d029df200a63f871d5502e0c021108caec20 Mon Sep 17 00:00:00 2001 From: tcave-bb <90306563+tcave-bb@users.noreply.github.com> Date: Wed, 13 Sep 2023 12:45:08 +0100 Subject: [PATCH 077/134] Fix attr apis (#29189) * added sensor managers * called cluster apis from delegate * removed dead code * Restyled by whitespace * Restyled by clang-format * Restyled by gn --------- Co-authored-by: Restyled.io --- .../include/air-quality-sensor-manager.h | 187 +++++++++++++++ .../relative-humidity-sensor-manager.h | 37 +++ .../include/temperature-sensor-manager.h | 37 +++ .../src/air-quality-sensor-manager.cpp | 213 ++++++++++++++++++ .../AirQualitySensorAppAttrUpdateDelegate.cpp | 140 +++++------- .../air-quality-sensor-app/linux/BUILD.gn | 9 +- .../air-quality-sensor-app/linux/main.cpp | 8 +- 7 files changed, 544 insertions(+), 87 deletions(-) create mode 100644 examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h create mode 100644 examples/air-quality-sensor-app/air-quality-sensor-common/include/relative-humidity-sensor-manager.h create mode 100644 examples/air-quality-sensor-app/air-quality-sensor-common/include/temperature-sensor-manager.h create mode 100644 examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h b/examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h new file mode 100644 index 00000000000000..98ab0375390b7f --- /dev/null +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h @@ -0,0 +1,187 @@ +#include +#include +#include +#include + +#include +#include + +#pragma once + +namespace chip { +namespace app { +namespace Clusters { + +class AirQualitySensorManager +{ +public: + // Delete copy constructor and assignment operator. + AirQualitySensorManager(const AirQualitySensorManager &) = delete; + AirQualitySensorManager(const AirQualitySensorManager &&) = delete; + AirQualitySensorManager & operator=(const AirQualitySensorManager &) = delete; + + static void InitInstance(EndpointId aEndpointId = 1) + { + if (mInstance == nullptr) + { + mInstance = new AirQualitySensorManager(aEndpointId); + mInstance->Init(); + } + }; + + /** + * @brief Get an Air Quality Manager object - this class acts as a singleton device manager for the air quality device + * @param[in] aEndpointId Endpoint that the air quality is on + * @return mInstance The AirQualitySensorManager instance, note this this could be nullptr if InitInstance has not been + * called + */ + static AirQualitySensorManager * GetInstance() { return mInstance; }; + + /** + * @brief Handles changes in Carbon Dioxide concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void Init(); + + /** + * @brief Handles changes in Air Quality measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnAirQualityChangeHandler(AirQuality::AirQualityEnum newValue); + + /** + * @brief Handles changes in Carbon Dioxide concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnCarbonDioxideMeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in Carbon Monoxide concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnCarbonMonoxideMeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in Nitrogen Dioxide concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnNitrogenDioxideMeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in PM1 concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnPm1MeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in PM10 concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnPm10MeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in PM2.5 concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnPm25MeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in Radon concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnRadonMeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in Total Volatile Organic Compounds concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnTotalVolatileOrganicCompoundsMeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in Ozone concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnOzoneMeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in Formaldehyde concentration measurement. + * @param[in] newValue The new air value to be applied. + */ + void OnFormaldehydeMeasurementChangeHandler(float newValue); + + /** + * @brief Handles changes in Temperature measurement. + * @param[in] newValue The new value to be applied. + */ + void OnTemperatureMeasurementChangeHandler(int16_t newValue); + + /** + * @brief Handles changes in Humidity measurement. + * @param[in] newValue The new value to be applied. + */ + void OnHumidityMeasurementChangeHandler(uint16_t newValue); + +private: + inline static AirQualitySensorManager * mInstance; + EndpointId mEndpointId; + AirQuality::Instance mAirQualityInstance; + ConcentrationMeasurement::Instance mCarbonDioxideConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance mCarbonMonoxideConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance mNitrogenDioxideConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance mPm1ConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance mPm10ConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance mPm25ConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance mRadonConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance mOzoneConcentrationMeasurementInstance; + ConcentrationMeasurement::Instance mFormaldehydeConcentrationMeasurementInstance; + TemperatureSensorManager mTemperatureSensorManager; + RelativeHumiditySensorManager mHumiditySensorManager; + + /** + * @brief Construct a new Air Quality Manager object - this class acts as a singleton device manager for the air quality device + * @param[in] endpointId Endpoint that the air quality device is on + */ + AirQualitySensorManager(EndpointId aEndpointId) : + mEndpointId(aEndpointId), + mAirQualityInstance(mEndpointId, + BitMask(AirQuality::Feature::kModerate, AirQuality::Feature::kFair, + AirQuality::Feature::kVeryPoor, + AirQuality::Feature::kExtremelyPoor)), + mCarbonDioxideConcentrationMeasurementInstance(mEndpointId, CarbonDioxideConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mCarbonMonoxideConcentrationMeasurementInstance(mEndpointId, CarbonMonoxideConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mNitrogenDioxideConcentrationMeasurementInstance(mEndpointId, NitrogenDioxideConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mPm1ConcentrationMeasurementInstance(mEndpointId, Pm1ConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mPm10ConcentrationMeasurementInstance(mEndpointId, Pm10ConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mPm25ConcentrationMeasurementInstance(mEndpointId, Pm25ConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mRadonConcentrationMeasurementInstance(mEndpointId, RadonConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance( + mEndpointId, TotalVolatileOrganicCompoundsConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mOzoneConcentrationMeasurementInstance(mEndpointId, OzoneConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mFormaldehydeConcentrationMeasurementInstance(mEndpointId, FormaldehydeConcentrationMeasurement::Id, + ConcentrationMeasurement::MeasurementMediumEnum::kAir, + ConcentrationMeasurement::MeasurementUnitEnum::kPpm), + mTemperatureSensorManager(mEndpointId), mHumiditySensorManager(mEndpointId){}; +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/include/relative-humidity-sensor-manager.h b/examples/air-quality-sensor-app/air-quality-sensor-common/include/relative-humidity-sensor-manager.h new file mode 100644 index 00000000000000..4759f6096c84fc --- /dev/null +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/include/relative-humidity-sensor-manager.h @@ -0,0 +1,37 @@ +#include + +#pragma once + +namespace chip { +namespace app { +namespace Clusters { + +class RelativeHumiditySensorManager +{ +public: + RelativeHumiditySensorManager(EndpointId aEndpointId) : mEndpointId(aEndpointId) + { + EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, 0); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MinMeasuredValue attribute")); + + status = RelativeHumidityMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 100); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MaxMeasuredValue attribute")); + }; + + void OnHumidityChangeHandler(uint16_t newValue) + { + EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set RelativeHumidityMeasurement MeasuredValue attribute")); + ChipLogDetail(NotSpecified, "The new RelativeHumidityMeasurement value: %d", newValue); + } + +private: + EndpointId mEndpointId; +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/include/temperature-sensor-manager.h b/examples/air-quality-sensor-app/air-quality-sensor-common/include/temperature-sensor-manager.h new file mode 100644 index 00000000000000..3a0fc0cd0f4646 --- /dev/null +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/include/temperature-sensor-manager.h @@ -0,0 +1,37 @@ +#include + +#pragma once + +namespace chip { +namespace app { +namespace Clusters { + +class TemperatureSensorManager +{ +public: + TemperatureSensorManager(EndpointId aEndpointId) : mEndpointId(aEndpointId) + { + EmberAfStatus status = TemperatureMeasurement::Attributes::MinMeasuredValue::Set(mEndpointId, -5); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MinMeasuredValue attribute")); + + status = TemperatureMeasurement::Attributes::MaxMeasuredValue::Set(mEndpointId, 60); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MaxMeasuredValue attribute")); + }; + + void OnTemperatureChangeHandler(int16_t newValue) + { + EmberAfStatus status = TemperatureMeasurement::Attributes::MeasuredValue::Set(mEndpointId, newValue); + VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, + ChipLogError(NotSpecified, "Failed to set TemperatureMeasurement MeasuredValue attribute")); + ChipLogDetail(NotSpecified, "The new TemperatureMeasurement value: %d", newValue); + } + +private: + EndpointId mEndpointId; +}; + +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp b/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp new file mode 100644 index 00000000000000..8bc4f4c627925d --- /dev/null +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp @@ -0,0 +1,213 @@ +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::DataModel; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ConcentrationMeasurement; +using namespace chip::app::Clusters::AirQuality; + +void AirQualitySensorManager::Init() +{ + // Air Quality + mAirQualityInstance.Init(); + mAirQualityInstance.UpdateAirQuality(AirQualityEnum::kGood); + + // CO2 + mCarbonDioxideConcentrationMeasurementInstance.Init(); + mCarbonDioxideConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mCarbonDioxideConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mCarbonDioxideConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mCarbonDioxideConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mCarbonDioxideConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mCarbonDioxideConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mCarbonDioxideConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mCarbonDioxideConcentrationMeasurementInstance.SetUncertainty(0.0f); + mCarbonDioxideConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // CO + mCarbonMonoxideConcentrationMeasurementInstance.Init(); + mCarbonMonoxideConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mCarbonMonoxideConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mCarbonMonoxideConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mCarbonMonoxideConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mCarbonMonoxideConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mCarbonMonoxideConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mCarbonMonoxideConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mCarbonMonoxideConcentrationMeasurementInstance.SetUncertainty(0.0f); + mCarbonMonoxideConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // NO2 + mNitrogenDioxideConcentrationMeasurementInstance.Init(); + mNitrogenDioxideConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mNitrogenDioxideConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mNitrogenDioxideConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mNitrogenDioxideConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mNitrogenDioxideConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mNitrogenDioxideConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mNitrogenDioxideConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mNitrogenDioxideConcentrationMeasurementInstance.SetUncertainty(0.0f); + mNitrogenDioxideConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // PM1 + mPm1ConcentrationMeasurementInstance.Init(); + mPm1ConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mPm1ConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mPm1ConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mPm1ConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mPm1ConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mPm1ConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mPm1ConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mPm1ConcentrationMeasurementInstance.SetUncertainty(0.0f); + mPm1ConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // PM10 + mPm10ConcentrationMeasurementInstance.Init(); + mPm10ConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mPm10ConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mPm10ConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mPm10ConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mPm10ConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mPm10ConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mPm10ConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mPm10ConcentrationMeasurementInstance.SetUncertainty(0.0f); + mPm10ConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // PM2.5 + mPm25ConcentrationMeasurementInstance.Init(); + mPm25ConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mPm25ConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mPm25ConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mPm25ConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mPm25ConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mPm25ConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mPm25ConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mPm25ConcentrationMeasurementInstance.SetUncertainty(0.0f); + mPm25ConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // Radon + mRadonConcentrationMeasurementInstance.Init(); + mRadonConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mRadonConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mRadonConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mRadonConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mRadonConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mRadonConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mRadonConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mRadonConcentrationMeasurementInstance.SetUncertainty(0.0f); + mRadonConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // TVOC + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.Init(); + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetUncertainty(0.0f); + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // Ozone + mOzoneConcentrationMeasurementInstance.Init(); + mOzoneConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mOzoneConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mOzoneConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mOzoneConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mOzoneConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mOzoneConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mOzoneConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mOzoneConcentrationMeasurementInstance.SetUncertainty(0.0f); + mOzoneConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); + + // Formaldehyde + mFormaldehydeConcentrationMeasurementInstance.Init(); + mFormaldehydeConcentrationMeasurementInstance.SetMinMeasuredValue(MakeNullable(0.0f)); + mFormaldehydeConcentrationMeasurementInstance.SetMaxMeasuredValue(MakeNullable(1000.0f)); + mFormaldehydeConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(2.0f)); + mFormaldehydeConcentrationMeasurementInstance.SetPeakMeasuredValue(MakeNullable(1.0f)); + mFormaldehydeConcentrationMeasurementInstance.SetPeakMeasuredValueWindow(320); + mFormaldehydeConcentrationMeasurementInstance.SetAverageMeasuredValue(MakeNullable(1.0f)); + mFormaldehydeConcentrationMeasurementInstance.SetAverageMeasuredValueWindow(320); + mFormaldehydeConcentrationMeasurementInstance.SetUncertainty(0.0f); + mFormaldehydeConcentrationMeasurementInstance.SetLevelValue(LevelValueEnum::kLow); +} + +void AirQualitySensorManager::OnAirQualityChangeHandler(AirQualityEnum newValue) +{ + mAirQualityInstance.UpdateAirQuality(static_cast(newValue)); + ChipLogDetail(NotSpecified, "Updated AirQuality value: %huu", newValue); +} + +void AirQualitySensorManager::OnCarbonDioxideMeasurementChangeHandler(float newValue) +{ + mCarbonDioxideConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated Carbon Dioxide: %f", newValue); +} + +void AirQualitySensorManager::OnCarbonMonoxideMeasurementChangeHandler(float newValue) +{ + mCarbonMonoxideConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated Carbon Monoxide value: %f", newValue); +} + +void AirQualitySensorManager::OnNitrogenDioxideMeasurementChangeHandler(float newValue) +{ + mNitrogenDioxideConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated Nitrogen Dioxide value: %f", newValue); +} + +void AirQualitySensorManager::OnPm1MeasurementChangeHandler(float newValue) +{ + mPm1ConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated PM1 value: %f", newValue); +} + +void AirQualitySensorManager::OnPm10MeasurementChangeHandler(float newValue) +{ + mPm10ConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated PM10 value: %f", newValue); +} + +void AirQualitySensorManager::OnPm25MeasurementChangeHandler(float newValue) +{ + mPm25ConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated PM2.5 value: %f", newValue); +} + +void AirQualitySensorManager::OnRadonMeasurementChangeHandler(float newValue) +{ + mRadonConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated Radon value: %f", newValue); +} + +void AirQualitySensorManager::OnTotalVolatileOrganicCompoundsMeasurementChangeHandler(float newValue) +{ + mTotalVolatileOrganicCompoundsConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated Total Volatile Organic Compounds value: %f", newValue); +} + +void AirQualitySensorManager::OnOzoneMeasurementChangeHandler(float newValue) +{ + mOzoneConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated Ozone value: %f", newValue); +} + +void AirQualitySensorManager::OnFormaldehydeMeasurementChangeHandler(float newValue) +{ + mFormaldehydeConcentrationMeasurementInstance.SetMeasuredValue(MakeNullable(newValue)); + ChipLogDetail(NotSpecified, "Updated Formaldehyde value: %f", newValue); +} + +void AirQualitySensorManager::OnTemperatureMeasurementChangeHandler(int16_t newValue) +{ + mTemperatureSensorManager.OnTemperatureChangeHandler(newValue); + ChipLogDetail(NotSpecified, "Updated Temperature value: %hu", newValue); +} + +void AirQualitySensorManager::OnHumidityMeasurementChangeHandler(uint16_t newValue) +{ + mHumiditySensorManager.OnHumidityChangeHandler(newValue); + ChipLogDetail(NotSpecified, "Updated Humidity value: %hu", newValue); +} diff --git a/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp b/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp index 7489a9ac9d7aaa..8be44e55cc9e17 100644 --- a/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp +++ b/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp @@ -26,54 +26,17 @@ #include #include +#include + #include #include using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; +using namespace chip::app::Clusters::AirQuality; using namespace chip::DeviceLayer; -struct ConcentrationFuncPointers -{ - EmberAfStatus (*setMeasuredValue)(chip::EndpointId, float); - /* Add required function maps */ -}; - -// Define a map of string keys to function pointers -std::map ConcentrationFuncMap = { - { "CarbonMonoxideConcentrationMeasurement", - { &CarbonMonoxideConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } }, - { "CarbonDioxideConcentrationMeasurement", - { &CarbonDioxideConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } }, - { "NitrogenDioxideConcentrationMeasurement", - { &NitrogenDioxideConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } }, - { "OzoneConcentrationMeasurement", - { &OzoneConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } }, - { "Pm25ConcentrationMeasurement", - { &Pm25ConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } }, - { "FormaldehydeConcentration", - { &FormaldehydeConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } }, - { "Pm1ConcentrationMeasurement", - { &Pm1ConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } }, - { "Pm10ConcentrationMeasurement", - { &Pm10ConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } }, - { "TotalVolatileOrganicCompoundsConcentrationMeasurement", - { &TotalVolatileOrganicCompoundsConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } }, - { "RadonConcentrationMeasurement", - { &RadonConcentrationMeasurement::Attributes::MeasuredValue::Set - /* Add required function maps */ } } -}; - AirQualitySensorAttrUpdateHandler * AirQualitySensorAttrUpdateHandler::FromJSON(const char * json) { Json::Reader reader; @@ -111,25 +74,71 @@ void AirQualitySensorAttrUpdateHandler::HandleCommand(intptr_t context) Platform::Delete(self); }); + AirQualitySensorManager * mInstance = AirQualitySensorManager::GetInstance(); if (clusterName == "AirQuality") { uint8_t newValue = static_cast(self->mJsonValue["NewValue"].asUInt()); - self->OnAirQualityChangeHandler(newValue); + mInstance->OnAirQualityChangeHandler(static_cast(newValue)); } else if (clusterName == "TemperatureMeasurement") { int16_t newValue = static_cast(self->mJsonValue["NewValue"].asUInt()); - self->OnTemperatureChangeHandler(newValue); + mInstance->OnTemperatureMeasurementChangeHandler(newValue); } else if (clusterName == "RelativeHumidityMeasurement") { uint16_t newValue = static_cast(self->mJsonValue["NewValue"].asUInt()); - self->OnHumidityChangeHandler(newValue); + mInstance->OnHumidityMeasurementChangeHandler(newValue); + } + else if (clusterName == "CarbonDioxideConcentrationMeasurement") + { + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnCarbonDioxideMeasurementChangeHandler(newValue); + } + else if (clusterName == "CarbonMonoxideConcentrationMeasurement") + { + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnCarbonMonoxideMeasurementChangeHandler(newValue); + } + else if (clusterName == "NitrogenDioxideConcentrationMeasurement") + { + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnNitrogenDioxideMeasurementChangeHandler(newValue); } - else if (clusterName.find("Concentration") != std::string::npos) + else if (clusterName == "OzoneConcentrationMeasurement") { - float newValue = static_cast(self->mJsonValue["NewValue"].asFloat()); - self->OnConcetratorChangeHandler(clusterName, newValue); + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnOzoneMeasurementChangeHandler(newValue); + } + else if (clusterName == "Pm25ConcentrationMeasurement") + { + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnPm25MeasurementChangeHandler(newValue); + } + else if (clusterName == "FormaldehydeConcentration") + { + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnFormaldehydeMeasurementChangeHandler(newValue); + } + else if (clusterName == "Pm1ConcentrationMeasurement") + { + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnPm1MeasurementChangeHandler(newValue); + } + else if (clusterName == "Pm10ConcentrationMeasurement") + { + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnPm10MeasurementChangeHandler(newValue); + } + else if (clusterName == "TotalVolatileOrganicCompoundsConcentrationMeasurement") + { + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnTotalVolatileOrganicCompoundsMeasurementChangeHandler(newValue); + } + else if (clusterName == "RadonConcentrationMeasurement") + { + float newValue = static_cast(self->mJsonValue["NewValue"].asDouble()); + mInstance->OnRadonMeasurementChangeHandler(newValue); } else { @@ -140,45 +149,6 @@ void AirQualitySensorAttrUpdateHandler::HandleCommand(intptr_t context) Platform::Delete(self); } -void AirQualitySensorAttrUpdateHandler::OnAirQualityChangeHandler(uint8_t newValue) -{ - EndpointId endpoint = 1; - EmberAfStatus status = AirQuality::Attributes::AirQuality::Set(endpoint, static_cast(newValue)); - VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, ChipLogError(NotSpecified, "Failed to set AirQuality attribute")); - ChipLogDetail(NotSpecified, "The new AirQuality value: %d", newValue); -} - -void AirQualitySensorAttrUpdateHandler::OnTemperatureChangeHandler(int16_t newValue) -{ - EndpointId endpoint = 1; - EmberAfStatus status = TemperatureMeasurement::Attributes::MeasuredValue::Set(endpoint, newValue); - VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, - ChipLogError(NotSpecified, "Failed to TemperatureMeasurement MeasuredValue attribute")); - ChipLogDetail(NotSpecified, "The new TemperatureMeasurement value: %d", newValue); -} - -void AirQualitySensorAttrUpdateHandler::OnHumidityChangeHandler(uint16_t newValue) -{ - EndpointId endpoint = 1; - EmberAfStatus status = RelativeHumidityMeasurement::Attributes::MeasuredValue::Set(endpoint, newValue); - VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, - ChipLogError(NotSpecified, "Failed to RelativeHumidityMeasurement MeasuredValue attribute")); - ChipLogDetail(NotSpecified, "The new RelativeHumidityMeasurement value: %d", newValue); -} - -void AirQualitySensorAttrUpdateHandler::OnConcetratorChangeHandler(std::string ConcentrationName, float newValue) -{ - auto [setMeasuredValue] = ConcentrationFuncMap[ConcentrationName]; - - VerifyOrReturn(setMeasuredValue != NULL, ChipLogError(NotSpecified, "Invalid Concentration %s", ConcentrationName.c_str())); - - EndpointId endpoint = 1; - EmberAfStatus status = setMeasuredValue(endpoint, newValue); - VerifyOrReturn(EMBER_ZCL_STATUS_SUCCESS == status, - ChipLogError(NotSpecified, "Failed to %s set MeasuredValue attribute", ConcentrationName.c_str())); - ChipLogDetail(NotSpecified, "The new %s value: %f", ConcentrationName.c_str(), newValue); -} - void AirQualitySensorAppAttrUpdateDelegate::OnEventCommandReceived(const char * json) { auto handler = AirQualitySensorAttrUpdateHandler::FromJSON(json); diff --git a/examples/air-quality-sensor-app/linux/BUILD.gn b/examples/air-quality-sensor-app/linux/BUILD.gn index 4f0fb98810d3f9..4832593f9231b4 100644 --- a/examples/air-quality-sensor-app/linux/BUILD.gn +++ b/examples/air-quality-sensor-app/linux/BUILD.gn @@ -29,6 +29,10 @@ config("includes") { executable("air-quality-sensor-app") { sources = [ + "${chip_root}/examples/air-quality-sensor-app/air-quality-sensor-common/include/air-quality-sensor-manager.h", + "${chip_root}/examples/air-quality-sensor-app/air-quality-sensor-common/include/relative-humidity-sensor-manager.h", + "${chip_root}/examples/air-quality-sensor-app/air-quality-sensor-common/include/temperature-sensor-manager.h", + "${chip_root}/examples/air-quality-sensor-app/air-quality-sensor-common/src/air-quality-sensor-manager.cpp", "AirQualitySensorAppAttrUpdateDelegate.cpp", "include/CHIPProjectAppConfig.h", "main.cpp", @@ -50,7 +54,10 @@ executable("air-quality-sensor-app") { ] } - include_dirs = [ "include" ] + include_dirs = [ + "include", + "${chip_root}/examples/air-quality-sensor-app/air-quality-sensor-common/include", + ] cflags = [ "-Wconversion" ] diff --git a/examples/air-quality-sensor-app/linux/main.cpp b/examples/air-quality-sensor-app/linux/main.cpp index 9c20fb3c2259c3..cad641e8971cdd 100644 --- a/examples/air-quality-sensor-app/linux/main.cpp +++ b/examples/air-quality-sensor-app/linux/main.cpp @@ -18,6 +18,7 @@ #include "AirQualitySensorAppAttrUpdateDelegate.h" #include +#include #include #include @@ -27,6 +28,8 @@ #include #endif +#define AIR_QUALITY_SENSOR_ENDPOINT 1 + using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; @@ -37,7 +40,10 @@ NamedPipeCommands sChipNamedPipeCommands; AirQualitySensorAppAttrUpdateDelegate sAirQualitySensorAppCommandDelegate; } // namespace -void ApplicationInit() {} +void ApplicationInit() +{ + AirQualitySensorManager::InitInstance(EndpointId(AIR_QUALITY_SENSOR_ENDPOINT)); +} void ApplicationShutdown() {} From f0bb951ea120d410eb187040a4c482363249fb48 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 13 Sep 2023 07:48:19 -0400 Subject: [PATCH 078/134] Remove last remaining non-enum-class bitmaps that we codegen. (#29193) --- .../all-clusters-app.matter | 11 +++++++++++ .../barrier-control-server.cpp | 5 +++-- src/app/common/templates/config-data.yaml | 6 ------ src/app/zap-templates/templates/app/enums.zapt | 9 --------- .../draft/barrier-control-cluster.xml | 2 ++ .../data_model/controller-clusters.matter | 11 +++++++++++ src/controller/python/chip/clusters/Objects.py | 10 ++++++++++ .../Framework/CHIP/templates/availability.yaml | 5 +++++ .../CHIP/zap-generated/MTRBaseClusters.h | 11 +++++++++++ .../app-common/zap-generated/cluster-enums.h | 18 +++++++++++++++++- .../app-common/zap-generated/enums.h | 11 ----------- 11 files changed, 70 insertions(+), 29 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index f8619b6f400a60..f42f02a87f8a82 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -3925,6 +3925,17 @@ server cluster WindowCovering = 258 { /** This cluster provides control of a barrier (garage door). */ server cluster BarrierControl = 259 { + bitmap BarrierControlCapabilities : BITMAP8 { + kPartialBarrier = 0x1; + } + + bitmap BarrierControlSafetyStatus : BITMAP16 { + kRemoteLockout = 0x1; + kTemperDetected = 0x2; + kFailedCommunication = 0x4; + kPositionFailure = 0x8; + } + readonly attribute enum8 barrierMovingState = 1; readonly attribute bitmap16 barrierSafetyStatus = 2; readonly attribute bitmap8 barrierCapabilities = 3; diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp index 645fc943078355..6cd4998d8aba4a 100644 --- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp +++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -99,7 +100,7 @@ bool emAfPluginBarrierControlServerIsPartialBarrierSupported(EndpointId endpoint uint8_t bitmap; EmberAfStatus status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap); assert(status == EMBER_ZCL_STATUS_SUCCESS); - return READBITS(bitmap, EMBER_AF_BARRIER_CONTROL_CAPABILITIES_PARTIAL_BARRIER); + return (bitmap & to_underlying(BarrierControlCapabilities::kPartialBarrier)) != 0; } static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open) @@ -139,7 +140,7 @@ uint16_t emAfPluginBarrierControlServerGetSafetyStatus(EndpointId endpoint) static bool isRemoteLockoutOn(EndpointId endpoint) { uint16_t safetyStatus = emAfPluginBarrierControlServerGetSafetyStatus(endpoint); - return READBITS(safetyStatus, EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_REMOTE_LOCKOUT); + return (safetyStatus & to_underlying(BarrierControlSafetyStatus::kRemoteLockout)) != 0; } void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool open, bool command) diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index 601d3f13f613fd..aa59f199cf1d55 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -12,12 +12,6 @@ WeakEnums: - RadioFaultEnum - StepMode -DefineBitmaps: - # Allow-list of bitmaps that we generates as #define as well as enum classes. - # The goal is to drive this down to 0. - - BarrierControlCapabilities - - BarrierControlSafetyStatus - CommandHandlerInterfaceOnlyClusters: # List of clusters that are implemented entirely with # CommandHandlerInterface and hence do not need generated command dispatch. diff --git a/src/app/zap-templates/templates/app/enums.zapt b/src/app/zap-templates/templates/app/enums.zapt index 71b2d32ad75066..d0e95a7df2b75f 100644 --- a/src/app/zap-templates/templates/app/enums.zapt +++ b/src/app/zap-templates/templates/app/enums.zapt @@ -18,12 +18,3 @@ enum EmberAf{{asType label}} : {{asUnderlyingZclType name}} { }; {{/if}} {{/zcl_enums}} - -{{#zcl_bitmaps}} -{{#if (isInConfigList label "DefineBitmaps")}} -{{#zcl_bitmap_items}} -#define EMBER_AF_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}} ({{mask}}) -#define EMBER_AF_{{asDelimitedMacro parent.label}}_{{asDelimitedMacro label}}_OFFSET ({{asOffset mask}}) -{{/zcl_bitmap_items}} -{{/if}} -{{/zcl_bitmaps}} diff --git a/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml b/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml index 08eda3b79ded15..d807b23d1f2528 100644 --- a/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml @@ -18,10 +18,12 @@ limitations under the License. + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d2b7233e62c5ed..eb2e77f0a5ac96 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -4344,6 +4344,17 @@ client cluster WindowCovering = 258 { /** This cluster provides control of a barrier (garage door). */ client cluster BarrierControl = 259 { + bitmap BarrierControlCapabilities : BITMAP8 { + kPartialBarrier = 0x1; + } + + bitmap BarrierControlSafetyStatus : BITMAP16 { + kRemoteLockout = 0x1; + kTemperDetected = 0x2; + kFailedCommunication = 0x4; + kPositionFailure = 0x8; + } + readonly attribute enum8 barrierMovingState = 1; readonly attribute bitmap16 barrierSafetyStatus = 2; readonly attribute bitmap8 barrierCapabilities = 3; diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 8012a493d3db29..0939509b6f47fd 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -22316,6 +22316,16 @@ def descriptor(cls) -> ClusterObjectDescriptor: featureMap: 'uint' = None clusterRevision: 'uint' = None + class Bitmaps: + class BarrierControlCapabilities(IntFlag): + kPartialBarrier = 0x1 + + class BarrierControlSafetyStatus(IntFlag): + kRemoteLockout = 0x1 + kTemperDetected = 0x2 + kFailedCommunication = 0x4 + kPositionFailure = 0x8 + class Commands: @dataclass class BarrierControlGoToPercent(ClusterCommand): diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 3e23efcf1dbc43..6406a6a666a9e7 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7686,3 +7686,8 @@ - release: "Future" versions: "future" + provisional: + bitmaps: + BarrierControl: + - BarrierControlCapabilities + - BarrierControlSafetyStatus diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 3afa8df46adf40..8c3d082798aa46 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -27616,6 +27616,17 @@ typedef NS_OPTIONS(uint16_t, MTRWindowCoveringSafetyStatus) { MTRWindowCoveringSafetyStatusProtection API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) = 0x800, } API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +typedef NS_OPTIONS(uint8_t, MTRBarrierControlCapabilities) { + MTRBarrierControlCapabilitiesPartialBarrier MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + +typedef NS_OPTIONS(uint16_t, MTRBarrierControlSafetyStatus) { + MTRBarrierControlSafetyStatusRemoteLockout MTR_PROVISIONALLY_AVAILABLE = 0x1, + MTRBarrierControlSafetyStatusTemperDetected MTR_PROVISIONALLY_AVAILABLE = 0x2, + MTRBarrierControlSafetyStatusFailedCommunication MTR_PROVISIONALLY_AVAILABLE = 0x4, + MTRBarrierControlSafetyStatusPositionFailure MTR_PROVISIONALLY_AVAILABLE = 0x8, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRPumpConfigurationAndControlControlMode) { MTRPumpConfigurationAndControlControlModeConstantSpeed API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)) = 0x00, MTRPumpConfigurationAndControlControlModeConstantPressure API_AVAILABLE(ios(16.5), macos(13.4), watchos(9.5), tvos(16.5)) diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 60f0c614cb7118..ba288e2a87d987 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -2612,7 +2612,23 @@ enum class SafetyStatus : uint16_t }; } // namespace WindowCovering -namespace BarrierControl {} // namespace BarrierControl +namespace BarrierControl { + +// Bitmap for BarrierControlCapabilities +enum class BarrierControlCapabilities : uint8_t +{ + kPartialBarrier = 0x1, +}; + +// Bitmap for BarrierControlSafetyStatus +enum class BarrierControlSafetyStatus : uint16_t +{ + kRemoteLockout = 0x1, + kTemperDetected = 0x2, + kFailedCommunication = 0x4, + kPositionFailure = 0x8, +}; +} // namespace BarrierControl namespace PumpConfigurationAndControl { diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 2152ee8e992212..7d30ac54349ac7 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -113,14 +113,3 @@ enum EmberAfStepMode : uint8_t EMBER_ZCL_STEP_MODE_UP = 0, EMBER_ZCL_STEP_MODE_DOWN = 1, }; - -#define EMBER_AF_BARRIER_CONTROL_CAPABILITIES_PARTIAL_BARRIER (1) -#define EMBER_AF_BARRIER_CONTROL_CAPABILITIES_PARTIAL_BARRIER_OFFSET (0) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_REMOTE_LOCKOUT (1) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_REMOTE_LOCKOUT_OFFSET (0) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_TEMPER_DETECTED (2) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_TEMPER_DETECTED_OFFSET (1) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_FAILED_COMMUNICATION (4) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_FAILED_COMMUNICATION_OFFSET (2) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_POSITION_FAILURE (8) -#define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_POSITION_FAILURE_OFFSET (3) From 8edb9f0a81b8243be34f3550fc95123d13ffdb89 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 13 Sep 2023 07:49:30 -0400 Subject: [PATCH 079/134] Change chip-tool to put its platform KVS in its storage directory. (#29133) And also name it chip_tool_kvs, not chip_kvs. This should avoid chip-tool stomping on the KVS of server-side apps. --- .../chip-tool/commands/common/Commands.cpp | 32 +++++++++++++++++++ src/controller/ExamplePersistentStorage.cpp | 14 +++++++- src/controller/ExamplePersistentStorage.h | 3 ++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/examples/chip-tool/commands/common/Commands.cpp b/examples/chip-tool/commands/common/Commands.cpp index c2f49c236738b5..050588eb7407ff 100644 --- a/examples/chip-tool/commands/common/Commands.cpp +++ b/examples/chip-tool/commands/common/Commands.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "../clusters/JsonParser.h" @@ -41,6 +42,35 @@ constexpr const char * kJsonCommandKey = "command"; constexpr const char * kJsonCommandSpecifierKey = "command_specifier"; constexpr const char * kJsonArgumentsKey = "arguments"; +template +struct HasInitWithString +{ + template + static constexpr auto check(U *) -> typename std::is_same().Init("")), CHIP_ERROR>::type; + + template + static constexpr std::false_type check(...); + + typedef decltype(check>(nullptr)) type; + +public: + static constexpr bool value = type::value; +}; + +// Template so we can do conditional enabling +template ::value, int> = 0> +static void UseStorageDirectory(T & storageManagerImpl, const char * storageDirectory) +{ +#if !CHIP_DISABLE_PLATFORM_KVS + std::string platformKVS = std::string(storageDirectory) + "/chip_tool_kvs"; + storageManagerImpl.Init(platformKVS.c_str()); +#endif // !CHIP_DISABLE_PLATFORM_KVS +} + +template ::value, int> = 0> +static void UseStorageDirectory(T & storageManagerImpl, const char * storageDirectory) +{} + bool GetArgumentsFromJson(Command * command, Json::Value & value, bool optional, std::vector & outArgs) { auto memberNames = value.getMemberNames(); @@ -290,6 +320,8 @@ CHIP_ERROR Commands::RunCommand(int argc, char ** argv, bool interactive, } chip::Logging::SetLogFilter(mStorage.GetLoggingLevel()); + + UseStorageDirectory(chip::DeviceLayer::PersistedStorage::KeyValueStoreMgrImpl(), mStorage.GetDirectory()); #endif // CONFIG_USE_LOCAL_STORAGE return command->Run(); diff --git a/src/controller/ExamplePersistentStorage.cpp b/src/controller/ExamplePersistentStorage.cpp index b98b682141b244..77e54549258919 100644 --- a/src/controller/ExamplePersistentStorage.cpp +++ b/src/controller/ExamplePersistentStorage.cpp @@ -39,7 +39,7 @@ constexpr const char kLocalNodeIdKey[] = "LocalNodeId"; constexpr const char kCommissionerCATsKey[] = "CommissionerCATs"; constexpr LogCategory kDefaultLoggingLevel = kLogCategory_Automation; -std::string GetFilename(const char * directory, const char * name) +const char * GetUsedDirectory(const char * directory) { const char * dir = directory; @@ -53,6 +53,13 @@ std::string GetFilename(const char * directory, const char * name) dir = "/tmp"; } + return dir; +} + +std::string GetFilename(const char * directory, const char * name) +{ + const char * dir = GetUsedDirectory(directory); + if (name == nullptr) { return std::string(dir) + "/chip_tool_config.ini"; @@ -182,6 +189,11 @@ CHIP_ERROR PersistentStorage::SyncClearAll() return CommitConfig(mDirectory, mName); } +const char * PersistentStorage::GetDirectory() const +{ + return GetUsedDirectory(mDirectory); +} + CHIP_ERROR PersistentStorage::CommitConfig(const char * directory, const char * name) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/controller/ExamplePersistentStorage.h b/src/controller/ExamplePersistentStorage.h index 9323c1de501b04..685bcfdd4ae6d9 100644 --- a/src/controller/ExamplePersistentStorage.h +++ b/src/controller/ExamplePersistentStorage.h @@ -65,6 +65,9 @@ class PersistentStorage : public chip::PersistentStorageDelegate // Clear all of the persistent storage for running session. CHIP_ERROR SyncClearAll(); + // Get the directory actually being used for the storage. + const char * GetDirectory() const; + private: CHIP_ERROR CommitConfig(const char * directory, const char * name); inipp::Ini mConfig; From 189967f3e09b1fdd67e2dd90ddb3f1523c6b92e5 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 13 Sep 2023 14:22:16 +0100 Subject: [PATCH 080/134] Expand rvc example app (#29159) * Added an RVC app example containg the RvcRunMode and RvcClean clusters. * Regenerated zap code. * Added the RvcRunMode and RvcClean clusters' logic to the RVC app example. * Added the RvcOpState cluster's logic to the RVC app example. * Added documentation about the RVC example app. * Added an implementation for the GetCoutdownTime virtual function. * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Added constants for the Cluster's endpoints. Adde vendor mode tags for the mapping mode. * Restyled by clang-format * Fixed the feature value for the RvcRun and RvcClean clusters. * Restyled by clang-format * zap regen after pull. * Removed unused clusters form the zap and matter files. * Modified the RvcRun ChangeToMode handler to fit the new state machine. * RvcApp: Added a FIFO pipe for out-of-band messages. * RVC App: Added all out-of-bound messages and their logic. * OpState Server: Updated the documentation for the SetOperationalState method. * RVC App: Update the RVC app state diagram. * RVC App: Added PICS files for testing the RVC app. * RVC App: Fixed state machine bug. Some invalid changes were being notified as being successful. * RVC App: Fixed the PICS files to be accepted by the python test scripts. * Added a readme to the RVC app example. * Added an Error key to the ErrorEven out-of-band message to allow the user to trigger error state with all the availabele error state IDs. * Configured the RvcOperationalState PICS to indicate that the device supports testing the device in all the different error states. * Added a script to help test the RVC example app against all the yaml tests. * Updated the readme to include information on how to run the yaml tests. * Restyled by whitespace * Restyled by clang-format * Restyled by prettier-markdown * Restyled by shellharden * Restyled by shfmt * RVC App: fixed spelling errors. * RVC App: combined the PICS files into one file and updated the documentation. * Typo fixes from code review. Co-authored-by: Petru Lauric <81822411+plauric@users.noreply.github.com> Co-authored-by: Boris Zbarsky * Added missed error states that can be tested to the PICS files. * removed non-applicable yaml tests. * RVC App: Modified the readme to reduce the number of words that need to be added to the work list. * Restyled by prettier-markdown * RVC App: added the readme to the toc index. * Restyled by prettier-markdown * Fixed names of tests in helper script as some had been removed * Updated yaml tests run script. Removed tests that did not apply. * Readability * Restyled by shfmt --------- Co-authored-by: Restyled.io Co-authored-by: Petru Lauric <81822411+plauric@users.noreply.github.com> Co-authored-by: Boris Zbarsky Co-authored-by: Matthew Hazley --- .github/.wordlist.txt | 2 + docs/examples/index.md | 9 + examples/rvc-app/README.md | 125 ++++++++ examples/rvc-app/RVC_app_state_diagram.png | Bin 0 -> 244472 bytes .../rvc-app/RVC_app_state_diagram_drawio.xml | 2 +- examples/rvc-app/linux/BUILD.gn | 2 + .../rvc-app/linux/RvcAppCommandDelegate.cpp | 164 ++++++++++ .../rvc-app/linux/RvcAppCommandDelegate.h | 69 +++++ examples/rvc-app/linux/main.cpp | 31 +- examples/rvc-app/run_all_yaml_tests.sh | 30 ++ .../rvc-app/rvc-common/include/rvc-device.h | 39 ++- .../pics/RVC Clean Mode Cluster Test Plan.xml | 132 ++++++++ ...VC Operational State Cluster Test Plan.xml | 285 ++++++++++++++++++ .../pics/RVC Run Mode Cluster Test Plan.xml | 132 ++++++++ .../rvc-common/pics/RVC_App_Test_Plan.txt | 53 ++++ .../rvc-app/rvc-common/src/rvc-device.cpp | 226 +++++++++++++- .../operational-state-server.h | 2 +- 17 files changed, 1280 insertions(+), 23 deletions(-) create mode 100644 examples/rvc-app/README.md create mode 100644 examples/rvc-app/RVC_app_state_diagram.png create mode 100644 examples/rvc-app/linux/RvcAppCommandDelegate.cpp create mode 100644 examples/rvc-app/linux/RvcAppCommandDelegate.h create mode 100755 examples/rvc-app/run_all_yaml_tests.sh create mode 100644 examples/rvc-app/rvc-common/pics/RVC Clean Mode Cluster Test Plan.xml create mode 100644 examples/rvc-app/rvc-common/pics/RVC Operational State Cluster Test Plan.xml create mode 100644 examples/rvc-app/rvc-common/pics/RVC Run Mode Cluster Test Plan.xml create mode 100644 examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 1e24bdb65838d1..eb27e5855e1bc5 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1562,3 +1562,5 @@ zhengyaohan Zigbee zigbeealliance zigbeethread +PIXIT +RVC \ No newline at end of file diff --git a/docs/examples/index.md b/docs/examples/index.md index 9c74b1f5360e6a..b28c7c6e2ebd7f 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -292,3 +292,12 @@ window-app/**/README resource-monitoring-app/**/README ``` + +## Air Quality Sensor example + +```{toctree} +:glob: +:maxdepth: 1 + +rvc-app/README +``` diff --git a/examples/rvc-app/README.md b/examples/rvc-app/README.md new file mode 100644 index 00000000000000..a5d68613fc88bc --- /dev/null +++ b/examples/rvc-app/README.md @@ -0,0 +1,125 @@ +# RVC example app + +This example app is meant to demonstrate an implementation of a Matter Robotic +Vacuum Cleaner device. + +## State machine + +Below is a diagram describing the state machine for this app. + +![state machine](RVC_app_state_diagram.png) + +This app can support most of the tests in the test plans. + +## Out-of-band messages + +Out-of-band messages are available to simulate typical device behaviors and +allow the app to navigate to all the states. To send an out-of-band message, +echo the JSON message to the `/tmp/chip_rvc_fifo_` file. The JSON message +must have a `"Name"` key that contains the command name. This name is shown in +the state machine diagram above. Example +`echo '{"Name": "Charged"}' > /tmp/chip_rvc_fifo_42`. + +### `ErrorEvent` message + +The error event message requires the additional key `"Error"` which specifies +the error state ID. This can be one of `UnableToStartOrResume`, +`UnableToCompleteOperation`, `CommandInvalidInState`, +`FailedToFindChargingDock`, `Stuck`, `DustBinMissing`, `DustBinFull`, +`WaterTankEmpty`, `WaterTankMissing`, `WaterTankLidOpen`, +`MopCleaningPadMissing`. + +## Testing + +A PICS file that details what this app supports testing is available in the +`pics` directory as a txt file. After building the RVC example app, chip-tool, +and setting up the testing environment, python tests can be executed with +`./scripts/tests/run_python_test.py --script src/python_testing/.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt --int-arg "` + +**Note:** If the testing environment has not been commissioned with the RVC app, +use chip-tool to switch on the commissioning window +`chip-tool pairing open-commissioning-window`, and add the following flags to +the `--script-args` above. +`--commissioning-method on-network --discriminator XXXX --passcode XXXX`. + +Below are the PIXIT definitions required for the different python tests. + +### RVC Clean Mode cluster + +#### TC 1.2 + +PIXIT: `PIXIT_ENDPOINT:1` +Example command: +`./scripts/tests/run_python_test.py --script src/python_testing/TC_RVCCLEANM_1_2.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt --int-arg PIXIT_ENDPOINT:1"` + +#### TC 2.1 + +PIXIT: +`PIXIT_ENDPOINT:1 PIXIT.RVCCLEANM.MODE_CHANGE_FAIL:1 PIXIT.RVCCLEANM.MODE_CHANGE_OK:2` +Example command: +`/scripts/tests/run_python_test.py --script src/python_testing/TC_RVCCLEANM_2_1.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt --int-arg PIXIT_ENDPOINT:1 PIXIT.RVCCLEANM.MODE_CHANGE_FAIL:1 PIXIT.RVCCLEANM.MODE_CHANGE_OK:2"` + +When asked "Manually put the device in a state from which it will FAIL to +transition to mode 1", set the `RvcRunMode` to 1. +`chip-tool rvcrunmode change-to-mode 1` + +When asked "Manually put the device in a state from which it will SUCCESSFULLY +transition to mode 2", set the `RvcRunMode` to 0. +`chip-tool rvcrunmode change-to-mode 0` + +#### TC 3.2 + +This is not applicable because this RVC device does not support the +`StartUpMode` attribute. + +### RVC Run Mode cluster + +#### TC 1.2 + +PIXIT: `PIXIT_ENDPOINT:1` Example command: +`./scripts/tests/run_python_test.py --script src/python_testing/TC_RVCRUNM_1_2.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt --int-arg PIXIT_ENDPOINT:1"` + +#### TC 2.1 + +PIXIT: +`PIXIT_ENDPOINT:1 PIXIT.RVCRUNM.MODE_CHANGE_FAIL:2 PIXIT.RVCRUNM.MODE_CHANGE_OK:0` +Example command: +`./scripts/tests/run_python_test.py --script src/python_testing/TC_RVCRUNM_2_1.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt --int-arg PIXIT_ENDPOINT:1 PIXIT.RVCRUNM.MODE_CHANGE_FAIL:2 PIXIT.RVCRUNM.MODE_CHANGE_OK:0"` + +When asked "Manually put the device in a state from which it will FAIL to +transition to mode 2", set the `RvcRunMode` to 1. +`chip-tool rvcrunmode change-to-mode 1` + +When asked "Manually put the device in a state from which it will SUCCESSFULLY +transition to mode 0", do nothing. + +#### TC 3.2 + +This is not applicable because this RVC device does not support the +`StartUpMode` attribute. + +### RVC Operational State cluster + +#### TC 2.1 + +PIXIT: `PIXIT_ENDPOINT:1` +Example command: +`./scripts/tests/run_python_test.py --script src/python_testing/TC_RVCOPSTATE_2_1.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt --int-arg PIXIT_ENDPOINT:1"` + +Use the out-of-band messages, chip-tool messages and the state machine diagram +to navigate to the required states. + +#### TC 2.3 + +PIXIT: `PIXIT_ENDPOINT:1` +Example command: +`./scripts/tests/run_python_test.py --script src/python_testing/TC_RVCOPSTATE_2_3.py --script-args "--storage-path admin_storage.json --PICS examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt --int-arg PIXIT_ENDPOINT:1"` + +Use the out-of-band messages, chip-tool messages and the state machine diagram +to transition to the required states. + +### Running the yaml tests + +After commissioning the device, all the yaml tests can be run by running the +`run_all_yaml_tests.sh` script from the root dir with the node ID that the +device was commissioned with. diff --git a/examples/rvc-app/RVC_app_state_diagram.png b/examples/rvc-app/RVC_app_state_diagram.png new file mode 100644 index 0000000000000000000000000000000000000000..5b8cd90807bae74b416e1b4f0525162b2332a28d GIT binary patch literal 244472 zcmce;byQW|8a@gLN{5t`AWD~Xhkzp8-5}j59U@4hBHhy684MT5GO%zWF@QBuGw13=NqO83qOhP5iZ}0t^gN5)2GHJK}xte}*j% zo54S@4hmwzFh#w@>o726Fyf*wlw5SSW*(?1s@^`>W5N{Tcvo#VT-O@puCxg`ak8

b z3=TDEB|ex+;s1Dz|6Uq+-h=;7p6Bxf#c^|#q32_Jd+7>&iOrmV0O!xRAd~+xBh2ky zOTzzLHH=Rh>+F5hr2WVLwGkhAVFP;Yf3=kVkM%b;A}ApxDHmxG=;-Kt?pSOM!6GKM zoaYJPt_>&QU5u0!_;jDse3<&VqjBtEx4is6RuYe|wA=E$et7r4DTq&LxEj4|9AFLm>z zdhVDtHq_kv&u6;PH}=OpmPN1mU(WL#8#9d+E92nk=)DxBd+~yg56sokknC%5@t-mM zak;s?=k6z#>vJ*m z>g0tLqv>K8I7~WP$W7aG4Z4=FabESNRkA4p)aqr=ghfR5+ey7st!KWQjusF+=5z6R z8G@IYl3<6xInbwCth3M(gw5r7;YfKgkS^BT(}U*g>$`V+{Bo||Gc%rpgJaOufJnmb z4QkT$$&^jC=cRKNkC~ZSU_^whw{&QlW|ei0LMC!SVIdYawqMQLU5O#?A?2=Zh8za|B+OLUf}4h6_E83UP}EBrz6DQ zJ2;RyJUIBg@tDUE5iC;1M#SpDBz6AQ7Iw6aC}*?wk~#Rb_b`h7V=2FujKO_Hil_v_9&Z_44jzv`$B=6 z62(iX)=~c7?xv-sLmei-V#E&1zDw%{$$+;+-Ob&nb ziM@G~;pk~CV$yURqwDpl=$rF4q4{V*P_}GJ)5wT&9$kUIyMe)1wg*GmvSM*8Mj3X2 zhwoDm?+4chiG*5!&GoSUx<5ycm+_BujVkZs?ZVQcz7qRCvV@S4FNoLdh;CK8>a5Xk}^XDZ*D#E{WQD;~qjjk25)Bg`oL3M5~~5lfLA$we*OLl$X^~ z@4E@vOntDPzIt6u17}5UO98fOS~O4!zD0B!8JAXXFhhK>kJY$aNL2K_qxMjiG_&KH z+`7qrvYPT%al_5$CQXA@4y=dRVr@~q_Q*+|`>psnI(6T1=&|#E21U(^j!VLKi+@m=5>8B$QLM5FihE&SXyl0#LfJ8;fYEVc7A=3 zUm9zaw~-6%KQf+P3n()L`^ye%|M1y=*qeGUr7@n}Vi2UmXLV%4YWn*6>IWd!w#Q5F zwTF{L_7;K&y^zpzSnd8KEJuJ*S{8ejq820tU)u6Sg$Em!xs};rRm!ZA(JqjIV|T8h zxPsJRr36FZOlVRU_9qaie2-_!+&r0umMc1SY&M44JSz=RC=G?8U=ITkjZ?CJ4 z+>&^l=GWJ0uCI0^ED3l&Gk0Vb_yuqCx4N|E*^p~dPGVZopkqyAM;qkJVsT)9;7MaG zg`3$J$Z1%dcVvXdwlw5FW{p9 z@~Dg9f7P~s)+-n+4GBf~NYOoU__Q(}mVjQ-Msdq*ns8d>JiVs(NP~R_D}`bakHue< z6lvFd1u3SayxhHb8AI@jtk5fqtEJP#fKH~=K3*+|F5mFSJA^@V?L`fF5j*O4TEUHK zZBY$nc}}a{1eVj)@@_TG+mnxYoePf25$%J7V#=OYfj11xLYxnJYA7Uob-B0DoVm^0 zDq*zL78cnnPvv;BgO?VJ+Yc_IC>+j0j4`qltDq1L;CDOvIBB#NdQ0%nccK314z0a5 zt*kWv?2MM5>7mb4`>b*&b)5dkkB(&ZK(a8tzBrEL$r>+G7?3R0h|yvclaL5LQfTX+ z_+6K;W;cWT)u$j<164Mq0y)4e@hO3hn|+Yjj*NdMyzT5tl8Q z2E;NbBjZ^psh~hz3JI@s3ss5-`Ss=Phu&G4=NSJ{JPq-=kW!OMpW0sGbjUzE7t;TV z6*ej|VH2B{aDjNbpA!G^v+objt`7TF6tiWb;(6^B;UU&D@v{|(VnKV+;~NT=A95wu zq%70b>)f0I^LN~YTS-#!GA=p?6u;h8g+j81ldz6c$Q`9E?sIK zuf{J;Y%yB!10=X|ik?S2*ieh|Mv)MRn9!*dG=>pzen~db*M}xR$tjEaO~E3d*7($2F({r3_)u$DA*N6_W@oRCB+-ikJr4;)?)fijWoO5{8 zpZ9x12RtAMG_;IqLMOm1`{-%^OrfdVu=_on`)FJNy=*3(f1O0g1diO1@|_&{vn)h% zBg?B4@0(9e+T^I25+DZf!pU1Gn{@2#>=cNKii!}?&{{t|6|=oKGRyro4U!F)^=fzA zb5_p3D44fF$}^Uh zmU|$1&Vwv7c=>HcM=_DtYLbm+jS|9*o8KISISVSde3~#q?&#V;dg+Xmqh9;B@2J{fr>v4(fO~7KojkAL|Cvg+0K?=6Tbhb?Z~k{h)F?= z_)I#)+TR^tjN~cnTUjyqSA(QVS$IDhG#z0QQ6M*{TN2>MOIi(5f04O^37>u_>+o0HY_dHv#DO$WZPJ#-aIKKbgp-8r849(B#i-+E142IWSvl*q*UB*PkYm zX%}K8_jYUi$1h5Rt<&h4%s=+hz{E@|e*Rtaa-Uf}_>Z5jX{4t5_qIq_f@=Iu?MK(x7}%6rpO6rg)!rmJtMqT6 z^}f13o%?P~-@nc5sFIo;k(B-CmEs?Qka&qEwxQYg*12U@#Gebi^(02Ton&S23m6PTnuxAM9MRj%N=J;cy zj~38^Cf$l1rVg^UVX|j<(w`TBdRu=57|rAHjQIatkt*W*4vz<$4GbSI$BMM&GbL~X zF*T&5P=Wcv_}x!l3m(czgL{qCx^Vnyqn^uw$DleIaMSl7gZWQgR^{*dq3;)}39eX5 z_6|?}*VBFB809cUOb`;acE9)a$IVJ3@&4Vw0}-FJ@+&!$1O!lO%HcSTwx0ia5_ES` z+d&R~2ot+$M>@g&XW>G=^zeh=PoUv693>^Chqb|U6^xkdAGdh#b0!rFC-lD01-!UA z;vR-UTci;KP#{Ah1;D|qf%N5M`5V$8o)Bnmno`nBu&Q-wM z`Xy?q^7H2c1qB6q@V6T{@0q%4 z`Vl<Z8q#7LcHj*Ni(5u6~n{ixin_ZX1Qk3027!#(0n`eBO1I7 z8cJ+zY({Ks{ImG@xEAnlKpf01B}J!ATt?J(|2QzyZCp&8x8>~)7R_6V#NJVQnN?7}$F9|73gh!&gJVhBI9+;|_#zCHc zqpFQ&9wrqaKxWt`Cchw{8DNJ|Qz=kmPIEinCD|TU&Zo zR%j?FD6#Ru2-z-jLRD}8K6=i{32n`-iHt4oGm-5Sg3h<4we<-l<$WwHENEv@ZqkSO z@Zmd91>5e!!*}@k`JuqRu7E&JFfcF#ljGyvU>mt%&bS`uR-52R6M_X(1fZd z3Mc4lMQec^c>;EJhbGrd8di;$Yl3nTzqAVCR01i%OK~k^(39^VUd3ZsXDtpwGQ@c0 z7-E})L%jzFb{;duDKc{TwZ!XJ23ijn4X`nZaAR;t@JR4+u`H0tdb@|0Jrurr*w7A! zhimfeeG))VygeRiSJzMZjDm>sq5Gz`8PLE) zuJ=KVkNf%Np0pHmo?VHi^rq+wVza$$g zh>7$A6(to_dv>OQL$FqT5G)(Jyek2SUSE%gAKw{MQhL(U8#OB`D0J0)ag<@)*s%Pi zG!4sfGI~Bt#~}%BM|KN8E86~K@gi)*^Ow#G%x&3$fIYOY?aQ@1r)Wn(j$B~5f8m)ZzYy2^Z3w<(XuVha*6 zzZ;v=uihkP11B~IheQ5PpFR=660;M+qkjPbD+G(ZmsIUq{VnrbOm2{P++dW%_!oNJ z;o;c{h)>wNyIv@j*LQ7Cjqmc8@O8*68LiOe%{5rF11KYT=YLf>o*-8O#jGYMm3Yi9u(otvaz zWjF4J?(?9MouZa_{wWuFiEvRyEECV^=;$z1RaFo5n*+E{)&}lH(JHgZpoLHB!MBu+ z8yg#AE`aW=U)2{(vrAx*XaOS)xrngv=cT13)vlETCzzdeiv1K`kaL2O`!icN8|$p)R&-gi^Pd95quaAZ~$|? zc)m)ZL}gjo_eXemkVlQWZBH9NL1Vw4)E5_9OSn~XBr4_M;hCE1ZU{5zW)A_8mz{HQOnd{$e7u$qoDSOL9`4813R!_f{I)!yDd zetmIK0eD*w`s2rs+j1M_iE2T?x-ZyzpTBV=U)AvEXA1eWv@|9#9j)HOoU%Cp&j9ye zK)G71EX-7YqNvOJU{gVvP|4Pjb~SYcPaWE)`RpT!)`klAk39IqEN>^P_)vjgjA`3_ z@(hQ|0J@v!RD0!PZ2{5I(SjNpno7BosqYNsRexP=qH1PAla(G^v2YWX%khgh23iVo z1_p~~rIHV{2SzXnc!r|brv6TcZ8XnQZ5Nsj!Qigu0>-)UnVPqpG6><5rtqLciO=O& z^WB-L!3SV!1S&c@fcK6!<6t<5j(oVe?$$wFV&4fddj4ZAekZCxLY4MY1i$_e)S*H} z=6_!Qs&?4-;v3xS%JKK4deol7Epc}dU5UXUo{b`QWY7qqas{!msGu;!J55OoNn>%$LNS88_|rp$%BFgLB7YhE1pr;$VD=^f;FP%s9C4{U z=zxvC3|W`>%{F)o8uum=oFAbLIU4HY ze;8y>P%fo=W0hOirWSV>D$ji1SBp+_T~8zNA$tVy{_<=2`IIjPT`j35Ur8_o%o#l{ z2vA@By<{JI-+h)i%k?ibif@2F{Q4y|OYw>Z01sJNS(vxWFJMKmW4RrSC!73HR_wn` zqclbYa0rBdfO<0{ya$!_erXwmShLs)&0P%NU7PJE$K9RDhH>-P9| zN9>s012OtFelm!4KHEcsV-(CUk{3xc;ge7hZpOlnzB11ef)MA;K0pUhhZ+$Q`mfxMj z!^2~*6<-&Sgqrmp++fZRa6Mf8(IrWb+Uf@v@U+Bb-#{uwK)b+=gRqgXnSek{7?@Lt z7cSpqYkXH}IPK-Nb7ggHoO7T$6hIP6MkpewAtBkP-3a~gcDKltvF&alp;CI=V-_fx z&!&>;HQK(ZB;kz|gjt>uGeTdm4!_!U)p|O=eW9wS+fWlDg_ZAxB8lYYWHhuHd;$XQ@x50aSaVv~Yw=kaPl@Je!&+VYS3#n8F zUkj?8mREcce690wkoW2_Am59^(%4c~@#~fe?-Q~Us#ZL2Vcyt`)v0&$P4T*h&F)QZ zJdEknV`LR8HE7+}&p&x|ol6xAkNNG(zqJ5dH5qTOPkS2lA*Z319}d>%vCiB!wAP88 z`cjzfI9{QXM&>5<@NyVTaz^%7`|@%WO;TQym>U?7(~i-_Sb0C5M)vKNip~{8KS8gy z-J-R$yt!N&nLx>A?oVf`HDPK=truY#;d5JjK5DJyH+56>@k?UhAcgioodZVbBM!n* z71utoWIlH|3oqRu%^Oav6wF)Q>$G&1WBG;L?q6e-bn|s@iUw~&eoR+ye~7qrif*gC z8DlUVDL8hw?p*Ea?nagIPm(XT_6$9Dq@Ugx_TK$IeUalX_{Q=%=k>tY9J|PR%x&g; zh6#qwS;9|)1an#!0ClHLlMp}n6aD>3Ldu~3p8)`v-8Dd1tQ^PaHNX1YAP3_1MANIo zebZt@=oZD4ri|1FrBJOz&-cbTkw4w%K70T=$;E1;@4Y7r3kxYQh{HnS(RbPJIh=u{ z^shy9?dqnuA5yua_gP#a_>k?%f{J?OCv;yJ6wyg5x2gI0y3c&1`KC8Uv!8x9SI{Tl*#8Vfm&%{9geKy*bQsL0OQ zmA+|Rv_?%_cm7PSBbKVzhp|t46otc*ubd7U_U#&DeDS`d#iX8J6TNZgR`3Iju*eQt zLaIs_j|4BBu>SUxO?v}=WC9L5lhvHp4rzQZ!);<*vrk1TOw7%L ze_RJ-HgL>XL?3Ci-2|r0Sv}3~pJ1}^YI|pN_(VXq%Iy3JF$uBVcAGN%42I~vs(|qd zH(o&hWt_AWsy84z;P(b(W>RQWnW9jMQRUv$&65r1Pr(qWTKR_^Pl-{xA|*+uuo8&L z62ExTC7h#}Uo_Zv9emL7^7L^FC*hQ*KoksvLm71)@? z$U73-4x0C;MSA_Cd>-HHu|VC7^7rQUai9d@<`O57=L264O$v|8+D`UJ4u^WoeTN`5s| zGT9tk(k9@&QGO2@dwtarPLLJzBL=iT14GBy8-^0Mwv&4= zwL>aaqvO9fNaExh2KCu4mTR>wS)|0NRhgj~OUK=dc=9x}stkpnX0wj67k{DX7HtEa zmq_!f)KyRdk138qN&1xbV_e)q+c%iZU(^>*n=EW*Ykz!u8Z*?umPYS*vN!j^bgm9} zYkPaYJMZnB0x@pvxBnx<=RX77txMO~MVTBs|fl;;+4Ql&|Ty)$Qn4*FkXQ|C2hNKla6f zHmcjx--fi8G+t`Yaa7`|KlI8#Si$EX7?*k=^tR5L$YvhFSt z)fKtGt^W-D){}auxwJN**Li#5NntP+rpp7d8@?xnsL}f!jEwCNDJc~{h8>+T${GB64-*Q zW009Q=P@Qpmt@4(^t8!tvlmUNSmR!6FkZ~;;2YD|1RXWUt@tqCPd7uy$JMr`_p*;D ze72yxL6&qZO`*=ob|S^voJFdVg8G`}PmH<6_NXrA{lnZxg0zSDYcD@qG>%knY)imw6yDKt41q*oD>mKRIjwx=(s`jPcd5j+$Jwma zu(W6ON`212wjnKUvfJA0WxtH2k-3E-N<;b0pi|z3>A{WsD5=w`&)Bl`{9sywe6jAU zYXNilIljW@Kl;^YSAA9g4(f(ju^NC3T7Q5}T;ky1z#7f$kccBEPPSxjqO~GL!INw$ z1n1@DwKkY3*$ui$PZ$piA(17yyCzAaam+%|vvJwH-1>N7?Z8 zGMI1b5xhM%k0PJc=1e+Mw2L=WsVU%I9k)s8b?RaA$8Lj3@h*ie_j9?*P?ExKEa?L< zj)bPH8RYUrX^5wta9Ae1=`M2#c@!&k=Id(K_QW;KGC5kCSq-aIxn9j6^P#&1H0ERM zgzc>#I``54mR0&dhcgp^7Z$pn-nXT0dj8gH=Al7l4pUZWbMig!*P6xN32$n$8=5c7-}8l|WTjq_(iLmK?dR>1Lc*On_}-xV*D&PI;`3S>c4me+T+k z%%@40zRYtj}6^{Y2V>E(`o(AFeVXKW9;XQFR&>Ks+SC2aCEAgrxhT-UJYLOHg^ zmLto9oh143($I%O5R4;k22mUXZ8@_1nG9mCazdJLV=~i0XlOxd?B@D&NR#G%PS9Zv z=b7&aE98Mvk!qU8MBdeBe}V13k`=!Li?=k11L)KvOZR)$rW7neo##zSlZ zv-^_gSI=u~9c{l%7Ecv?$5B%xHb8(_ZQgX0+H}gusR-5xBYT&wxF6GwuqF{=;*j|_ z&7vjIK=!(;HKvk$rq%{8pVFvN!f6LTtvRoxeS=WEANfSUh7MiXlg;&(dNV>JvM~gJ zZPa@NJKEm1W6d?Pt3<3ZBLqBM6gaYfnY%VhG8L|T`Si9}z-;qQPW{@22N&aYlw;?Z zt?Bo@3JQw-g|cF16hVgWvYDs4GyUq;o99J0SSSsLKgJY)Ee`#7dgNd*LFb40T0*LA ze;a>s=<|Tx(O`Wxnt>cKJhXRUM^KTPT-2`kGIVx-+v0F4+MLk*uq<#4i|gw2#Z`#` zL2{i-fWJd@s&28bLS+2(WBG|kECHWadyZacX(d+B#;7S<{R-fJ&e?a<_d4%=Z%eSX zrn7a^a50rZb6(+dc4pu49Tr2={Ok5YJ0>nf{G0lK&#iO!pS4DB+S%EBOiT>ju9>sG z%(Y&VQor6>RT0-=xfqG2}xT6dPP9x(osl%!6I)sgp+z)4G zE(H@M$Sa*++I4Hfnm z+VzL@Q>yF1dnSuo(m(@JC(Hj~z9p^!+J4&RYcr{)vD(e_@N)L2d*fG_&)(luvHTK{ z1{76Q$12zL4-fG@{nQm#8x1=;q#T1s7-x@h7TB;9mR`UrBP36Ihx^cBT#31y7UgbK z@}+=!3)DPUTa~40-BQjFC!4n+!lTgvEcAZF?fLyNgOE_hm%)o$3zCD6M$piVrXMr& z(!ac3@Z%e-dPjWTn$6|0m0H2SoVb2iUa7+F82#nTdt*{|VgCc%{mftRMkgELLnmmloDQ%7N2JlY(Rl*#)!t>B5if4Y@lszNORq2dD;tu2hGozMFQ zU~shCq3@KTDRjBGF&HU943}|d&nlAfcy?#1$q$Ye`Aub=asRcDXD*%S*uate@xZaOe-{sX)HjhFBrL{OY5@K)}@FI*eji9 zG}E*uFl_aH>DMBABAh~wGoo5>^cjGlDR}!iZdh+3CoU1>CLDLJ@H51|Qxa&Rx^rji z{oJ2hFPdgzFq2+khq7fDU=tHrpVR&$OlWYUyhfIG2N-qIrv$+i!ZrzG__ZI#8G7oDn-W z+S}SvEmFeIehoAq^#!Vr$gw+8Zd{eEnwYV(mo`m=ep3WWa~#da5GJZXCYm>VY*;*s z9kZ^*aJHlgBfj!R}+X-)N8gV@RVMr*cJ0ibvCVbpc6NTACLT#C9uyRm0&_-JeC%>Jk$GaPaXY!I zrAL_a^5Q!5R~3~CB8ZaZ_s6Z>O#7EVd5lam_3B`~oXT{vKCOawB1IGZ4fkYk-DLCa z4hg(gJqA%i)en1UxBA^+sxvOK;l-&8X}Ua7m6m@m7|#c?EKq<}eetZGHMVMv$ZRTo z3g1u9#)PSoM%aM->iE~{wQatlt{X!>rl!nsi<9&eyHMPqQRefcAo0-%UQxtCt1-YC z;eMQZ;JIzw(nYN$U{B{UT;&Fm%ZzY=EXY_NkuUez^}@VuIIW z5bp;a2ceGN&=A9#^(wvR-+)Jwbn;hHALnQ{}#92>n zmWyMeK9Dgie_F8ueo!U&*IyQ`89&F|%*@paaGRrm)*YEJy$*i>Ml#JDxqMWC9QFIF z(JV=oJpp$;zR))zz;$En^0oO*MGRCMT2)sTCY$74U!JA|1(O|ckVPa1y=0WKyVSyu z1xQgRVLR3A;?1i3V-DqJKR9zl=sblnq~T;8aCXK;JoT24A|yu2=0!5Om|t||r`XuQ zaxumq6YJOXp)NU;5Y>ltM8tF6l-H95!Y1~vEIh}SOoeU`izOY$jR{6jBII5Adc}QZC9^o=+BIq?;kz>lF27xVm|$)Ry4P<(y%IB_q}NM zzSf`(K@jx49z{0ht@GX#PL*k>m$D*YTw`*1uhR#(qenyREC(_u@|1IZ*)kS%Y(G{s z6-rSyYs{go`?9?>&5^%u%Tcd`48BlPQ`4J#A2;Z}kz8!a+bejo)1o@mmhLt}c;;{j ztEQnL>=Ayfb2SI~MFc5|gnS|$H+k(gXDod~>1pBm(i>7Zg>V`mJ=CXumK1T6iDU<~ zOZShjcP~WRZ{GcS|4AVX^h#;5l6HLP=lC&2I-vSTGIejVgGidNG8_k!7$XyV%Zc3^%s3TW+F|PnBaRh=&L| zUZlqRsGV;m&k4Sc%1$-v3!qlWD=|ly<#q@9f>=%)9X%Hpmr6d|#a3uCJ9;ftV81$B z8eX1`!fN8i#(+>nHvyD;dH{>@MH&(myW}7#xyW{kYpZfOuNpj&SghN{yMn2?)m4^C zdczum`HX1H`<|hQK=3tMp7-(eYN|9zdujiB9YIXd<^s&+d>ib)wbuv@f_BS z2u%kMdAf3w$MeK31>@;u+olNw*2Wx!F8st>g?49A8pmc?Gd_g;3;DyXzVss*CB0*x z_#7kilh*sblu&^hgAOID9`7g(>l0Lc9)pDhOG9yl1}ioH5Y^tL)-L=(6LKsMbFDcN z1G=NUsN2g;{FkQGHIxN~1$L(!_ttTo`c(1q9v-)x#1K^##t1|N_hl|hVn=NnrC4BT z`gL~CdWrMr_p6(Z)3IIVd{Ww-0l0>Y2l~za*h=;4TLgfwQmfbE#DC*#pZ99cz|_*g zD4nTOo7g(23<(Shd$ImGbD&TWBa~2p($jw-^tw-aP0C|kqyY2n&A9RxY87EKd|g0p zP;L{Z0?d=EdQ%MoX12Vzabs3mo`;tZ(sydGvUba(Vv(mJ&euOTJ@zhYQ34rOp6a}m z-UD=@m31EToi6h)lY^=SWpYHo2`$0%JMf=*xF+WD{Bn3#&O`-ErwT)62<626JH&7K z#k~By;xxB6Mxi^WaAh0rfgI8!9>=u=pqbtY4-F+w%oeVVh1T-Nh=C7mds~Sc9Co+b zJlT)+1d#3V!KsrVhA(btH;+`Wi}Y3w*w@C394>5IJKv;)k2;O@R$7mJ!HOR5J1BxRBjhTJ1wX)C`^^FLs#oO1-qhg1^iWBZ3~D zV_E^dpfc!4^;^|S}3R2N}5si;2Kffp(_27zWr2K zd%P>ReTXRnq{~@;AcwyS`t=t9Z^k<-P{@>!+?}b(j(lJggFY*~7bcc7Q$R}`T&t}S z|C@VRYYBep;vb5Sk9x(i`&#cz1@) zbSht!vh3QJZgiQ2XvbL&TiZY}QQUm#0;R)Y}k7pJ@A zJd_&9sUx{70kC!V)0{#eyJ!MX$-8f=)!1sF3rU*7niShn-L8Vi>EXlN9)PKqk;EF^svFRFYYf6nVT0D*19w+e+$Z_ z%(=hQQ2>LSI%VW}3ctI`XtkYTVZ_mJFCFHT`KXmT$!fGsOzY}zCLBSGj9WgODEnT9 z6^G`rd5&{C=&|3g_9S!xhI+hxK6%pL0pn<2OLmc zD48I9xD_{kec2=DYDGQFH-$lTh4B7Im z1H6u>?O=1w+k`|7qcwV}C-r|tiKuFgt*tB5fZC0hiDwhvOvmvp55$+xnTytiALZd7 zg7)~SM!pv9yN$WkBFXPez?r``aGs^_LqGt>kp0`=3K10mF;74Ww2lXLm8|xBb5#iS zamX?kz0?TFUf~|wOpB7@GWkl4qZe;BR2NA%11F79U1VN zsf~z%Q56`)f=OQzKP$LS5Bf%wZF1etr8P>?@k;y)CM*;TOnGd;CfvHM(Sx+9pehzE^z=|ok-!+C5WP{_K!&}ZEIaPf)Yu!Sbc2%)N6z8%m609hTiI%7-- z+!J%$g_qC=9sth2(9Fotsn%+a^5ndq?_cU;eoU_VZDGf&gfqyrfg%Q_pEme%1v!)g zf~itr&%>oz$%wk3|82+%I?NL`IIrxhT{oB0++=Mgz>Upuzv;Vc)}SxuGYX%WnCKiv zz`7cFe)!Ac_)u?rXl#6c<_X*GEDZX~tqP9Ecu<*-kna^%Aacl$i8|GR%lvR?Mb=2V z(_jEP-C0aj^hhZmh6#EG;v)teT`h+!gJ$6{CwsgSr2E6_#IxVt>g#js?;aGfBXDip zJqSCu@#5_`0@RNPaX&&v**H0>=^&e}A@~}yzSsNBSk+&gUrpp?hDye!kHj|qET<}2J&mef@x}&_ zC$;tHV?}L7b&YQSD8%gOely4&e8V-)JKt2AA4lJ-!xiTH*fT1ev+8oWw8o8fUdB;t z`AWM|mY0s>vV?-i*jwK&lD#(2h3>hjFrYii#rDe>yTCN5xas|& zAn2y-cQrNDnV+0{YoNo2oHYNT|k+k#l zt_#d#1Oc(SQFb=<=*rO7djEo6=@}RXzQ5Gu;^tYH49l;^Cw}kdM5MQrS6EUC`6LRO zrvw2Lmhfb*cf!&Ba@i`{R~5@Kr(bZ76TVdm)$tr>oGvXcVP4G(^lEXTDPk)YTpK;r z;INAF+Wr^$tgqaGY^C9aDE2@s_x8oKjzt6lu{*3TKVcuMOLSTn}Nc>(Z6DMw-xc@*=b98)8s<(5`Jcm@tA zf5*kcQxOxnbF|rdyGrY%8C-UF>_veXe#r8yP*5{B{sC7Dp8iWu9{R8 zc5u$j02*BYQIwsluQG2Ap3$OH|y2D$2-!Wp^?{dQx!|xvMtq<|%mjVrGze(I3 z1`Zv{ecdaCcCz`!Uzj~gklvGui*jrz%4QB}4b>sPF*dHY zV-#Ay48HM@tA_(8&HNn17@McBwnc1=fUy3gJ$CnHIR9I?Qh7VB@=KQcGP~%SV#hZ% zy5MMBM*^o!I6?{c+rk5S=nJ1eEjh>!tEAs5=!0xewFr2-HL5^!x15kJe7H>wW)cqe zn8)y2KkH4&l<_;C3z}*n5ky>5QqHvAQ}_YYVh(r2ZyT6D`ymWi^*sN2$VM(&?fg%fxuSMTkAck z*EzawXq*qy5~b01Ek@b440Y`OQf++4vy$|qU1MSs#3Jy3Q(tKCCcuB{jt!~t>tFe#uE9tp1dYV7pH{OQ3`lGT^8O-NrK5X ziEuB*9yc|05*NC$E1~G!-dsOodD9_StlO}9>zYH+5dxe|8>wJ#lC4CI0Dtac+nm`k zi_Y=xETfR@o!;vDz%J)kZ00@Abu;`42B;-yQLdi58k$Ke9=ek}sH#vnH_-X*eD^7A zO`F%xT85W9?_~NDjX;^1v%aeLr(g&{;QRn;Af@%NNq?e-l z8h!D#yemv?BQ?Tj?3FY3Dc7TfX@V0Oh&chYnjV10bqUt;-&HB~9$@q}J!os95>#@n zxk)P8DDU1$C?hOC*>PCD1TgI)U=ML2+^p{r%;X=RvoeQ^eZahPhzwm~?jMnpC z=-EfXJG?N|1((0WLHzb!r(0vc`b{^=U6=mbkUaRd_V&nHHO^L1J2U0eZrV>hzn9$J z|Jpp4sv)vM$7Pm*g~#mT%b}gHv>=FKd;Xp@7?&Y=$pts9WJ~5Kxen9s0$p5?0?Zv1 zYir^9_XL|chgQLFZBTCZQa@x3-{Fp{&&+nw21XEg^4RwUY;5_S#o0`4K&C*~z~+*G z0*UhFt#yL~FdW1hUq`IIZHD7M8qnAzW=Bv_n9LSLqusZE#zX(3Vi9&hi@_zvE1h*UB4*9x!3quHV37 z?9NVVE9j(PjdKEAaUMFiK4E6D2!u;JYS#|yH(%?c}`e2yHh63da#7yTqB zzIWe0kO!kJE4&WcESvp{xfh+^f#^X%20h`f6}zhw-yc#dWOM`}px{-U?CtfNM`GA~ zXxu&1X0z1Q%-=4lUO=h1t!Cdrc(BkkHzrr+((C;rbK@i)oR2Xbt$*?`@^c0QAM0b! zfEx@N8k)iA1eWqD%@*1XP6r!bH>Zs!0s@aMI0}Tnv8?Qm6{VLzI*H4aMsI<9fsAnn z4QPZ*L6tD2bzGe-p@9GzE>~B!B|uqI-`oJMl;5oFqqfea;n`bau^e$$k)45 zcVNH#uD&)c?1XW?kw(u2ETCGa?xQ#J03Dw4y80)Sf&3T4-@eB@V(6#Qmr2o4= z3Lz^&N=v^H5D{sA8)a>$pcfvOqkqeA2rLNzckeb3v2@*Jgy!`5S^awtCQ0u#%y99cfx_<*+;S#bK{T$k z-3fj%4HA%P<=zAH<;%PI5|#n!ip6y^0ppUr5>j%tTOJr4-#J!x+cMiW6Dt`g8}uTm zX+^%J=-F0bqP~$n3hPkS4-cSuDHM{(Biy5y|cMw|SbQvp-dOkZXS*h(vu!#zT&W zk1^}Q)|CC0+sM#hty|7GehFHJe`iVcJ2eQH@?1SnXWrsXzIv!>!LhA@p#st9t1@$^ zE=cKv%Lhu-^N@Pq_K%-p*^PSL>(+10Y@Sh3>37-iX70rSLzn8Lm)!R207jSrKsKx+ z7$_Lc1?NNkrJg1QS6*R9$z>O%rOc*db-3i|=Wva-v_zN&i(OnPwprAS;2w{FRh@vDve;?G_e>)Dz1-#px4i3DoE z$)ZQTjln^h%OoEv*jU+F**gY;qk4)&iQi2>LyD3Ze)+Qr7u7zISm_3Z&;1(aG-b|* zz6TC1iN}7W{3_+)i4dCa@E0Xw4R0Q!?$0+;OL+_JlE66EIBMKRnr}9B!bp(SH8)Hi zOwiqB(Ed0fVJ&i*omw2AS?req5pd^Uy7la?i zQeJ{)$-I&Tj}zS&(AuUGxk$@De~y-N;lFSf;4Qp5v04j@4G$!`Okm zmo7xcok71?Ik;jr8^gUn$CD(H(eYuN|?Z8+QyOa1;R;2RH!iI^yjPt=Qw)_4juB{+{h&i*+t0AR&Kie#U2NmS@ zzpJtL_4xecz=>g99Dw>9FIrg)`Bsdo(_Il zvZlT$+;d)k2{GX2+QN%84VoA}_07%A!**mA(JgmkthXnApI$2#Sd=kZ5tO!kGx0Op z4pi|EL7lF;e%c-y*U~@ZTjR0zaC5XUwBM=Y+Y)1&acQ~*|sQZ4d4|LE! zGq^}%@s5YVgS^o>S%meLAD;`c>)y-ZQCcwSvZNH#NA#&))|e{^_pz4UtSMYIP9(KZtm`2pgIoiE1<@G zmb+mLp?evihXNARul-h;3g3R;XEgG=c)T1GmNzU6IQz%ZM*ly=7YovD}Va9{KenJCR1QY z0==XqnKVPE~$L@_nDbF)?nI|ICvzfg8eiAFbZ$YR~>X{Y-xYq+{D;@v|*QNrQD{DjK_ zLuP{pd|_eXtrss|1ivjvD}-wkUy>k*qo;&CgV{=@NR-q6GSZdVn%7bZPMN?Dcxf$0 z345?3NfJD+chHBjIujYxH3%i|r|tw&3ls$L>xN$FU+w*q2W3|cy@Sxp;)dwIY8`OI z>y7@OKPzUYrKO2y$;DO7O$agEN^N|i`mNd{yJb`QCzHS#vG+;hM@~1YKk+ea_CmbUT3Z4pOh*Zo{Pab6k4WSQxa5iCyk)eN>heQXd`s z5vdX4uvP@y2OAcOJ0z6lzN)Bt7^nRSaT86@-35(BjP#rMfzc-3LLAQEH}J{$f10a- z#8wFjednlHX>bw+9*^z=L3f`&O@jD8#3&t9I9U;NwiSVdP^E65E_-FXZ#HCH=$Dc0 zh3l2bUo5~k4T#+#j>)qwm}&icaWsLzT64fvcK@cwoR<1`1LENW^bPV^k3M*cNk1qNcUeW!P)i4nX`5S^2tNOQi7LCUL~$KPu#xK&gdpugXXH zClJ76Xk^Tvej1qPqizG{YboWtUA{4-wv)^uFM4C#Lo&;S*h2xoiynP{`T8xm%|t#7 zgyM(^2N1V1$f-3{}95Pfji@ zH|x|?n0?2bwn_cFW9lz-{RZ!;9|4=W?46+7=b3$+Ey^lRkY`E|*_Z0y_+yezK z>KKv6z(zEfU!3!6D;CaRL(4+a)=;*EAFmG1gtvocrvF3uBn>iZd60>ClE0x%bK@`; z4yg~mDxElBzs1B-TRd)srhN4;Mq=zQRO!oSq@NlWx7_NfdmF!l9|?@%At#jh(ccLP zPFL2;HNa@Gs{>P*Oqd4-jw}Iy0FC_fd;D1cY%$2cP-a4u-z@JD7eQehfXMKM7GuFy zI#o2xgZFKMrOKPNcO*R40lE^uukYo&ylZ4oq-Z;kHa1zFW3x`!_YDK1g02+5lQa2nu%Y6BN7 zLDUSuWQ`rDN7O@tEh?G}ATHq8?A?({RIb`;tZ;~Ur2kbW1EtDUm{g|B0^=Wg?=!_c%d{6Ni= zWIDCF^>M<&K4Tko}-#$n+)F2}ZxMxx9!93QS2=)!)MIIT*)#3h$n zhf@2A{Di~tW|V>pEUnI8L!?lwrRZK}c6PdP+^2Kv?Hr4VEdA6~(FD9sYKcX?-v-Cd zHzKF7`+eC~H*F&59bt1B*jz(aC@LAD1R0^3Ghp3(1Bcj#}QdCyOr633fF`A;Fyra(W3VMN|T z<>f=r;@gvx?a#Qgm8ul$Pfq5|kw!eF`o7ag5v!o{K8t%NRDU8vg@455oYw=34B=l7 z)-?a>>a%7*_mGd`veG;vt=dPGgW$efGNF8lNclS*sgNq=SB=B{2aj;v53etre6%r{ z36+^ckz{_0AQm5D+5Q-d%GGMPkM;A+{&Ih=$%9DoEqD9T@3noa-QYsLvc;bZ*pp?x zX!H}gVWexy9ECshHWZeNJ$+Bo%?2}FmT1$i)DPQfp7p%>k^Dis)P?U5ua9)$xgx)O zEG=dg$;>Ctjp5v_Az8@UKx${6NzT{_)e-K}@Ex*2WL%=gXvyaXwVEWa z)8{|>2C-$tz^aPpKN*mCzA(uS+qc<#|5H}5)bfNHDFwB)OZLT3%lyQK2{X1g9^pHe zPCu#8WChp!Q2*KkO1hL}ibmMA5lGXd5Qt1>N#boko(&zTZl&T}%9e$Y;$7ftvFNv-F3m&=N;(l1P=LSVq+m)K1z0OpMk^6PF+D}xGJAqYw+mw}hreHkL%$)d>r!MK1m;G6h z)8p!M4`CU^Q?i#Eea~b09->D23!&EZc(`?+9OP6 z)zHw;SV)m_@_d+xgBteo>iN#lH;5OPsp*D-oK02X{3C>v`}_Ta!kF&*P4+rB26FE= zv%u{opE>K58Vj2hxYYxPK!K3zrq7nIhm9&h+2X|Q7RU#`WyM3!qVJ)CyB7ZNzeTM$ zIy*~iuoz0uJk@*jKU)l43YXRRHhkt_Gva>eQAsifB?6Yc3!*nFWFAG{yrgbr>&IxA z>8c#0(#I-eAaYIxH;z+B)t%;sg&_#VHtvy@RQ>MGV3jtgf zQ0FSke(J)xS~>kat{S}8Rdzfs9TPT-`{UpkZpN_ zXtJG0(~YqGfeaOSmBy1dg`-mr`4OmtjeZv5T;*^gwJlJMC+_+9N5C&+4L+DIkL@?j zscC#6GaT`7vo_;il`ANsU)a(Ta-W4#q}&Laac766yweGVqpV~E`1Yz) zOfw3WSZNa^Omg-6dg@5K+Kr@XXB;rn)l7LU%X45I%WP__PDAMGxvB`DH6eAdO+`_t zT=spXJB@}rR>>iSr7f8PJz0Vg7`sC#xPCQ+@cV!%T@M3Qf(m{geE8qo2Qbu3#iY|g z(65mPh4-&whHuX1TC>DqaJP`0>d%!`&ZJxQ6)4h!Nd?_sb!_16zQZmA&-{YM+)FM0 zy4qG>Fv+=3Ddp22TOsBtnV0y?&ZW|PfQQfFqVUI7psH0zL+_&5k45!7yjDN{B1RyC;16OFO-VlW(^O6S1eQr$lE3YEf z$NRuA9Q@aUB2@XE+P*qj&`9i);As;SPdV2*FAY z0?*EM@n4k-m*OJm6URic>G;1Vswr|_-EwXF!u8< zJL&u|165bmM5fI03y!s=s|9RUmt7pn134_CC-aYQo^-2HcG?xJ6%4$Phe$smmh`vt z?{OUm^h{s?rpf*fZT3%hbeFGaSx&9zt-73D53VK8)ekkWlDq6XY<7=5zOWi2W^r8E z8ilVu1lPJ&G_qC#%bo*KaIa3MrB<(+5_}J)Hrs=AI^greG5*u(p-{@lZ~p*;xQ9&# zQhyc48@VjoK$U&G%Y}*#kv0%3j&qYiHeXlOuyhWA-Mo)`uzO;~rY8uOwkmK`NQWBmA z-!V>$@gEfp-!qsq(5|r+jcu3b>!mZvF&_D**cHv>gtMXW+(NaSE}HTn5XB-RC+wXv zb{g%Cj8sKqfS1GN_y+C7a}m$NpY;JI4_~sU$j(&SRQIH79>zr1_#9P<^2bBHUla#vYwJ%yIryerl+w5CfBd^*{xrW4p&KUm??}X8Th+K4a2B zI@ED4(rb5gzgVOq^qoVQN8fqx4?|F~tp_pXZ9>6&+j(cnwYijxI2d>FR3Pv#xscCU zI6fzKq za;l`&{5^LMD$$Ji&!e6z!gTEfEC$|%kMu&qpzPBkk+@-92}ZatmtMHifaBinB4Pi^ zXZX{;3+dOJSH3^md_`A1CVUI|uuyqF-5Zz+rzjb4pi9}{uubOrJ22lv)s|>!Yg@9h zxBnj8fL;a3a5h(-CI+c5@JDHIe*~NlxlWlWIrtAX#c!pUN8IDbDH!>i0ZbEAIUmbf zzJ4XUK3|G(Kif?a&n!PbXp@W?9DG&Z2Fd2Af8q8C;Q|ZBX7u#n?PVarWT_?cb0PP@ zFepd5ZwAX?wiOYjQt~7#og#mzWqg5Ku~_Q02Rg;Xl_tk-r^ETysLr*p7XmlwTp>GD za>AS8YH_S!BL5n)e3-a7kmL3(SECBo_ST2toijINnplBQh;LdrG>$pwft8=uM0yNt z`6w<_%V>Y%eTEFgaR<2hFZ{Oj;UxUw)pm0fUd7hAuj>tVG6%Ly&+2S+kaonpmreg&h;{z!LwlTt2GpSW`N5BcYwcJkqYTjLKK!47BJysJ8bbvr{Z1$Vn&-(#Pi49 z>4ZRd0$4vwAT-b#HVM8R&Hc7o_T~rT_Eb3y_TSkIIdw@L^>eXU_*_rJ*X}+I&6Ihn&_nJ6nt&)Ezu6pdv z2_ZdvXbc#vn7la(P%QBJ;sJ;c_QCvlusT6pAL5}{Z!4XHAI7o(4~l_FPeGo*gIWPg zklj#NL*R6{^o)UJE;pKz3;W#)QY$8!F4Cu5amztYLoo*GPfhxxWLi`}M&*j*;S(;u zp^)aVRQT`QL8e6&@lbVc7{cTmJ`8PNKPQ7*Zw)0pWFXQ4SZdQx4=X-~CEsmt&ggJh z4h%C(`u=u|zAen_c>SBP6WIE&J>M+y&KZOrVJeT1+-x%$0k>UZYUL*bn=b}V_U1_` zd_vw(vwvy8$Nt86*vl5Rk)xQDeK}QWm4G#eMJe;Otf2djP#$7AocRNcebrcfL2w1; zI?1F7H(t&&>XiNVySpOwJzqfPLS90*1vHme?-ISK2MEvToJd&T+$%HdeaHv-Rp)}n z9**KnQ6;-IS(@?DZZ<=yDXoZ2s41}gq2#G3Vm2l?v=QC|=1we-K55^c66$Ai@Tr9p z^Qk_*0ONae*^f?bQL(8dK#WwWbGCHp@VU9#->W4?`PYEWKXZSZNTj z88_v$8b!2J&H2oI@2CX*gJItD;%CHo`u&XpXRivZZ7O!AarLj99fmacCqOIJwb-5a z%9=KX&nu8u{J2MF9<15{Bf0ZqaaJP){=#u&8{a=pzory*#ScoLcy!kLZw zmcmpK$}ZV$K*I0*5{!cxH8J!#iR;0Me)^I>B0ln`Kz}GC51z` zJkHjCWPIVefF$$z5|WeeMKUNeBRRkQJl$0J0!f@>{_(suF;?XG2TPP}xb%iI)3 zXh7Zc-cNcPZ5D5bnBR8{L8$5RomYwGoKS!?qP1`ZDyivh%f3Q$@%-ZXx1~wXW03<* z-(9=`eRP7O%M~k`#gz{fRH0wJ=54zSSvS*kqG(vx3w}(Nn?%rS?XB#5sK1+)j5F34 zv)MW;l7?Y8;Xg;+f7}vvUz*MI`YEU7FJ3V%zm!X~+sd02UE4_y_NRFx+2Qv3x(Nrt zAn_6(x7JzM+Iug>M3m=e5{b)aaA=2OIh@6|{r*#$7N@h*<|G|w!H8hTWNMSgqgK^K zzJq8mjgQ}dN)7U2-T7%I*2`V*+M!}AUG)MrCM7@G{bUjvZ`(80ERJe4K0JkgrIwVx zSK*o2#lzo+e=2AKIARe*s||V5e0?adUG%zA9YSFw>Xj;Dd^%d)J_ZI8N4*U^M=Cdi-9q%l z%7m{#BRGDYCq3=k{CZ}2>H7|2fZfr)E9tRfMNfzUH-ahm1p^i*D#Fe zTx{^cxrWt8@+D-34f#asl#{{|c5hJ<0xKDJJG(T6M-#*;vi*=V3 zY2-ha>QEq9m>ES5iE%d`*;GW~#}15&kxCC}E@}5;-A}e*UcQl3nHSFrtBuP_}6+*nsq5Gb=%m!N-Ehu__pg zN-h`Ode6%1bQ>(xKtp$gHt21Q7bPuVMje3MWps}&rQN55PZlE@k?d)Us_ZUaig$KG zf_>>hSg(A|wfL`=W0aphefkyFpqwhGf*2HQ zmN4I&KtuV$4osMj^>^8s=ISEgc8uvW61h2!!TP=&N-*uA3CoOzYLy|&Ux5uVgFq<} z_rQH;y7C+pW{=MvK6tS39z*!mnoZGiqo7Ih5A8s%s4)rdnDQzagW;S$jmw$uM(>T@ zdK@mR7`8@MnRGr;&r_AWdClNu$Cz?)b(I0+E1Pwu7`UYhtJDxr%V|8>FpioKUdlCh z%pHk9ughaPkQo-Gg8fG+)koVX6RF+HsYj_3)+bPAT%F?Abb_A5spPt4uX>+fmT4e6 zThBZrN>wP&ZOHx@&m}kUv-~$iyWEOv7@|;eiQ$9yNr{PnX)+*V(%ZcpYd90ikn;J; zfq0Xv&qHderZ}Rn+8f4S zDlN>zwru7r?(fdlz2_3pdg1$SAHubvz}~4}>;7OS+(zR@DUDUX+o%(Rw6lc`6F?Q^ zrK$@(>q414#rk!hZt5}Kw2!Y~c8rZvQA~X#m6E8T)>)U})O}X-$OCPeO$HLRbh3DX z1`7A~BgjB0k41zi^$35=7e#zF(Qa3YYDwGd4*65vF|4ttho?;A+XkVdma2Kh%XiqX zN3BA1{pM924ipwGhYdb?V-HN>8ad4bgMebQUTgpFT!@DX}aP zrePG%^q|Ytc-a|J%yfWxk6t# zLnWXiBlFR-o3dY<|LXQ?&jI*F+BB9A_=1ClDzNgW zb%N(QsXZ2^2N~!UP`{Vf<3;5`N~j~8;k>F^x@w%9e9th5&%>WrND{;sFKZ;H%yOWk zH@ZGQkXytG*aR7;`c&((Al;grWx093D%IS|G?3E7Qc|maF`axiBv%#{;!XvHf&E+g zWv6l*p32I~aR>@czYm(SQ+!qm8_jxgH7E=ynY+JGvqMdf;tHFFDRrTy1TlO)?(Avt zOuFgb7l-s-iQX6DR*nVE;ENaNRHBF&d=q6t2eICuEbVbnx;;KPSr>)a9J+=oWr~?rAeYyA20Iz*hPFO*i}{mpi*y$q=4ERP40Ego+uAQgilG+%upPS*#^8#j5% zoVlHb85M{`9*_9lp>|Nwtjw7Nhm(83wjYYJIC5rLTS(t2sicl&mIFZL&9Oh*Tg4Un zcu4@_X^dANh&P9-8mN`MJJ}sYt{>P|71LZIRQ&F_M!(#h*2%hkm06y3lwc&$j2TpG z0fnWZHNO?NgL!{zd zI(E%Ebf|XaJ#gvl+j^XTqX7Oy*r4K|_<`Z+__UMMPVyE*j@)T;R%R25bwFt-NQ7F0 z8c@AA_gi$INw3ih_Z#`Qb4HsN?j92TLCe&<&eaNXkUBJ-Fzj8h-)*vb-nXC_8B~j4 zbZ?MXR%}FE6u zrdy$7syj@KHWKv;IPGO=hVLw4V~^=lg|}Brb1$DT0)rBVHO(ZJOz)PogG!MEVpsD93zD`SU>UDkR5YFahb=GA}8eM zDagNQZ}2%Hhrc-nC1`?GE8-zw?L`dNCq37rRYj^s%OX&|gK1u&glk(R&G8D5YiTxt zn;KBbFC*g$uENU#p6mFeR*wM+jnXZ!sd!0RZFQ`MuSGrlc2XOIm>2oGLYz^ub?%xe{`gV zrr+$_*nq??&mZHMr0S~1kU*EkPMH+Y@HLv6<;Swwm+^|j#8O#EhnaW9p>T&zKiKY9 zg2YE)H=3(LU!Q2I7RhL<`bkm_qtb5P;O2F2OT2)atwyWNG%$fuux~F@KH-U~t$JCb z?3Le!0wa%+C6;c6KGp?6&fH5|_FC?HW%p1@_OO`KsP3`4dG1M)Y*iE$dZ9Cx1)SHP`rdG*f5r58p6EMh^My&{I{!GZFdNc^D>bU79&}aW58?*Hq)r;xAjx#!tB;?4A%ExS* zMHeZ)b~aRv!pcxZJoZuiSqn;)SN!E8%3lmJ%XONSIy2L#Y57#y%Uv$Y1o$g=-qKQ8 zZFrom(Ur5AZR7O47Q|j*NQj851I--;66Wdeuj1-Q6HU*j%S|x2NoI3}ANgVx%2~^u zR#F!c5$$4cFhWw3&llE0a1(eNsm=gp_xfmo zTC59{A_a<7(slLf^kOHe`bAg*xyeI!%HxkN5mIjV{|^a?!dieI_9a&D-7P}eik-ju z+=fdNp;8)Bq4e*`xE-12iMZ{m8l?s~+ui1HP!ruoPXO0aY7YN1Yvl`%A8=siBPH%H zd0LMEO2>qTkL)xfPzOu7sL5rs1XH$1w#;Q17<4ff+5qO77vv?AxCgHlOTE%tn!ySufzfO zy|R8=%`KnB(Y?+9^{K?I#c7C$zyKrKvdX@2+0JUGa8SJ{N!D4h26efa_>{**bRekV z8QWCrhHJXlqQ?}hqU3v}Z)dgnW1Or3ECoj`0oJLSk|g;urqC3gW6jabSyFMVcwp`< zTQf1$HM7XLE`piX`Hp8DhWu;>Y2F(qL+O&SuUYphm&p94&;Pt=!K))b@yk`Y^)~d{<&b6v4b&LjeywO=G1N)?h+(^&R zv{a{h!`idwNG^Y$6liJJ_4cYkx1t8(s;(gqRmw{$#=gsU*dXK z^wiXlZ*hI2{EAR|v)HgVEQSpdMP-#L+1>!g=s(;95sSKlHp zsTLrYQR_tb!ab7_{f^lwIXgZQ_wNt0pkwF z-OFwKpc5b2ZutFSc*?_M7h0de|I(C#b*c}Jo-Pw~4 zU)!oNE@Q=>S}5N`AWIhmI!pP7B0%xi0scon1FtC;hZwzWt!m%|2bCnh#{UqNqhK;@ zN@i(Q_@xc=A?>x|ck|{I;GqD3jxCNg2}|4xmkY5VN4Bk!haw$03q;(K0|Em}a%o0O zRto9XUhyIC&DLUrWLpXVrDRlFE1|g2D+;hSRZTTmd307GSUC`>dPZR?+pWYmAXk+F z77HwFjO<6hiw;oiaqdZ=^}V}sOBVKd9T%8TUVDJYylk-J1dNOQ7(h5`PBBMCrW!HS z5KBH0`A}K@nCP@=JPC@7SdZQWflLAjYj|-(_OT&I&_HFcY=#w{SK5$GK*Swhy$Sk# zRLt7!q>4mb5fn+5z18acy0z}l9{LI4XHZ83+NsTJTP8B3fEKjVOpwj`)NTQO=bZa* zWz$}$qCQVNOhO@Fvw?8)a!hjf+JiN7;%R{lBe8j} z9v(bZmJRSYTvHkNIob!Unbmo668Y1p$&?$;#Ed)Y-gWmN%V6@in%}?pm5(RX5H#MIW^`$cVL3;2Yuh864DUQ+1u^GkuFze$J68_u) z%Fr0<{F#*`hj@LouU^v^sDJ6mKWgHx$aQWT1)!(n#!>-IVta!0Lra zK@Uf+_+u)=x=3?9gCn0|s33!xkeM&xeFE_wQ}bS2<{lZ%1<*76!OJiWP|7j9mzk(6 zQ4?SVUx-<6d;rAe>PDgF%HyoHHgvyeyFgC%Ng6&I^rSiBu62(#rb@ccw^h=pw9i4!kb>Q8KaWz3xGZSnCq@&fX(3&%3E+Ef* z*&C|l#`~=Yvq^y4bQa!hpsBo}z!LRoMi6i$hEAx>er5I5S11c#AR!A;iklG5GLZf@P=fVW=^yNmf2$P8Lh7q_f@DmoMCd|hc?PxyKar1 zFy1;vT{?+b0p4b`q!PP}4S&thD<#fDLU4v16X1sl^5^!l`FIn%!RJ)*1l2Lp%HKSG ztp-^ez0T%&d};+2T8sFhhr-Pu`pVi0zMqnSKP= zYr52DLb)=m5II;n7()HZj8QUscp8M%D8R{x%Kz?r<9XtcChQX%2yTFEq7gDc#6#B9I%lc3_j3T>+Mu`Z`Xk2>9Vr!8jUDL)CbH7s%kE8y@8Z8(B9s3oy=()Rc``b_e)vH6_{ zQu#~9!`*o((p5d8&k_SpJt4rbf&$NV@Cal10gQo7R|KvSa~RwNL0w{)#t zrPDNWUj~=2Ip23(pn(OnB`}wsaB1*kdlafh_0a02vu5Ajs>R-#!Zbp)Bth6=J&Q23 ziQiE8Sq~U;1qT?re1SVe)fpO{nq7%Pp_hHlpPR9evY^-{DY795(GBdkAx(E)t@^gs`tSbxY%K5+DafgRTORmR(qiS? zwOCl;r;)^z+6HIp@54FDB?i%;rc{nYe)Qx?2jD!BnME#7RJ{de$4~|vV=-*y(-Pz* znxFJ9}7pT3K-RMpMn-S3o5VmBr90?D?*LYRbJJdyXgI5 zpnd^GGBQzkfd*VnbsvX~Ho@AbgM9Y@9aQ>Fp)7Ns#i>`KHHZl*v%J+YqF^$amqBcr`53bk5iL_dUI5#Pvg! z_+thDOYlLrI<5|2Hc{x`T#o4J3A$lEM-_VY^$o(Pl{Vf<(x^1p4zAH0owd_ZNu*s3 zDOxCBr#8uVj_39vJhm9YhG#-3UPF~^_dD~gohiCKKvH}WLEkbBg@Iu6!Q3UW6MuSy zN0~ez_}WR~7?iu9={b-l6p^=-y*T-8$^B}Tscfw$D8I6Rj)2uAQ62ZL;pqR+opFBd zEeGMpAj`2+gLgbWP2{Ki;hS2yuHp_uxdNagc!q&carx%6L#kw7lTPSX1VDZ_Sj=~M zO#lfC(?t%l+F1*-f_#bW*vI-c_TM(Yf*X@wKFO3a-rBZtY>Ouu@IK5jHXwT_5iyi! zaRd`HCgaXu(cmf`$ z8GWxRr54^(>$sxYjE8Ci$SCG6avOb&dJc8awO_moOKp^2(EtH;i$Xz(Ll(Rp_9Lah zf7m(OVlCu*L6BpeFn$|`8MA<5VH9A25v&t$z-o0CJd z74>IXn5F2`%Zz~&T4+#_at;i@lV?rdgJg>lmgaLxuq*=9QCh=O{YgBfHZ$DB0Gk{eXbIpgp?BD*VEs8x;)<;KZO8N{C| zh!6MPFqT+0)`0VUE`Pf0`R6NU|6hH@S}`np9yr%h_h+qv8{n5$2}u1q%q_@&QHgraRHQOf?TW-6>Z>0(bid;btZa(*N@of`&qk;DfuY|NL&sKDPyEjYjiYqE zJ&-S-KHQZYx#x$D|4XFjc+HtA@}!4By!6yEzik9mc7 zCMggcZs_t7XfzDJ2>Tx6uZZOPBRxm`elbYx9eHuTjpL@yH*_gD++=HrDQKXzwe`FE zt})mQ#$qUr#lnI^r-KAmZHV8#yD<4B`@V@V4Cp@IECq-x{0BkB>2HF{CCYyhRObIh zPzi89_xB@%;#*uwR~3UGdNKLN_2WT5FVWO-q*;0 zTy*kx9IiGz`^zu zN1^t2L;ybh+_Ul(Z;Ci-uSsG?()Ty448mvk{T|(vX*montW;d%K7adC`Q+mNJ7L0R zv-ZB%lQ&zJMHVAe_keyvEse`|427admV?G%Sh?g$V-%a3)H(Nw=ptn*SOJ9%>OZ69 z%qWZBdsYX^;6@G|nz|8{gSblDZu-Z<6sX#-WXK-EY$69FE6XJ-tn7rPW9MOT)l2e?9+Q)*Vj>_-|!?COP zZ<4P6)gMG*QWxN_+rQNj%{*tJ<92%5;nVjte684V|srhl}gV52%!K<_>@OSWO+-{^B6jINdYCKEz& zZg!DO>ol}n2(D`(Qt?h_HMz&9~ za_SNXk@MZJSWytE#X`;^TfD$6D9;Nn)~YAqI4WSMEE3bDIKWkhK-U3Ohi@G)54Lx= zwz_UaRZJD4NPyl;pUD(xJsJ{P3aSSj*1BEvF4rj8DPc+rVOQpFhfTA%IHV+uPuI-=>JX0=#Ays-ZL1tH%#uP{%qy)0KHJGH6^ZQ)N<(o68zFgN^y$n>%J-rWt7f1L(K52i8q*__=m_~G*qu->3`+RrkrzWoT z){eW+Wt%Mn$^I!X_vJrjV;xWbZawF4?r%FPY#uQbr#&9PWO)b z-ie{L1GW9V7Qaf@rCAaIGK4dV-}EdCAjz3%8rymcA|aRKE|(o}e$VWRd; z^nd2=7);KPOs6Z&-gBXGBHlBa2d~>+2&T(IM(`B0rurRMVFB4iN$GLQ4Ay*Q4?uAT zw3JiE6-#h;#cTuRH9reOw@ox6FFA0e4j3_c5il$ zR-Wq*1z=kE+V;|Y)bdp)PNw;<@~c@noP*-Rrnt`4S)|+KYBZ8gp3-T`l{I|-OBU{e zr(atj&%(BUk^n^`{3h6~@j9tCmxEk}LIq%7hM@vdDOS`76JQwVn*KyMmX*s-Pr!G&YsId;Fs83YAo8sGLF13;I@<_s*wR$~8V)qzWVg&x93y z$OxLuuZ2lIl;ebur3f|LJ&g<1_>n7{u`ik7nO_p}g4+0|=W#w#mgXVQQA;dt3TzX( zq;;7jjoZHasV^6JTepY@XXk~upLwJVkVnsg(woh#L(lrkNucg*CrGK0Us5N5ZWu}j z?}D_ow%T8V^0PED;9XU`V^eJD;4}g)Qc^>f!7g0SOD%5d;40>e+>L%5IifeLzB-c2TWR% z!!LASYAqhp1Nsod1CRsIC1}^_<8{KbA7xzNz|O9 zsZ)J}vC3U?F8FUzp8}2J#h^A%!O&yivcIiNdeNou#fwPOAYgqbfhXtE8-1=`fkL_w z;7GShO_i(QcJFFE#Q|ikCh){9)1VZJO}1qjHg!o@t^c;P8tsEo&^K1-_u^e zdcO4opUZ>NJL$4R4yeTYV#`uyxUIzpTn*cKPdo1WQRu>~H|qe7ZLC_kIQD9ygxPUz z;5~U`khUcMh@6j75|2i=cIT5@nv}=uZ1(^H%@y_n+NMOz_idHi>TsauRh=H26~i5F_|3M%84j42w|4HTZ0d!NA-G@5|w%d9V8O8yas;k{#)=#|&DFixUQ z@p*lrRj27 z%73N8sb@eD8iUGN30 z!xOBFrtj+f_4d0IKpK><8r??oB;w`5eCM6<_E(4VGA{utQrYqk&f`ECs@LfJ?0x6s zPpr3qlRYH#6}f5qHj93b7Lf2_=9SY}NkB_pJdNCkHGLihG^K{^UcTp!JUH@+#q+A# z9vPMKSlNo~ElKv46eW9RhLG(kWR-+aHWiWe zzwY|1@Av%A@0{QHo#Q+wdY=2a@AtUI>$+aAw~ge;n81xRe9Nv<^?Mh@y;r?(msXEH z?(_7UR*N2e6{$C_Y2vH$+F4%UjeeBEYJ0kw(3e_Xk`OvO>ts(uXp<0uIJ3jU?rftZ4>9U)8b&TC*)hhgM*O=be<1Z!OIE55X>fn}Qmu}}?rYyffJr_aud5-m@#&?kXvr^1r`x6S zaipGw38nlwm+$P-q{J8~00DQXI_S;$;v|n$NY1(!JF*bU(|PFQ`JU*EK6&qKJ5Wzc zIdj(Dzo2JLNIA%7clp$OGahpenzEM*irDs}Br0~_D63|RS6;{bZ{(cy{{cB)Iw0i| zdZxWJpmD7^2LN-izl`WdXNkIp=YcLj(&};+svKf@b4suRHP{goN}1OG;ZKBigGFvB z_UeDoqA3Iw$my24Fg%$-iGJHv&M$rW@=%4cV!lQSwp87Ed%~fL!L1AA?KMze9DFaT zh?$yY&2%q@rlr2O1-6)?PrHO?_{=VvHR@qJ_cr=3L40NM!j@L%!hvq`{`{{B*GTK5 zWna{Zd)dIij3+{?e-Y4s<04T-n^A3N)H>Z@`;4M1KS1pNfGgKjR9qApgSgyKZJ<=8 zj%M)%B+aqQvUJc9t2>FwKQj+^Ug^1_HGeEFn|jl-Xg!6`Bhc{h?QI{c8s|@}U5s{6 zaQS8e1rgnPrRy5UhtJL*_GTBKEst4k@VK_l)cT%pBqREE7KloIW}5QE{~+d~QXE$b z&E;peGoWpq10Mys(*L3<%1|6tr2(dj-a8Xi3 zENh*zdA^WoBfj1U*FiYj{sSNg8t-02_%?-F z3$g=t@z8g+2eEzOM)j=znY)D)2}5ccfca9 z-sOPrXDEEwb;bwprcDKbGu2=eqv|GM?1m~-!ewJogHj94-r(mW`Bl5mpd$48>*^76 z0kAE<1S8?WU$OI~Lx)?sICROKoI}F&PV1;sWh0&@=wD=3js+ip8`2Hy?sJ5BGEt%fS5BrtpwaC25U_||& zO6R-8ibj)QddKs^NY=310lU<`r9*_|TySa$ogyPj%w+m^wQ^Cl$ePlK; zXGK=XL;Ba1X|9R;Q+U_nUuJdS zp47%IB3P4%w;Dvey|iU>76fK{h~UTgp4x9c6ZS`>@UTC~xiE?UTGkSzgQZqgvJjM4 zNwD8s_m+p>FSO@#0u55Oa!vyte&Da?$e_MGy+#9|*^ zzWe{(wk}aQCxfwT-+QElwr#$-#Tl!geTGMI7cK3THKoZ2t$ei zM~`X3XlEjd9?Vz)uuh&n5O+`gcUrFT!w{4x56d5}{@X9XD2zj*j*U_OPrt-WbJG04 z8MyKkK76VQedm_MvBhzNZ>0{hvmL@z{HG$DB zSoJfwxWLkK87m)|{Zx1|kxTs?zX%i>Dl)_)Odxu>M@8=Hh7Avt&5WOo4Z~_k@O7ct zX;isd==ZpW(7>BMFaC{L!{2_g!Xo^#75IPC!^bZLPTuVz7IcF28?$mLC`{*BXJNj+ zD|0%t2Vi5E7)6xWU6|>li(8y{NMrZR2{#}3u42l!{l4SNglI&{1b&79RqDDg|Mv#@ ztN)6ybH9D$$?nQzpnu{s(L~>;9wAij1ngvD*k4?kUgboM>x$`j*L!z9TSHnFKI(Wf z!=qh@wP>i%gf~hRqv7PcUnkYTp38v6{uYXp&g-AzW z+9VKBn?YoVva6iz|Lz5F@+4z`Swq%7*siYo|LowuZtz~`)jsEQLCsWqvgacPo_n%A zN24Gxr8Z?ulgF;4^x0o0K8O3MeY6QpPDc^*W>_>dO{HprX`WFF*^K((AxUlwA-Hk$ znQR|2+aA0;8~)Bkzjv&|q~Mr>>h$bZ>jOiphY!`-7pjA`zD||#8cpZox9VLk5hRgf z!MX}}1m(=t@l0e%C2{V90d+ftOgPKwY#d~ViX#v$hLRBTpIBlQ`QppxKRCp8yROgq zZ(g4YbSHQ-ErUg7_bfqzh(P?||Kg4?%CcbE_~5bw?XR;e?gdi^m!9aWAFHaTyDxX( zvqjl?@7V(Z?C{74g+)3#I!F9#kHhckeEk`Z?&EB^m&}Z>(CygHx!mILG zi15ci06yc77!WHBakk&9_;(Cm!2!?tBEP@ok3H9bbv(eX(cCLS5bbq~DY(w*!h_=B z5%qf3h0`;ixQ>C2cjr#gh5)dXlx-!i?!57Vos7}ahJhK0iiWDu??%9xP~0D0)3v9L z@XB3hgI=k)aqJ2YbM?p6^a`=1+`ePz-9FMmxb;~-yy_JCvy6h`r&+@u5TV@`I49d0 zg{SR0Yq?20k20d!OH5IC-_4jZ@!4oZAw9ghq<_r)%$lK29 zmUR;$V;)@4eRUglIp)AL{i3&Yd#CVz&}4~zQ`shp_3D}QAX^A0FT2QzWeF7si4oRo zrS*Tylq6<&risl?#)kDW`}SwL_L=x@@hu;z^_Ip+bK28vD(|sXvo9W$4A=!>mw#%3 zy3H52g>?s;&4G{`&x=?yRCxBa!`Z+RDTdz6ejn5cv=%2^?c|uqCF+ z-SjBpS-0EQ*;Dgx3{IaEOo>xB_8&Wii}@%M`@QbLBaKYSo~-6@;w#tE;7b>g>yYqI z|GtAirsEeZFpc9&^QV6g=1*iWWx~ya7m!_n(W2H~Uf`H2Z#|5Cdf$vjFiSZSDE-tQ z2G_XMmIl`9f-jr^XQP}ht_I6V2p_SKU5TtycXns5O!<0Jz4kCt;MpKbz18u>Sz~7F zdy}}kHhX(#QO=;KDW zjsyz(ud{joC1|?BSo~4qLd*~1q_xOTX|?}x`b{6Nc>m57S6|qQ>oCA5-NTWVar{$s z&cuO;Z{jWzIo)@+@VP_uC6`H|-~pXrM@G(0f=Ep23S{%ra7 zp8^;Jk|e+3bte)M-`G*Hr+IoIk*W(huNclWkKe_Y4h*E0dQ%##J+`j8n9z6EuIqVx z@CxG7eqCBT{qKHmO9y|qj`znrMNztmE)B38fBCw3-VNC`W50Dde9WwV7iThRZ{h7% z{%yWW|3qw6Oz>GW3lbCE|FXW%8_(V#cG`w#jW1e)l#n31DS$>GSEd`iL}xaE!vr>^ z0x7$x7jDu1`AX#VtpHY3vvKYa`qDBmHmn@8|8#^x3;^N7AN8-9YsgMyI6<=U0#+!{ z3%zUIAf`G^%>{ew8a9@3BIaCkOGKOBJ>6n^dP*bA)gN-#KKC{hW=}IYP@=~=yd+d8 z+z8+z=B%;ixc^3k=^C&sdJBEne*Y=>uU^m{xatf(@|E&A)`=&;vNXw&B72nul@0F< zmcTVvll<`Wnuv6gAIm2^jsf{Lznt{8<0FYkV{NOMks28-X?3mpxaLT_IUd7htoU!N zP>JLf^emPDlOeI91Qsx_6ciNVFJ5oA9|swdJM;Z%q`(?b>4+r0ZlLytr-VV`1veo+ zG4X3i4le~A`Dcr}V{7NiC<6gk2O7S-mfsQ7I*tl@ReOHXGAJ{r1ql-4k{=W6Qw>0~ z-EGT%{s}aE9Y&r8Y`pB+qKX7kf6UGiv>mp;d82KC2;fOeOKW6y?7ILzEGgy|eF8XZF;OFAu;Hgv$R3xl_a5wh?|!j1*aBoJXB+=u+!6#QGQ3ztiO>V>tlL%} zf|**!HCLA0-`|tS_VXpnUEFV9Cz5z{lVElKli3;7Zv<7o)D>%Ts|W=1{~Nvez0N9z z%z+u}8T-t@FoaN=70@qweoE;DIrl1P-+*)nd2@5gPfdGGlt<@8<;{4|3o#?G4fyrr z71SNcWdr>?*vc(mDnKWDCA2y7U45a^>rlp=qui~e#L+8#YiD(GB3`+n>~-CZ*D({- zXwsvjeODV`tG5RnAMFbW+6_bl%N#j%MhhC%o0zhpULs|0C-b*8FHwSrPLZpkM;bBg z^qW_+;i0jRhn6~UW20bKZyU}enNWOjP7meWLKqk|>~PfI=dyBXQkI||0W#JZ0?Od& z|ME+Wu=zc^3q1#a`z0IPALl`yv%KZkY5k`fuL{)D+_sku{b3cPU$TzuduTHS%d$Y` zLrZ`ZP<*B%}2^Gc|r^ij{X66!O>T+7bg1EnPC9YpPfir46TuM@E23yn%MukQlx z(J?+gzS&?7qa%51WBNW28)krv*^$Jht@B6@O9O-&SQTEsTc3V;&v~-yxnL&rbwKTdaa}Qr zM7heQ_ub9Kfn$VaaRsC&l>3sow-(Z@iV_oZ{l5|9dlmfPUz@B(I}&kY@e~Lb_%Bmi z`G){OlnqqihUTKxB>i?bSxyntEs(22$`q1|_Qvzh$#YiktIjQHt7d z#?}PzKSWI>35kdd=B`3xrf#tje~rsWIz1V^K7|-*t{V^VQA4#rs(S?e^65fo5+F~Z z_54MakaIALtbC6^J<4&7wGecM)B}#zKT4h9GtnV%0CKAw>JLE^9h*@4fXUSRw= zLoz5~?AzjC@tmN`lsN1_WrEN*xw74GeiYGgN-Qty7!2&FNxO1Y8ZoUPF4A-7k@JJR z0a#iueZQZAm21SH636fy=;5EmueF`9>4}%WpTMq0q3CaG3G2kbkHw>_=8eq027wc3 zN=5WIWO~^x)3l3%{DNxwMHWtt^hc;is2vH@2LozJ7(R>E%?cY?rBsXtc=0;Zxz8&EFRK zi)$U$(%=-;jP9DPGV_Me3l@#%xi$NDIe&@*4bC>4QkNeJpOFI&m4j9{SO=6nigceu z(izpqbZ(DZ1<~g7k{`i2SJ5yZ+zpyez{N1kcoklpn`@O^a0S?RG+e`vDugY=I?aB? zi`3oxFh*w8>%n;=+dRqHhP7F(De$l{k(}fEd+6;=CVHlZej2w0wxZ~87x*eX4LVMV zuQbDjG$pIO4u^AL7s4Da?~Y9~0amIXbV1{zaoPEtLw9QmnZe_eiFcj~FR0}Hj1T@u zfaGsGIaY+NB~~8-oJmywn{PYGE0RI1A5BB73ui&4&Y|Lr$!JH3|XzPISk5m2zGDY$lq6-qm^ z&m7>klSQVv=CaLyq@PEb(VWyzR!PKF%L$sxzK)BH;mdh_rU+C^o`AvQd6JS!;Pj~_ zfULn0PKV^{&qqB#WL~+keX{=@=P- zjuEic#R1T^lUimaS@U}@&ItyZ@2F@1qPdg8i$Z_cxF9!1`i)h;h*a~}EPLa^-we_j__wM`J2 zuFqZ1{xeYm3^ ziyX;D=uR%KN=3zd`~pcd2HOjn&Q#;ugkANA~^;L(%NsY4C4wSZ* z%``NV5@Dm98_vL&NIa=2=&=nQf?a!rPkgr8h3qnU?h;Uv|6u=M22%Pd*Eq3LlkX<4 z>O=p?a9Z-ySQtS$PFr=6r6QM)jqxQ;f^WW>LG-~AYB~?nPDUV=y86CW-B$G86uXcm zFeocPq6@0xAjYiw!r3$$pJQ?=f8c2{Yf6bPVw}3;x0xh7*kimn3s42Z4(8(mE7gB| z(SqyR;q~WW$67p;msW?er0|>TXhdRas+NwKDm*DFlG_&bTk|~b1m$Zb4-H?~W%wV3 zhg(SAA6Frf{2EsFZ)w>7irFK%GLkNrA?dRBE?;hQ@;h^HYo5NvQpMQ;k68aQ0Tp4I|VUN91_ezT;cO=p5T3*>jTJ|*o@1} zmqod`&U1(oSL+^| z)jA$`Px}U|7}ng}<&a}0Ln)+jzPwGIFr9x}hns0wi40fXIXd`JG%K@-4z7Gmw82si zF0PVJrtlI} znM;^fT$49c=DT?D;w$TPoP6on$=0BtsP2`aCsB|3-fyprj~XVMDaxjYRS(k^)#eGF zElbnLk*qCk1xlKdWzeB_me**xmFylIUiEG}a|ipnM{58@66Vg&b$%hc0oAwE=`)R* z=J)RwORw?fT+c>SrIziG7$)&EaMqLS(E>RVl2_n707KcGaVIU%EF=ia^jcg#Ag|_K zd1Wc->E-`&JgRs&HD5IJP8|?y#5Q2R~@?E+Dy;WXzDHcg1XK3Ku4QlD)LF3R#BnH+r7Ov#2+hth)-w*9wGGy4(CCNf?VfhH4!2 zN2z(<&h~*qKwabIpqnn3GCaSf0o|iJ<)p^&&hZq(g6feWyoF6!sRFH~9nM_=Ld73k z*t1d8>PxYs1v+jLL7Ado9Fb5!BU3yQ@Yr~E7;19{J1F%H5SiYHH3E2bfG1;K`d`1( zb_oGUKHD@rJA1HQ`Hp+kGIRu8J2fTFLUAJGYm*rJLC+1}vNn3$8`#)($rzoxkeTTf z718qKI*hAfi`f()s*?l;kVF|%wbq=P#Sf+JsZAw=ghvl#X`{z%7dj!Cx|8L#y*aD++@k44BHpJvEBxLC3vg7!LIkme6m!eY{aYKTKv*CG0TV1JXaqn`i3sJg9NG zdhFs~Gt6uHZjng!1TNK7(gUn4kR3JU{L>ZH^NWPokV8T;_f;nWK zpz~vgWCxIQglcw6$^p;&PURc7@&KM@&w5M({U_On*C5WBq&L5wlH>>s`i*@@ugm1@ z7c`-5HU{tO6~Akx(wb0hE5d!jXv&i!D3&~xj3LUsfkH=WCoExiQsvjToEd$o)?hEYn1mcQqL*BODOGE=CDr?DXb%6;*%JkK98AA7>-z+Pfpu*hBHQ_1{ zyv$KhZ7^P-eMdwekHr#3W)VeD+0U*KtNMd>$2(N~l zZo6iP-pn+8+AdD41h=|CI!rqp8iW2&ejzF5PTA1*lc zOmpYZ3i1>6;lLF5o+yfH1cDh$Mc_0Nz?T-~+?=Y{?L~v?WD+13eV|y)3pv%cr(||Z zF)o9t@eylI$o0;b>Qz!VN~Kl3wPO~ZpMMZ>#+{1)6I+N4fqAqvcelWLl5k~+o=DBz z@KcMNmnbeGrGaAmFEK*GhF9tNEuTv>#-Q=~D2rTyQytjbS z@qi80-kGf5JE>?Osa3*nTBQU5TzO!)z}bAYq^>-gL_d2_o8*z@H7bdRJh1+w6)371 zGJ$>7d?B#!ZgD?s7z*ok)TJR(Fn%-h7lr$gfow?jQ22Le#Ule5ST6?)`1u2;@KuWYP+V!ICI3}()VsJ zJOy9c|A*ZA)VL0s#Jqk~!j8n!jVDzJciBN~4}IcQ3W|GvS2vbebj5!%j?vHO6-HeN7(oC)>Y! z0TRG>;pgAJhy)o#bi%4Khd=a3Q>gN*LBIR_s|zmlB96)VS~+F`rtB^&pnI4P1qIVs zvp^gioC1&tTqZn!xAxZB`(EIrr?_2NTD4L@)?vX9baF-zpxgtK)~j|%gO4+m-M3h2|6@pnf{g5%-va24 ze*<=OzqaflyX?{Klf;n{<{XYLT&flw-_-}QN2&y-p}9_brTWj}oIkwKJo>dF&Adp@Ywp!7PZR^qGOL^#Tp!#hVImf1E# z4QCuqD94;hK=7(wCn#ztY2QtbAEoPu?00FN8wRa@kRZ><~d#+bt z157?_a-Qe6_P*J2>pTi>yy6M5{#{F6I$Bz8BvA8|=K!SpYO_yeV<@@*#h}=zFK*jU z$8k%&J&>S0c5OX;>QMv1T5qOE@sIV7S1q{r-sx)- zl$9xcvL6~6awIaxiYXR$4{!t+Zyrika121ak~=#`4hYIwz!BtSJg+PoJd{BU9`x^p z6DqB{-P}_wp(4_wi88)jOIhUB6%FDjL0Z220BGJ-f>iFIl@iURiI_ht8^lPgW?j z5$3`dJ7L7drjmF4r-=6uku^A@3Uu?vPY&TPH0UBaNH-5f=I`Qs~UR z_T|yZo=n-Gmd5rG+LadxMG@wSsp7b{`Gpl&h?X#XVjxxP^Z{l0k|X?MwN%<=8vyK zdXQR9zVxf3sDiYX-E(n3_p=0@Y+y3Od?TY47N`IZV|R5sfHV zh@7o|bZ0V}oGl;3l~84hOgj)zt-^ss-vHO(i34A#>v68^8l$Ll`g~uC`hD^4t(zPrh9xGt%+G+y_{2K+CP#|;yFQH3Wi$I@Vr6Ju$i-SiFvb+?%{i=(d6-{$=fOTEurxS@`WDx4xdL$O!WsfoghosNdXiavO^Am)`P0V;hGp% zpB)geHKdwlE-KKk90xzV2U{X#>M2qW zDeSv8^B&+PTzyRq$uJr`2Qt3T7_5dXOzEB=)O~YLIYlVieV4W}*?LvkTUK$wPb24E6r{CQSWKJR1b()4fq=amRp}F*TT^}5B1@`?Ue zXsE^Rbs<73!n67|gdnut(tv^!Bsx1g3$=7Putq7|$Z7-jcW`m?zG0DAxVeo0DAF6x z64vr6de_VOrr`Sn&@W{H4EW|_&rU2(9{ZU#z6Kn5^ofrz{frIGeb#En-^mvW(3c7I zC2>7y{xPh++;*0DoOiaUsGc8$=M9V7wzY9i5$PCSniE~i=`5>5tu`bt#;#PkwZ()f z2pdphi3y3J&~}(}*1ya8Z~i!Q^_W}s_J!ci0T>$Qxqe;X-sO)arqu=~FA4WJOnk6^ ze0KWPG&NOS1)h2dEPWwsDc&6U^sxDYT1Zz2i=N592>qI3LN90&t&u6LX1K^>R#T`* zsGEe5*zJ8H{YRK*5(=jX5*6p?ThJz=o=!yayh>Z7}ew4E|oL6S~v>-!)%_Fp|W($wj$-(}tSZ z^tJjMcv08DpHZ3%h4Ff0V`F;}_oP`nQOXn5E8r`PK$)NNa(K3&Z442kq=BL2rq~h@ zUR3QZN;{@(}{14uaHWdrA@Iopkd8s@Ixst?7-c zN)FcqGSZT!jJHu4Yu?x>SimwCm~+(gUuqjVdg!}IE8#X1Oi?!{TDqLhX~Du&cq-KZ z5~Eru?DM^PK$(Qm(Is}K=;tr%D}nNAQS(`2$*>c6d!+kjC6xHFy9&w>RLp~Bu92}* zSE<+HSDN%=2rV+1Q=v5k1+l`-;f&(%%ucTahNuuG>TJ7f499rWK;ff$Bd68Xsy4}$+HVj4yx{H zY$|bu$FpxIK6XLWNFjW@4>5MGBIa*kDf}5S>nBywu(xXivY1{fHcGnBDTRiy+_dp$ zWBN1@r4!CWbVt-Gu5=LR(hQkxcO2s~>S6u(zWtjSH_{Zk&Dd5o^j$;#d$F+wYa$kh4W6+Lq}o|UKP@x1wU-$*9xk4VNS+(A-;6xZvS#k`|@`3 z`#NYe$i>b$@8b9QzF4xjH}oFVTFFrrC$OpTm=Y3u3_>)P_)*VJd(%0 zum^+_AF-$L(>QpnY+ zo!@5*$p?S;dHMI_{}}`Uis-nwIDWuZkOaXnIr?fM<8^!6$+iCXO_Zz!Lbtz~ezt%H z_Z~KMf*{N|w~$~TC3NErhVu?*+>#4ladn%3C3L|7FuG<%Ii*>g&48?n1ZHp9|kkil8jgd5tG`BGg38 zGh&L)^ok4+k4{lI^;(o?B-2C|q3fp!#w%EjgyCV20~fY4xrOE^5u-JOl-@W5a;{t0 zkK50wlNVm0s+*-7ghb&yiwqAB%F=&JS;F^Q{+SErCYK|faNQR;^J_rEuls|_T%YC| zkGKC&o28_>i*soxbrH^!_sL^qOf9Q3Fj+J933%E92>yTh0M&ZI`4nICkY( zi%xJr)l0ebsaz~D`*60pQP7u)4ML3yyspvo-KN-p0-@Nj*49Ujv`29`y<1SXMNR!) zG&m{#Lk|wOGYhkcuInUW%yU}1y8efuA56cj*`>9$v9CqZeHt{G6SLeY^kV~KUp}batsyk zQyI6Bl_IFs8CmMa4T4;`b@p!Z9;{O#Z4d}r%HlQ7uLc+#Kb+Sd;$SUy>}?gsLuy*W~K#L|m#IF%c%$Cid6(Y!gcsB@~O<;~w> z8ZY3D%dy%qxIJ#iD*Gz0xDXBKJC85X`2M3JY#yW4k4<6^y+lEgi=&5_L0so|Av(Gm-09ByY9dPSfgoV)Cpln7Ow zL^}F?)M`Rycc+Z8)7pnRYJ7(~s_3tj`=+b5EY$K9G5ZS!J%+m;_%7;hx1>Ao1_Vy^ znNtf`8tj{_-h7iS@nq*w9LjT|e~!+e^ajn1sMQGbJnT$P3x}$6Ezy^3ddTR-R{eDI zNK#hfwGq_&1wa+vBF_)gIGBU-VlM4$?H+gL3mq_?@(VCf>PUGw(f{OkWEipsURZc~ zkm`M!*5*&F+h5AJD*iQ5MroKB;|uKY6v-`@_q&q@g{L7KJG8O`lY^7nRM8!%5lQbnZFQ*zdmJB%$8o2bF=o=T;rFoHFkwn|-T`yh2<(=Cb_7 ziQeVcz@R@T)!vjRkm;1)Ch{jd!(=}DAs(WRmcpZ;JN&s$Je1v9sW+65EVSLhM;x2r zWETMa>3az_5V;n4xR+KTODn2!oQmuaV?Z_UEoLpZeSw}aeZLs!CMxb|fsliD2;~I9 zzK*fZ`ee0=o6gBeLc_Drdg$zT>R85gTG~+l1fEnpCY$zy?h+BsV+E}FO9sp%BnuVC z^5*Wm1uT(JH22ntK26OO@I$vbOu*o~BjkHCa&T_Mofl!vP$W=47j)n*e^S)o(I_2m z8TQH3g<%3e2v`XBMHsU4TubH0+GU836&LWDqb4eX?p7T-V@`mtlvbxr0!DY5XAT14dvPS z_&%F4rL&^7llokR@$2n0@bLPhF_mw+Er}^i(=J#T*j`^zRZuEv)9jFi3q|?E*M*q;93e9$QTg0F_x%XgWw}J2rYa zEKV8mOksz_J0zcK_K{4?+rZ~sRPU}E0aNJgav_`$QV=7g%#SO8F|%2IyEoj7zFZ!+ zq#c$c<7c)kQqBTxg9(doYLc-8h-0{Nf%)JJD*rcIya1 zVj*j}#b$>D8MR)i)=66<5Xoh5Z6QH|q24ep$ts0Yp-p7W)%tJbcvtM<^g+Y%eYtjp zZ9d_()2L{J`W6a2Uh(Yqz{P zRX%R#>#Tto@pW3%z?Ex))FbrVZ{JMN__H{G`@QG+c65Zk)z`u3wPwNcdHv$i=964P%{ecIP?s zLXHie3BP8iVJBcmxJ=f=w41Zv`3-JWmCv7cz!#*I`Cjif8+!A&h(%@L0=`!KU`1W% zwQydhN<77p{QP{L91aoDqMSS?Rqgo2O47(S5F6yb`kGgTqarylZ0475w0B|Xy_c6{ za5@9e`fb*yd}3fE9UoQ{S2Vn6o@)t5jdA465)u}U-Mh>y6V%x%#hSwsXrR?W&8ve& zyCom4xKIO)vk1yt0Eg!~X7*qy$@_<3%lwH3UTZ=u_{!Ga+0nL>Ox9m zX8!*Jy5TGMbQ_!;tIc|@zNFCYBbt{D2nb-@Lc{;}b_nhz=oD#jdn*N9lG``0_!pj~ zqADn|LzI_I=TKb!(8S}pxh7pYE9VU-jVy1TVR|u>6}TJJ<7B32RsZYsrz?Dx&Eml3 zE2md!XWE{1%lP@3;ngcYxuO#eI~s&p2v|fO%1S=YYSU44e|a|N!>zu^6#D$`{*N3% zudtWLAFhoJ?c4-u8uIb7{$Mf71gSdL{#=!#WbgiQwaglah5iOB)f7iV=P*g$oZ5hv z(&XYFuC*QY{Lsp*SAJ<>aJ~v?JC(IAe-fF9{CpvX_}3}bIuA??kTBsx!_KZQLCCmIPM2(mENSG*{3eOtD$(SD=K+2WjzOmyi`RfrwL#_I{bTfyq z!fCY~jR$IrkDMva(C|IS8TJvQiL<+dP0DmRUh3!Lg~gl|kF~Lr4K%)Hp?c^}IzGadkb+us0{~6k^Mt;N2#4cL(+yUKo_6x~(Zl-n)A@ zp|-W8()-rVJJY52RmJ(l8oVok7SGCj3{BtJ51&&_sM^|iwn=4f!2krOw3qK z4PAc$Z%!BHo47DDrnqTq?YN$}otEc}J@(noDsV`=@`Rd{g*x0s#y(u5%>EKWFP;?$ z9r)hom4Lve)aH`8Db&T8X=VI8;{4R+4~}fmld4KB%L~ zj&%!+k}z#_1L%Qta_twxl3k-u3;nZ96sHQ$B$$WI*tPx~d3f7U643qPBF8AFyKaL? z)x(pJC8X3Ws=}FA_#D=k!}{!g_v9G-%r|)$^UXw+-1=mXJ)h!?!n~S9pnGoqUE<`T zJWZ3m0YQ)^zpEn&+~)|x2fV74Dp$M(4CqGa$_!L&t^6HM8f#T$Aha1MwV737l+~98 zBrN?iai@?56vjLL2p-FX&p?$Bq~wa8k@fi1h+k$Ke(5694sVpxoE7W2Su%S1t85oG zk%KqFu9&+=IGvb#fgDM}o15rZk68WPYj`PQZubp=KZ9#5GK<6PzZs_Z6`E5fmFj|A zvx=79<(@5Mm~(0J`BfCY*q5jwb|Loq<kX`4{=c{4@&c1~WaRTh~6Y{oMFeJxFML zKQG|d0$1V-A5aqEI$Om%Oxu`y`DUEI@Elvl!J3W3L`eu;!f*!V%twD{pwBw-a#ylI zDB!vjTaJ7T0_hbc#uQ&?=5`{ckmkvpU1nLmT8QFoM@csyp?BT!!BbnGR- zYbh>{W0vFKK-@x^QhTkGcu(k=ry>Td9aKVv=OcN&-c|^>zZj;SUKx4zAn_TqlE}^X z23ilLpY!y-H(boam2ZdjMzDLp_M z2lhv8^(wDfa3@y#_g&k?CHN{gGoOM}wc(upu4m{A?a;GpQ&2D{=g+MZZH$7EH8%@z_>0C<|d?v=f7y5bK~GzX5o@ zNlu$0Il&q716g{+W7KQ59igz+E?%tc7(wD@??pHkf|8MXoH9=@YD~w$8mcYJo0L?l zI^4uj5zuAwc{|eujoAg=y$Vz$2@~JYP+hXzqp}I-DTPx%XxTHqo$8y;qK7X|xMEyT z4cP#G(WC9af;ytWFNPwIVFOf{x1uM#pJD9rZJL)n=yVepAm?n-T zCL)xjI4bYj zy_3eV3VJJ()z6A9+(XrBOK*iYy8L+ZK&I;Q&-JDa9(k=|uSfwrV3=v&Z}Q*s_}~d8 zAOndu>XUS0F40heXCMvk6@iWf9LmXYn0d8bb@RG?IqsW-XfT6Q<3UyYG_dU zPg~4+Y>X-zIgsSrTWCzpdHRfz1Wu5S+LeQ_dIWdyr^1sl?}hm#%0x-#T1`=2qx|~J z9%wNE2a}-(Gg(Nl`^~GDZn#YUDy@)1EZwN-65n&3Rx1&09)ssI^BM;$?nsqi47RA} zLW$ST%qtvjMOoH@0lO(i)N*2~Jr?^RD z-5AM>9?DnkBmJBc^^5N&d1~Uy9?nD7eWJJX?_K}~va#p-D&7%&jgapcrL5}IuHO@A ziHC~SkZA0Sa;1~aoi~(Q5JWjEJN2EXS=7v_>)O`DXCW^4_A-m~$1D%i@?@_)IGset zVW#Hxt0Zy&E38Te>G8AKuUyb$QMWLXt`2PE7g0neny>be1g-j?&8tWF-bE17_iPKy zpgl|{Ek9dq6j<zCDEBZF|PY~8LMneNnJ}) z-EkEGEh{-P&O9(K^RuG97{$Xk2&g%!-nDvy^MeT zFJt^b*oZH1y_Ur1ra4UAU5eiE9y0J|FDWGF)GMB#dh?%lv~{o7x7FI5VA6bvMG(E4 zO$w}HbFSl$(2{9sCMZK2Ih>(g;i)5wRB^N^-#CCx7S}j2Y-&dCJHJWqACHiO5?N+q zy&|2mbwqGRF+kGffVKo(Dmgcus1EZUv^``qRMPi4EEzoJ`U(+x1+<lkjJgX1XE> z4c{Mx=F*bJC-Mn;0v|-s?~U7N^|*JMo!UCX$pTf(w>!7`TU6Wrv|Fhgzd?PT`e?Bp zCXg5`1|Z{i&YN+{fb9}P;My#oVO@`Cs5Rm4$qPpZx15LaM)IRa%v4`$oyKhdn?@-pD&GUdulO_-w7xzS zcAg+hftBaW_hj)aXhnYa^)Qso65XTEIGDBBvwJ1>%`0cw@fr~5zTe&^2Aze(??-;H zMs2m0G^`%34*DTe^PrZOEhkRqeAMwIw>PTp_JVhdBKA2pvOu58WQ>W$>62;SCummF zaep9kDFTVB$mTnbY(x&qST+fG!g?9iwm(-AQGrRmh%ojR2k4)0Vs%geD%VU7nhmZx zqB}Iu@ABpW1OXXI=zRTZ3`HWplF?DK0@T{xwZZ>=*;u9rb~VSB!=I2s^fL_8=6m6P z0gY#*A!JGF1i(i*1T&7q(b4$cHhJgONnIqKuJM_66ndscGE`G3gSQ zV?T!CUQl|NO!+l(6lP#aWUebQ?Me8TvnM7mwS1jPYKcwR*9ZsOcoCR+rYO z2IAQ7%DtC|2vTrHW$VgDu52FkEAID(?UT;GyE{_lv4!Hu95fNP=rjCPz8uP#8!+mF<4S&b= z@t7MoZWug+R^$JVwYQGyy8YIK1yMk06ancj36bt@kdly;5=8Qgq%ie~S9STwsW8Isa<)xOy z38Nj-k5&hbk;=P;ZXa8ttW>Ir3Vfn(>8O|zp4-cBhXt9?O4*Gw>NYVa; zi0>>-LMo#SpO!28Qi2)n48AoS#pn%p`ko2y^m{M6jU2i-l6$pTKJx;xip=%9a6HL% z-QiRc_n98|RZ3^7ITp%6piY4w)E7urE_8B^K9OMLYC4X+!C}O0Lj4AnsMFE&IZ?SH zw#|OXz-7>3vOx*BTo--@pKgL)SX2UJyEFeP2I^mOR9jyq^y5wbWcoN{lC*urE*HmN zBibJyi{kJ}s%3qqTDR2#`5u}t-U?D^sopyK4l*ivNWJ+D+wBt?*7Tz@BAQEF$TO4s zNdXO{tq3_q%H5|pZ!p4@{_sMyC4q zytnG=y(0RitGlt^>}gliJ6|dm8VLJdDN{ALt8|Wjl>0QFe`w2(k`c;iKAfMRyp%pT zj%BcfCz<@EzdS`=;G1XMVN%dJS2??M^F#5}R@HIBYL9kJQO{3S>YvATZoG!gZ*~*x zjcTM|&JJ7Fm`twvyI*&w_s~`|`^K|3CZqoZ!}Kc7)+V|H$kfTy8red>%sPvhejf;bzDIlXhr-(xTW}-7TT1XHXo+ zn>4s37l)j1Mli%mHOfc}*Wq`sM2_fF8ZHnxtgrA4Rk~0sQAW4x`%{Kr9U9ZPo}{ws zKSJcoZFJWP?}1}8@8jAMqe`tx%f47i;RfHm`jKKC)B4>%9PA{e@$b(bGN}DJ+zCaI zIRCB3A>S`r-FUVu;j-LnZqVRUI^Ub1ooH{8-9D64)ji6lvS#zJ*oMAbp)+zbeS2-+ zG}kxoczdjb^~0F`M71twMnlf|^YMl`2FHNL?Uq{?`R7flAw!@54E6@zpkDa3pDZgp z*&iA^J2}Wzd0pmm*lKS3t3E8gTuZ7y1Lj37awVKbEhTN}^~HsMTD((#xH)*)VC&@G zis7;`rrs4G%b0>vqs80n6iAzR4!_G*jf!7fJh77-5ZlyQKX{;s-Q4c!8vAAHeJzd%q-4GHQ_nh|C=uoHjPRyJt zi_nXBUgm+$Z-nKA-H+TIrec0AtSZ(iFF@#*7(1sb#k4;bMxA$8-ciYYF!t-N?Xhg( z55eas9vC9hl!SM@Am}nVyu17yW?h z(PA|z(nmMbxKYM-vq&eJ?0P=)VG2`vLg9V+p{scbp6rXiGAfe#eUob>+Z*}hO<+9x zF7ivxwKK7p~(Da)VN^E5Y-`vI+NrU3)Dj z<9NJl*+5p7`C@GdSO!)3|H5>;@q9$mRJ?mTUR=MJ2s3+n1ck6NNuM#pznPFSUEwbcj<_BVw-*Q4wXM}3 zY(a9RV3j0|RsX?;zEyaR2hBAqCa+6u4I}ArLlZHTGN6H}iKl&kbYM?!;t@`Z57Mgo zyu?63Y)JK1_#a>nYehJn4Fv1b$gvNR<}%-8sM+>SMoFaK1uSx1l;|B~vYFtfx6{6L$urAOA%}!qe1`V`Y7fH=!P=;%NWGvB#B5^hxTC z9A2a0qq8E<)gRf8ay=QQzHv$$5T@|gK@@8&A49R4@RP~1x<;N=w>|r>HCTw6QB6IK z5H*-nI(jx3E^98NwSqG=HYgF<^*-Q>W!r~^Z4cmLRKgqkSuZIK|7^SMjS&MvNiZ z5mr+@!)iy)=b^hb5yys^SwyY}WxWrN%FSL}UHOCP6S|=Bz4LsF9N842Rht;X7_BN) zDaODR3=G8}Yh25b!x&|Cl@cMg^qZW9`Wc>;6(c34+LI@iI_N7UkIt2~D(#hy%=>)! zdcPhpcZCmJ5KoZTJdU3}zAq4cGOtU;bc`W_>4r2DG6!rqgTQ=21ZI=I15tgXDQXQNP9mzLgUBCi0=ufs2uWz`GbqS#%)`_q-ohMpGp8 zJMk^`a@iCf*`GcQLisEjcou!vzWb~jv*_Z5F1Zqfu`R!3?5$2|oO^2Zr-{BhKiX?{ zRQxMn1J=Q!?(VhM2=~kuhN~CDbSNShUvg5Npo>8@`Q8hALy!v9RN<@Y;O8*H*Nqr& zz5sgmh=5}&&*JZw)U)XC;)-F6(lSl%lj$Xd`7-$u{!Dlbls|GfKs8a- z%e5G-kJ82~qb>P3Uf%Zur%ipDqte7YAAE;cfG#dCpaXvi$P{p7e3Uh&HmvutO+}G> z5Lcxc5&Qkufb3}NrH3oT$HU#aSx$psBNv^#HcIH{vWSuE{@}R;v%8S8$^R&%goRHc z+PzFt&;ID~e8=|OF?Fu$(Gd2rfuK!RxYwE3k;52= z=WHRfC{wx=0WgRMl3&cl%rTk7YMd#OHi&FzuIRkxy^zJkV6ZN*0Zu(z<2x++bMIIU;3FO`oCJU#DOz+Iv;~3ed`UC zgqk>_>X4Jk4pXx=v^hVL!JGWm&d#rm-jPNB)=ua@{uiu%i~~$IHjvpe=|hp-bV+7JvjpSk35Krejkue&z=3<((}90SkRSoqdP@5xt=zYGiw zb7-9_HbIc_lL8?ExVnhife2Ru3A0!X(QIRGeNLx`@qbs99mVty9$C#T z)WtG!N5tRRtj4%<^@Imkec~Dh((5E~{)-lWT`c-VUA;0JNdcdlA)pK zO89bJ9?Q^Uw3DVGt|qp=53(K|-vUaS^?3W>XqqD zzLc7|>XbAoRhBWaRw~NC=bd8}N)pSadph9rB)*6>x(?Qa>FX?v zJs5#%-A!TvJ#9|Gmkt^t@4H;2l%{^@ZgWl2QJ9;gWCl|7go~y_33%FU@rji;dy4!_ z{webill>(=_2BHdhW!VFy-Y2|*<8UryUF`ZzPy?c6|zSYqEDAIYT&#)>A^VIHS)wr z4@R}DoXd)hTs{b+Lho@(VP|PTC0*Dp8xn9rCbHt2>_llC@WO8*Qv2wE5VJM`cM$5? z$-abEg*=(Am*1~=$6WP3uROCJnm&ZC^2nwACG3NO9`*sOsI1T~b_t(&4+h+dBHPTz zuJVJOI3oDw_g6WinEv&t7Op+^?@7Qy-#OH$VlM?!?0YUq2gx$nd9h9M4lL6tv2`{de#wMGf0EK8kJxy>c>}BJIeZCKn)%j!KAZ%^{v7hdrzV;`}soK&Oj|E;* z>CI0%M|W>pwnaTTV^>Nm{egI(6W-E4fe*K1HC|5$kSN`}jEGh= zh!$Sp&=!wg4lhpB69Iv;NtOnUzlqQsQTP%p{rY$_y=&rtI(J+vDu9THJbMmjZ{yX8 z>{&{s0+Ax}`pa-(uSADYtqpCjZhGT>Hpme5Byy_r*vcjvfCg}JDcN=cphX4-Zv^JX zF-4lEX0{f&v144ExXj*@QI{`vA#vrBZ@U#QuGpL*8Z_FElX7PV6I|p|p?MtGF%dH& zE;#>JadFlazJ1akde^aCbZqxTzUxfi;btxG&{&uSGf}#IgcqOXuha4-{Lf(^A1HJZ zYG7YS{tmayhof@xZcq|1n+#wTv-ctc-@ z7=^VzhfE-6JlJ4K&Khgk(wi>!G4J{<`ixaNR?YXOYhPIpN0GSED_eheEXy#N05{W8kk}j#k9oKsFnoX++X-vKPdq=SOQA27h}q zf0X7gLMN%V;@M;lrT5A zTjV$#32WuZYNmXARCedFvd!cGwE_e1jf1w^!*TV6BUK{8!onie2Ce}#f_^BCpSf39 ztXHlK4e*W>VqUvDu!p8K6sAuA@@RdK$qtUSt~x}~qicHIulOXoMwF&VBijq`LwnvS zRBV5rHm|h)!Zz0Yq(PNJ#DIkJA?~{+!6X`QSj8>2s#k=uew| z#Rf0&mdR?O8Qqm@H>2O|*%g^O8s|qCwRjnuQ2pW>#J+V$QzxTjE9bwn?~9Dl(6L&< zsFL{S78O+n-@SVyf5T*DWv7eObVO5+p_9(s!5y4*uz#&paJrs}T;9w93~&i^vorx0 zpa-CT0rUnNxK&6ZJc$q+(9%l-bJczL*UoAnv-%OpO>{lZROjm2zw?`z@=vbbNoVWF zt3{d6QMPY({{;=JR^!X+wGnmU^YS1J42-X9mxsn8I&X*V|1OZDKSCWd?C~nvFh`~< zx>WuZ`4~4ytl*9L;`%!P*68<|rO`PNO+Y8u40PsZ>gZ54N~Q;{XA(_XNO15ne^_Uy zB4Y+6(1oo5d0}Jj!;U}y%y8O8LX3WSe_}8w=-ykOu^BX57pkV;o5)&vzV~f5lcam! z__yWkPuAvZ0dvP_aJjzGmg+G`hys7+^xjt52Mq)mGXE4Rh=Z*PVTVV-<&tK=W?yI! zUcN!NPF(j7h(%Ih|0J$9c>-EnTcaRHdqfvp1uZhGRDD2KTm8yrYP`XH19t+`>>u|2 zw+R3Dv6Cei!}PrXzS|GFG>Q|u^)i7~nw-k?Jq7$_q6#Yz3L&&7@BnhbwW4qRB8#wY zlpz5EVUcFQXlAPD;~V6>T;Xiu5NWBS`%gKvP1*p|%1{KCL8YZ5mJR%WOP@hgQ}c}n zzZetKqFWU1*GLd!#a1_T@tFQ*uQ^QHU!{>b*Ay4L=6&KYR1po{McldRMo)0U^5A5)^F4jVx1^8j6E|g+%zJyXJMq>6|1M1A_0I z%Xu|TeJb^xZB~V;LGg$@w5lP1{~s&JjNB{0?hzYU!4ZxaCQv_Z5}>WSi$UA;sxkn6 zW9Ld||#he6S@>Phju3dYh4+@Zqp#QE__k2wq(w0~3!N1d=E+W&&&;8FZmVkKd zLs{X}gPCiEIv>L^Y`UUdf}wYUL)q-_i_uEd=%b_KVX_w)GyjY1y@-tal#(Qg8hJW) z`9LMPVq11|vE~<(c^F1<<4sn@*0JuF-#2LpAu=-d} zG%c>Fm-Z(dBNmKb_;tjBS7HPP28!P?uHU_GZforkb!bJ35z*l7DC$_6hU3&MT<~wh9H%9wU5$QKL*KinD=r?CTB+Bs?8gm(zkr*}Y zlDbj+_cQWkc_1BeU>PHXt4;+$UHZpXs}q3xLj3-)U;x1oWL|ixfXiq>RK2h`8b%W? z9fZ}-TG}xDLv3M%jCe_8Ah>bkUY%;n-3gjBtKQ^68`o1HrHuCg4!^81_w{kI`6@|4 zZp1pCDzq{W860L$#42lb&E@X!++vvih}_}RRUu~)bQ`?PIQ_5$ValS_c1Sb)KUf+) zuw=a$fKsI4n|gLvuUt9u@r4Cx>OG|rMm=7KeiqX$Pe~l)Ax$9%C{n!>oF;@a=@v8o zJay!H?yG9{x1FyN)kZg`C;YJa{)datYkX%OgSh`Fld zIU3-f$V|HP@Wb`sDgd>&tsRiE_SrEYo8sBn|NHwg4l(Ivpnl&}KweQ0YtjTvXRwTA!NP1T5F1O*)1D=%I{;B~MOOI;hA{Z5&GGAYQJ3rxJe?+b8Ul_Zw;J z)u0{q|G^2<5>QZ_S^-aku#_M`(e#C5ItSYFzpHNYgg1Fa#|eT*E+8yK749B zomt|UgYro2lv-GHonQa|nbwJ=K~}E|c32KA%Dl7cF6OcAz+q8^))VKyfR8>T4e z%D$yWEQol4@6pjRm2CV&+4+n4N?AS`+|>_YT!Psgg!(O>r5r{dB%2{Cbwfbho)Udf z^P|;|H_z)$OR=S)eymDekeG;D1g(nVGo@g)sqnKW^zghA-tI~T4zPN4#0)_EW zdTWP!P-5GD-#|;4*ZV4&1ZYPww5mVu+TCy=tb}(D2I@5K{cqg{k`(Ch1l~ZiMB6?= zzgE8bQ(=CjEOK@Xs1Zn}>fMSzt}wOwgVOI+Zp|MW>rXhDU)=M{(HW()Ug)S*f;u8) z;fM8-%}3!0{YEc3Z>gzGcdp093O$rBoXpN%-+|FhB3jRu$Sp%p`6eh1MkHbr zE8g)8@oyEBwuInvs*t!yqUw=*+BoyE`?-+!27=a%Cn5ywrY11IR zvOH3J(BQed9P?ny-d0CPM`J^wl@PXd8tt!KP6Zx7CR5-bt?mE-@s7A_Bof+X3IKpIfQ$kFhN$-?4$rKTe}IH} zTL9l_kHci+*cWao9t1WN6Kxivt`^L^e%8|@a?r*R>iobMD=p~&+x};xItfQQ*RVwD z!r7;EQs=Ghkjm#v{3(YsH<%}(3ME=Jz@jBRw)JhbR=$jG)LWoICoK7+;|E=a=Y%nm zXARa-^0a1&GPP3&7fi-pV(cF`#vfD~uqiP<_ukXHP|4(M+N`I2SHjXBLjhOj@;n)t zK+9_x#skk8sLD7_CgK;rf^rM)J#$?r?n{@DcjN>`)SJL1uY&HYK?B??RZvlq8i&De zZ@_##kWl-|wLrUhXyS%@>jO=Zq5P2(W~M#CbGxC7+q)?*ua z81b+ntdx@_&~+ky;gd#)u46Y1PsBKVBl*3=zy?@V>qenNo`X5fHtgxQw`gCh76cr| zmluC@EzToYN~v{eh>Yo@`;NJg_inaM*~9iYSF0&xm+-JeP4oO5{vd^=I5qYhguNT) zp*dziQ#hqSZ!}94Z;2X04Wv z;iL1YRle+7f_Nn-H^g!pA2SHS2HvZL2ei?`6>wty2SF+bxeZpbRZHqn+J9#yTe+}< zgM)jEfmv+_h8pOb2o4jC!(@z?HpO)G^bLnrLqfLjYcz zAE&6;c?x8Z{Kg+0(x%Ks$-D7sMlq2daZpYxpOx#B znHnnVvd?ZE!P5|Yg!eC}@E(c_mX7iwO>0BElt9A;-Q}R;@+FGSl$kAICXlB@F8;K)aj$ru3+m&BBvf`H(JDJQe_=6bFhO^HA_TjXfQS{fGHjO~&t+N$Bvnzr;M`q-IG~JQ~5mTlOr5w1<_CYvy7s`4UHelmNC)cJ=m0JBV zq-A7oJt%(gHwCyzZ1~MQ#IXzExeEY)PK`JnUG_T-^y#;onB{II?Bzj#*-J=` z8;CcN5XT@lu^U~B6rif4U_^2oW_R8IFGBZA|et5COu@pj;-vsay9M7!Z;rT z6Ysx#VUdyQ6)nJgrVM!zD+vBoLVn>!ru%#V@H?o?wMQ(>dp2S^Y4{$B&n@VP=qkVVw(O2yesJ503|D7r|o}fB+cky;i@_EzmsW#N5!=OH^yO z^R>B3t65&DD^@J-$BdIC(I!KH+RSas$v~m)zey#iMWy~fzXdR|%O+wk|Bg}~e08Pi zS+4bX3aB2nNui=)xL2WwULP({?m#3};fbi8#=4#SPF8rozab|Nt<=iU05_lMcdq$) zu+eh|p}%v$rJ$hTfcE+rggDZCrMDDq!pHM)b4Iy#NJaR`SY>YY<3YN?f(Iq~v=A~z z@je=86!+LPV>PJEaTqdyZuDF*2l4%XhO83L*2Bk!=jXcSbaww&qASszlW#0dE}4(x zRk`u}5J!Q!vR5e9UkS^yC-Eu5_jbEPzasFn0g(`V9^=<4wIAiCjyAE?cY#(F%1ybU z7vBicb?-x3l*jU4t9**}j8KRsjPZXBd#;1TI9W#P*t?~LC`v!&iAW9QLOVGhBCda< zp6f>j)9$hGk%e!wTjmk%;z(Z<&(Kp?51Z7cjz<8g#O2 zl_S7xGe4{$q4td@19)5#riJAdtsqTV>AqnCZzN*8&b4Fz6lm)fDmtiC?!AY!Mh{5h zQ;9Vg&~(pkgk`b{_`x3(+?O)(J+j*Cg|P2mk{392#?=Cd9C<8GeFvqcPLkCm4cOwuy7rprfMU_?% zqKIWwA@SU3I?!?B<$l9!6Dcb%-(58z&R)P4YUg5x0vf|n4QTVrf!Cr{sKtmd5CUsh zCqU7gKY-7$*e1hkm30Lg?P5por<4FIj55wC5Yy#=bHPT9^m~A~7>Gr!x_DeYGH7^K zDtd9c6U${PUgxz}bb2@!#nutVr;x*|;{-AJj8%MBgmlFcNL9CC^}p(6Lqv4yRZ7f# zFJt0`AG`zP%C1yyROb@tC!gCS=DlBVH0ycqfw1e}gZc(XU61~rT952Fh=8Pl?A&}{jD99S$+e|qm

+(3yDW_fUSOZ~Zw?^RcGoMpr=l z#KbsgiACrX{KzNgLWXoI3}TU*2w&zls;YC_a==!MGkm4T#sJP2X$1WoEm}Ud{k16; z*IPc!ye(;SyPyxuySD$sY&zogRH!P_2(NxPtvjd|_1e5|_p!XFY;;!_`aXdj4~V>> z_8-H#y#tc_JWs;MN)Yw-z4u5DoCDD~M>XM~WDKblpu5`sgh}1mLG4$P!*coyf;Uft zWWv3c(%l&#C7@hZ4>`!`)vv9sl0t5)@i1^n^Gw(KelS~t13`%j$1qy+&Ly&|gqhD^EoJ(^9>LNl8+lOq27xWLc%;_P75)$mI# z>E$2RzQE_DJU(2MCgm#vGH{;3GH7&IHTa6twGKq0 z1Wz+yewx-0;0a4jgree@Tud&-m~7c*7eykn>XTA-`nHG;ACAGk9TuMeC?nw57ELdxjA(04<#Uy`;%1u3F~T+G14!$rAHd?(FFz0V00 z2N@?L&P$BbD9I1@V~M~mSal9WkRDNQf>s=d^ZH6b?8#;gZeyCxSbzm&cuU9~g37zn z00@1oX5aq?tDfYwq&qYa12$(;YOTiL4|R+eLMqB6uAWl|obW*B1hrpRSCF4l4bwud z*4dDF2jnc5Sj{d)A^|m0W^D;DDI+Tun@mV>J&v(g;|tU_r+j?^on~fPcB4SEIuC?V z+PaPRKiPo~Q3<2%eouqgB-vzm%7D;)_k4FO)}pk6G|dOnA~!PU{6vLC^R zFV>_r|2_rFT2w?zPAWMqE#oGrs0V6BZ*-bU)Pn}0|NE??RSL~WLwS8I3O8U@S6GpK zA`I+fG>6_&6=(TTphgX%z*559k+-Ub_VO;!l2+UEU8`d6r4qQqUl*A_Hsric!odQJ zs2_;h?mxxTUHbFTWr*x+JrE)nA82agB`kacP7gZxVcmq^^5LX}a5#C`G{Ico9~vv21PNSG8}UDbDt|LA(pW3R zTvry>jC?)6AaICRk5m42?(A@B_+S{M@?gvTQs)C&T3Y@Jg}9#kYS(o?RA0@yuKVTw z#I?Y4ywJ?k)fPtXQ1@R)$kmi=b=f(VxHFAH*4Lxu11i`W8kN0>pH^zLZN5sFXDU zzmHa}lX)B7&Ee|2z1Mynyx;|B-<+r})@X2BW8$+LdEaIFl6psyPgsW!$T4-~FAJ#o z$b^G7sD*I_?M%PgBDjR0(wCO>?Tk<<5mnJNP}wR$Ip9aVakV)xYSE`WVze{2aPu8#wjOn>hu_6;!&IudAfwzgAxS<|mQErwrwc0DvNI zAfPvh5yHjzvAwM1FCagT8+Yw$EKb0MM6kC8vtr@TfffwI5B5iRmdsdc1hF&iC}@UsSl0OzRq}+|H%Htl(TqNCVAQ?TVmjrF8~ zt$Wo}uc2x_Gy*jT3pq2_Rp;=oQ*_LldCB~c!W|mxXkNp)*qcqbuKDN@`rd`tH<8K| z2S!Dk7dD*vWLs%0`F1oUHN^g?y!~tR5(Lq#Xt!=9mEw}$D*)O_Lr7SbXy&V@f5xK_ zbP^O4tkosS|NNKc68bNixB5Ux=DBX{t9rmGme(P0*7d9ZRoX;)=ipcXMdk17*nREa z-*A+2boP$lmxvl|UzAK7A`*1+pgwDIVLihiN~wO!I#NhE_@qL1l?z59gIYAXw$bu zeQ+456$;mA5bBd6!x}c@W}g)J=W%xA0O38*sHv$3-NK{t=lku1vtCC9?j9W6;@RDp zGNpLlr4WM$#Gw>bg}29VhDSw>xKRx&*=)Ecs&qxQ-684L7Y06!G=e!)M+C(6)9|Rp z)ACU59d3E?^{9>*d0E+Sz>h3$mY9Lcdl=^kWc8*+jli(0!co6+^}6f064#xT@DLH} z);XX}MqQkr;V(u+M&u5JX=OC_do&_GzcV_C6#mZ|iaL zxKLaeizxq~GRZDC#EI9|e<>%8&arH0@G!PCC_<1kPR`_GqY#UYuijQZ(bXJYMjdP( zBElSAT>Hz4HsmaKwc>Hn8dc-fSP2w`p*~lsN=#pPZrx;DioNs``XDrfwk5ey76aFM zj88nBUq;kmZ-$tNvjE%r=iJ+@xvV5LhshmLxa)b=4i4(bC=~z$eome+-p4F2lD#AjXHAj0f{rbzZ>gJ+?ru`zNn(yRskB`^NL(JMI`oKgm%CaUFquzld zGXjLjTR-B{hoLq|HviuGdfO1mQlW^+4tNM%#v_N#{7-+~2PM%)(OV9)9#dlbCpSK{ zcLb8K-1na})wp%CIrF6ug3-Ia=|^jz|D zIlT4+Aq4Qiqou7FRTXUvvO>M3Xe=-`@ACNC```NaS^$eiry5%`P2^&d8a7ovqg7LlL?F4GK%Hn#D^P*~W>P_F<#t^NGk8oR?1 z{aphll_&ZJ24Oz67G$ptID%H{BUaXD`b{`0cy6tCw@c7t;o&hw=E9xLR>GAG!;>fk zUv32EGHnS(&cMK<`RQp%j?fB%&WRRCt4Ra&?}V9f% zr}ZW@G!)+GLAha#GRmGE$f0VU{(eB=SZ_aecb3zx{uAXipf&paTN_m)S5 zNobEe?kD269L`>+z31XCu>Kx%MfHsziKW#8I_Sh@zlt{Qt(!LVi=rQ!kd8BOHGdvuJ zlKutoa|PJjvqf%QH|5aTssW8dzbk87g*f$QF6=59t6*+Bp303Sk+_(6~ z`64i>BMcB8esAR@&O5{4`2MfZrhKWy7njX-;bn zl?njQ9(NkjRr;Do6`X=e~*nBC_doO&ZQ7Wi<0P2uz{j4txiW)1!#dT z07{WU5=YQ>)n0pcTYQTL5UkP$5`#7)n5TNHG9^8ovaP-S)jJ+)ai3({m2e@KzqP!# zdrTXtenjm&>feY01B*5G8nfebrP2NS(FAKA%aMW$QAfV(W_rNaM;qpRz%L=u;-2?s zyp9(TnxaqS0S@ny*w-Hws_j7+{jroAWc^2gyys_U>CQWLcD7Q-mGFlQihg(HWCo+G zwN7KXB9~;l2rbYE6qzoq;H08qNJ8_xk+HG6fbGzH9LT-2U|h1tk22#gK+)k!$HG!j z_*KQ+i{KKP6%mL-Z#}KuO++pN>FBPE!FQN`57E4L$CeZxZjFR*2hh>WjS;l=$d1LM z2joB+E#=gXupr`O z;ODS6XGGarDusoxCB_0XzZ`QpL}OkbX+1kqX74!=adBQ^7q5(2nu{^KRRaT8wNYd$ zj!u{YkqQF(yT?ErSg2p|$kM_>21=A}kdm_0yEbvfJByFcL@0FAD^8h~LvhGRjuJ7O z{`8&aAvhRg%PsK&DtXU8#dFlT z{rMSFy8|~wGO2I*u;Nijr>1~DH_%)2@$fcB%C$he<&~+h`O11-TderVQV>gT}8rNOXCS|U>!vXkYg29WT70%kKNMmhCv~qaxW$MaG z@1`oQ5PgO_t`f1UlH8?%Fs+!jMw(4pmP?2%_Xm`clS5PtKbW_RC0}9-B7KAv zFo8lFY*&Qp4fMn-Xav#J@H5-R*mSWkFHxrkWKjoz9%nYiT2Ym-u2nWcHd9RXl1UAL zG4F*oiPSI4$-k%PZO(`Ww3G#l>gS5ELxlhjDr`g1pWPU@yrkfG~0x z)`+W0aV-%O)`*F$vEXtxH#&TAEb{`DC&6ySssU@7H@GFchX&sz|9Qg$JO96WwU>ts z+Uxq0d4lYpK4qn$kwlqE08@E8GtUrZG$gHr<9en&1>&ZiQZ=!sg$4_1E0Wt0EpT{M z@|cF^3Yvhx#~{ctmF%}%oDG<~I^wZu$M)G9)r$eg++wT5w|%3X5>A|r9&Xg?ikz@5 zapz0agGLYM?frd{IJI=)1i(S>?5g2d^P$%0HO0x^nnHBHj!Ch}@szE`Cq|R{cU&{c0< zGKhHx@Z19><&kI2!efMwP7}?995pg4sjv~IuVUHUonQt{5D9MgP92nwYFLreeMSdi z$hhRo$t-43LPLzsk)FV+{o*Pfg<@i2BDE|SIzEUr<1sQYB+Cl(3JBcdVPs+=PbU>l zC!-W1iBAS$4MVf=k|Fd*S+m66&A{ZEu{5Fx&J#xWNGYg~ExJpqXj8<&9*d5qM%=nn zme*6BJinDzkgP>}|37R6LG)!bclU#Lpx;XyAp;>I^ficdi0K?ScgX$U<)?1iGs*PkyA6JmhAzKmhwmoysTf4uj zB9e^v#rD#GhLV!f?(T~AtegH@i;4&ZNR2+;v8E^w+n}{V{QE!0wk!|`BWL0N|95h< zW}iMAz|>*(I}nn3z$!)GFMt7_<*g?3FIUq&5-)Kg5{OtC-dy=?ztb&DPft&5f^pjL zh4LqGZ|4k?ZJ0rb9ngY;`5q#Ji3 zQu}(KV*cih8}W^RIO2kr+lFrW`NHfr)W)P(Wo0GNtN{vDT?@m(BS)%jwYPYBtT>sa-Y?x`bsJehCcR*5}b{Oq-xcH6bx3dzHid z%GIlRDQe0q2!yJJGgm?)GOXM=pO@q-YA%%8 zmqtTFV@pr`(GJ*y!gd}=$*~#LavzLjn9H<9Iaru1SD~>L~8Nl^L#vddNmR4Ia ztCA?s(B$*k^9|-z{l5{lk!a{Hj35|g2~tL^pnt#k!kOH^jaDPNQRewaWltIMK2H?> zIXc<)7lT<();fE3`mjk!;e>|}pnS))7Z2Tz(QE;X_t&1D;?Dq!Y13F6yOC5HR4Vkf zL9R&Lj#qtVg~kW$Q54AgzO#I-G$TgsyJYp+W0<|N0&vgPI#Ek_&f?yYpc)mUa{OCD zdij@8bqznE3OfYrdyy`CkzP5Kkg)Gz5bOH;_K5*hkVxj1X4<$=gh+TUACR?k)JJbM ziH15jVe&_6FsJJlYRRF@R2*TvUNCUPC2}OSwY3cb%8PR}Co2aXGrIwHw{nIr141AX zj+Yj4@K;oYYPwN5cAnUnD;&cQFA0#xfNaozZr4fyuYzNE*@+&@-(MBGV8PQp|H4#f zyy~u}VAGMDCe9v#2ibA5gP6ENpKFs)0{Ufueue-@au!~XNl8XvluV3|M*;w>JB56W z?Ynl2n&e?{%O0Jco^pcVe5cLUzjIfzpXMzsf~<7xOY^%aJ0Sf}$Gsd`Ji;@xZn?F! z6(7C17`zhy525P{#2u)8OqkR8K;emBoVq%PFTl6jD$;#?tijD`6SGx9%DJ*&0%N`b z$@=3&dIdbMi~0lL+*5GK5OI$@6#RD30V;4A2oXmh5?}Q2BPV!qLr}{d%k^ZkQ3ytc znVg+D9-w#|ag9-Z5M%kbNmt?mvS(FH_>j!vdAW;k$I{TaCFYNlYXSOzLSYiyUx3 zF3c6xIaOd0z5zTQnjcW`UxbJ=#Y~ri=eFWs54H6-?GwWuP68h<&QG}dgzAQGQ&)5a zE!4m~)-7kS#s$F2Jv(=h%S*D7+y&_WUX@;S!8SZ3ZC_lzSTxx74Z}NJGvCEBq-sgRj({8=Gd{j#GMWL4*IaQf9`68OPgy?pjlh1EBr;|u^KsjJsOGV+iIsT)cY7@>Wi;IiWg2)ixWY#Q1F+lX#`-T2p6x zw+a2Iw%;2b=a}lVS*=wQCytamsD(kJ(eNyD=JX8+ie5dhvzxZ4_xGh({n}N#4_?H zHX)Ha@{Ej(8w3QB&_|UAiu3itZbH9)v%pCEbf{X27e)(r<2o}n$&q}Ujs>1%X_CK zm!XS5^8o@asqNFl`1^l#J#jjyf`H^^zAq>wG#017-x)F8XuQXb2ts@6K(SX0 zCU^6vUMuhNsbq7pu~C2)-S*iJ2Zzi;LPCcP;NP@C`BdIZi2O4&Rd6!ZXI=9Pb3CZi z21sq`D?=u`rQhZ5pWyu8C23>9Bjd1NH+Xx!SFLW|=z-XlJF{TPmW_eyyg6Y^L~B|2 ziT2s(vL(yRS0I?rC9RH!azTOugMWhpcQce#R+!xj7AS}NS;}oG z>D>sg3c*k4WQqDAEp3dhs&w7&ps+{)u0{jbWByJ%`}GZQQnGAncl>wzg%QTqwtFpL z{vR6dI&Sl}pzqzgcRWuXPz+Yddi(8bh(i-nQj{U;EP`kor!B%lyNDVH|M}3XIfMXM z;Y%<{rQ7yt#6@1lO%N<@`eh)2o2+pY3yqehF9Ec|CXs&A5Dz2MvoIxa6ze+c%SyJ_ zuAgO9Mqtd0$IctBmz6WYi-OEDkt)oH{bj6385@ExqfC2_x2iX)R`+d?LT~uZvRiv0 z-p|xAxrIEz?-EV&*~^=GcS*Y~FyODU=O|+l!B3Mzf7pA|8%l?7q;^je|2l`(4?MTl zj-AV{e`zHAi4QLcH>o{qVy&eo8NO8}?7LvzY;h%M@-AEMAwVU%O;8 z(a$9hfEp%)Slg|@KwTubR4ovoV@1Gk48f+yjdTI2WeOQNz6Ij9bKI46RM7ZlHh;ks}4qdFO ztDb;du&1Xd6l5|LNLbW!U=nYW2j0iu_5SK&i=vS7v6^q~RHpco78Vs1#q@#z#NmJ^ zz)nP67X4Y*($5jlay5??Y0;TfS%(r%A7F7YM*-umlLuM`eYLf9QNzKd4^WL1dO9c(p2EU(W-T|(zt~tp(79${a9v^*H(36M(4jJ1D|9`Fv zp9&y0EN$%TLa&-0PcNTHyx1+_p?{Fu2K9}jpe8I-$`xqDX zo)uQ^P*DCH{Y`t+q_N0XfL43h^$NQ+MHa1LL&wT3v>*n^hrm!5fQon@V5$bm%F3>l zl#d)UkgC}Muu%w*Zu7fsxR$w%UC(v$p38?4w|5!4Jtd-r6Ln1^l}~~CX-`$UGt8=e z1ki>OSDV{YVp=%F?7(GFX@9l^NzU^Fu*5UooLTJRl*|;U%142>5F`*!sW0~oN;Q7q zBD>eMJHTi3KE8<^DPCs|_TBTwa&!R|1l5e;K9LC8Td8c7$pxM#Ng+_R&g>4)=Z98* z9D3t@KIH7JE*Z>~o~*Q(!{n3y1JDLvjDl)60<+; z(h{n*t2Pfnb7-D09EdFc(=^d8j#VpbjV9idhg$IVby=M4jaR0N@}`hu(Lr*ykr(0` zWP-&892_z~WxGPg=(`t?_kX5rNgE30IsRe=b)n&+TAlc<)pg5mnHOfc7i_BUCY`ly z&yhiW9xh);f=33w`y5}4R34#Ys&tX~^!75LFktB>=nn^PN_u}7%`1ip;1*CRq~|TB zqM9-5-c1&Zi}y(Ogx+p^r6=7ER_+5F(p0gpVWraa{Al+IS18W|eS%dhV01*SaPj_n z#5>c9n-~ZdllR;R%W*gt6V@giiISY5j|Wn&NXU2M%5ez@iommCh2DV^R{Y7L-29rG z^$MK0?ze9rBE!7Dz@gmX&1gsmhLtRZO>699%N8d&|7^b1 zhZXv7#y}Va#0X+WDX;q-XD|woElW^!kkmx*VASpV*k0UAXfpzFm5*UUa$WovHmvFk zx@iV9=Oz^js2z3JH?q6ACECxT*5OD6Ux2FxVAbvWpFVyJ70){C`c$O)0-m|Q>j~sC zY8C;9%-<#|AEgPqXhK+10CbYDdfoRnP=?NhNN(f_F2xAhd|X@{>E!~Lp(o@9A-eD! z?JLR%mn(OOV@6E)^d3E9|9*$T=5Q%f6rwH?l91?VR&jChu<&qxH>PzS$b83^Wn3K) zlS?uh%;{3y)@8xl;Pv$ASNlYQfv-TL(*A&%4{s>JttvxE~@pJHH}KG>(5^}d&O zyRJ5WK~o=3guf7A+-^L$k*Uvu{iLPM&@+IuMFX9qr5&hpw+kPC7>OIu?W83mV~*;S z2so;X8LqozeETx@Iu{d@JoRWQP(>Lcj7>~Hk8Utq+{+oTZb9H|h2oI1Nh2m73f#>e zvq0DgZOpt6SbYuj{9m`4KNJVrPxCP#dK}Ntd+!LOnEJD&vODvv z?T~JPP-?<*yo5Iw7$(Gd_k5Jwa7XOuCYh{15+04V8lQB{{? zQeu?FPee1W-ZUBadQivJs7yqN1uT&ECi3S0Z~@k|q;W?mN3p^mD6Cq1%cB@3c7>!*R{|Jan;@-j%5)9ujpk2t)7*?&%wpXr#U=aHcR7wX`2c|FgDffOv`p|p zwl(ufHAKUt*+BGWe9V9Dq}dbbc6<;plY;mAo!M}-H>$M<^GmT{Ug+%Q4*($p${f$2$cGFg$$NE5z&aX*=AS_>gU4zl)kcog6 zH!v^`FbP<%6#11pp3(50-Q_51KtYl^lTmnIz`5 z$#uLsKTnUoGEf3QYz@Hp0`F9`#1<*uL4KOII+%?RFBHbB6Oiik^#WBg_j~sWVNl>G z_+dS>RY*&6FQ;w#N=C(7z486Q@zSg@35c7D00$6zu-&Pc5Vjl0xY5?u2G_n|WI^do zDr@T)F>W#mt0w7!waJ{_4D(P|*Hd6x3pY_b@+=g7(Pxge&Q-nSN{3|)U|BU6s{I>% z%wG)lzsj1pO6B|IqlG4#=UE#|)$>yP>USqcyQlZ~Rv4P1F62Bva8*?fGgLpqx=xGc z>f`De;JYMxqcQ%e2F80w3%tz!B^@gHSOpZ(GaXOQ-F1pN^<(OnzpA>4UjrQ5{WNea zpP%NiJs<5$>=S;JN2l#N`y89$~zW;tl zs8lr6Bj}~z6hW020`pG#nD{5vaIQ&z!wlib$}E|20D$_zl8=H+z&b1gB>3MwQv+x6nlUKz2saK)J3%xiCAPht6!U|@CMo*N z)H22OQoMEbBpVrR69lNh)mMxv1asSWeW}v<9NdOp`m4<5&Gs8;_o&f4!SG6Xq?+%44Ym=16*xk zPZcMxgR-4!smVDjbBTNXV7y_ih(F z^o&6vzmEm`S3v{_AbjW|j{6S~AQ@xQpHw5ChUGTi0zv%5p$g$6WAz(gpgC-x{O$xGg$dhGsOFifv%CG zC&0D4tQf&|1a8Wn)zSL)brckHIq5unzrXa}?|U9@#hXVwq+-|H+`Ld{B*}6Q3K+6X zivxBI+hEawwew}902eH81k`e*4Gaw0XGe_WZ@ls5{joWFX(V+o@v$ch6j9-YkR^=7 zK#hQtV4=Cu=cEnmix;Ms72m&W{^^=sz|VSps$`EiyT>6o$dXI98leX^o2Y*+=(M(C zG|whqa?~h2iyS;%!1-AOZ}mYj_YCSi5*`@;kgcJQF-G|qi|p?2Ul9ONvc7?!-_p`N zD6lU~78Y~A0nsh;oqZfmssuG?NQxtK^YYli%XiyCg`fz+Le|yYW>13}d!2t1K!6Qva

iT5v`)a0jDr8JPgvSMg4eUv&e+Lt zYJ1)L-dKE!?#{s>D?%J#l*dFKRPl1fgCC(o6BXTJe{A>aoN5#*Pd%_Q)KF5}19`6@ z`@#klApR$0c%L6ivtW6zbjL1MKsw#VYcCPbKlT z5Lk}Q%2EVOGE6d@76p9RNscw zSJpYNNx=0er(ZDSLL3D*4ayKHyW_AC%UUB&u!>+M+LUbexg+-_$4gg4&mqqk7)XxY z-q}9foY-acOY56uNykwvKm4vQcHgdf>_o2N{p!~zG-aRUV<}JndaDw)t5qzG8Uf3N zt#7tjQyt!)f9pK1JA+=*YMq_^V+&Asm=NAIAL4fXEl(DDT3RXiYdABZzSdai*?uxeh3 z*OF}G52^W$2dra%UU95^NHQpe&SNPn!HRo2@m9-#iQ{L}Jk+f9?n{ebmf|+PY!@JW zcrLX2@2zKI-dfP1HxqMTyq>LMF34<#6_1#Vz*y`)x_Z7shiI*r++1@R)(^qlgFVbK zLt$@Y*Z57wP8{nsPUS0N@c6%K6ppEHz={Co)O-p=Ga|6?+GeQ?mnMnlo%MlmjddT! znA}L-Q8l~;vj(koUlgm`zpmWEo-JOK#9)5#qI$DiH67jDn=N%R0S$a&F#1?I9Ub#( z7;C2GLH3vNa=Kq@!+D|ddyT{7owAC|F;m-V4QBufQ3oz)dY`}vTGpKttgLF%MkrCEm&B2?r} z*|9e)?lTH-FuwRKJ-2CBV0zx;bWJSD_dNJ@GkcLF)iA|0f@CLc9FktJ2{>1T;S&Rid5{a}94!n_~e`?cx z$5L}&mO(hZJrE<-sL~6rmxAFk>0t2rlrHS?P9N_jl7}X$a!P8Q)~%1Rxu~0_PU6WE zJ;dr4Y%-2NxH2O*@cAQYdu@@-3AfD-;drURf~bfXOyu{Eq%b5^n=PA01ZQ^Z&*1*O z+nv~G3G71Lr)32``4UL^k}$tq6(tGizf_gCLB2B4BvbcWWLWGvj6*Mkaj+QzE9%j>`6;ag@HJYvLb#*2is`Iw4_u~*JyXFeAY}i@&|u@P=ISm$K?A3 zy`XUg)u3sh4Rw=Zh$oPFmkb$hhBW{P#Aat_A2bJhvK&f+xA@1Uf{C8V#8~gEd!x}r zmCvtdc;@R@1bN8H`QSSFP^YAbf-BR-sOQC#{*N&P?x)9va45SqlK&?$ov9yR$y~yq z(%J)xGBk3KYzU1+e1BBM>4)Fr(dLWhLn$U8RsbQzd3!HX&Wd>09m0BlkAEQ4i1?^7>`YBFVm5#&sR@PpA{;V~A;7WiA%sLCN$7Hf{<#;F z{<9I9-m3#N44^x{V=Y0XF}U`p&fEtr$&!f#AHdv1O0?}tc3;FY-3pKXNIHx#HGr6E z%m`Aj13;t@EGsr4JpCL2d{Tb=9xn?@<@5V|JUfh--PB;A^K_LCR(2jaZsSu?RH{(0Jq<(%hd(8Dy|v7> zq?)(aa5@jmDoC92wc66UZ6vEDsaWTON#r2|>))IE2ix@8UDo}!S6xzg8DrcZNrvb% z*9VCW9|n$K`KJTSwGAafPcDPf6cwuz0K}eXuPiRgK{qpl$L`4q=FOxR5O&ET2?_KzOb}^%a)67!clD zfT{lu4N2JDpU(e~&{CH$Mx4*z^YiI{rSYw^G>7)L0zM60nB7i0I)q#*)VYwBmR7d! z0mKk)hWe6mM#2d&+29}k%Sei_OV-*ajvuE%jZZ%yCgwk+1sst0wX(kw3BJj`Byh#^ zx1@LSDK-4#Xn1HbM>_I^%l0$Zn6oc))ZD0)N8yh?9!mfYL zBo3pi<#hdc8;_hHtlixkw{JlojW#b42bT52)-A~BPTnq1di7rIn2$08i2#Z&`z#SR zSx*Vy2N0I4dcIrx)YQ24xDZ(V&s8?J+IYA@&<<&OSPzwL6A8AL?vN zZK28#%?cgjVcrh+KflG)OVBFy`8vi8$Ns^wKQ&R4gVNJy*eG2SHRL4A>LzLJ%maCs zEmhiNgz`i@OT4jgOfd1pObTN5hJZf}%Cn>+lwDoAk|$a!aFpX-B>pf0W^pEi?NuBI zjuhLtvK3Z-m98zPjru6|4|3QfYh4e4x)8*y(yA!d*VzQvzT3a1gGL*;6WwY0faQM% zRmiy2<<+}0nQ~+H_OXJQxL!x#U76F=VoB!aYRl6+OX9^afXkSDQl-A! z!ARZJMVukITZG9hDQVu`j+%k`#}7-pweY%WDqOqc<6|k}VJ^AB=))xqX;nvT;7`9w zuJVsNAB`z3-Gc@gPV-WO=XSB_lfJN6QndgPj{XJ}}MgM&jnDCXayDb@(>_99_# z5S}0~`*Cn_FDK0%8nZ9YuVMz+vIDPaa(X)4j*xugkTPU-^aA#1*U9R-q`3V@zrwq*i^hoKt^*eC;kcq0>cQ-9d;+HxjC@*Kd(~bHNHNIq( zRDX%8>%qnZ@0XeS>bmIV`vc+GExP!dW4+^BJY*oG8e)MpznBIqssZJ)0>G#;p>B8B z$h=r7C)O*%KXZ#1LNWD+vo+yY4nFZz*zV$#4Qy%_UO<=p%{`Sh=kH3hWzP8UKA&^R z9A40MpE5#Hp9D0ye~Z}GXsx~(O~!@><+-tQr%~EfhM`PMtKi#v+TN#si-Z>o`lCE807{GIuASV>4#WrvmaHb#~y)92`=d@vfL3 zv{;?+be{yaYDo0lN*m)PI*Rwa71Ujq1=l0SS1uYE?C$N6=F;H0G;G%R<27!k=nRC5 zk55fZgsk!pM2^o(8CO~H2Ec6jn1O_&{?U_Qn zvyOjHLP|{Q;*G)e&UNt{ztq3Xu)Ksufz%3VBPwVOyBYHIX;(gE57vtmv7J4=3b`q>Ky9t;!!$$Qts^f znkXxLS%8x>fM?5g3wIE#z;WKlBoN2g^Mz;UlV8v9%2Q-F@3v&0_cF1ncZMR0fZYH! zgzeepGk88kElbY8NIB?D=IJ6Fc9I*2tWS{pXJda$zu!@zl^{QZ!Azp8CT2xBJ2qy3 zWjMpk)%1+y1HzFSG%mCo4ikS;>G@8{9eUhC*$*ZkiP!Bk0FX{ND9E)`{bo>?!ixc} zZvDY?H(CkdliyhdK1uI4Ha6tX3y{AtqFr2NA@4WZT<|`$B402jUyMz=-Z|*Y^`YR$ zT{H8eyOLQMjhWlqE7T-|gM+>x5JB|QBU#YQ&LpW<1YeS>$z`s2;VW0yE=oTi3Y8M9u@eJ8hCLxP%T$%|ew0nLx>Y%h@eu<-7Ad1d!47(<{JK}_6h z!4(7nQy7pB%f{2hR3bpp5M~}6($1~|d5m4`_SU?n6<3j2y}JUnXa|q>p$)s&hWF7y zrMFB;qYFfO3*H>F^AxF|kiq!i!HL(xLSFiT!fKaT=6x>YPS%Tb4Ro1qhhL9+Bqg*z zf5n9h(f^BJ$rbH1r~AsDbmsL&kBt0qSiiJc5X1t8*J2|dVgXGG$az_y(Zg9K;6&-XfTRVpYwIEcOzph+#}`Ml2gZ)Yy$w%hy5vek^4Ze0T8N1~FnN2T3-H{QQ7 za$Q`MJrs@HU1@tuL>D@c3-LMTeZ7lUuR|BW&xq0jR_X~=)-Ec3?6y1+^4BPVRc8g(gXc|ZvXpS_DiS9s<^IB zOL8yfMSMya-K^$uEnxj%pINtxX`i<^ywQKFGJfXsBa4Bmo1IEpZeCY6Wx-+YAN%`% z2Xsj)W&n8R%17=ZB_pZLyG4(yEIV-AuG_!A40APg!!V6LIZjkC;M&cR3}<(mUUFp5 zf~?&qk#HpS&6gm10eMLLBBGbFAWY0@WjqG)u*54wnE>3|@93m8JQL4~%eFZ1d3v5s zV|{sz zvF|1YzBa1$%Xfz*aL=6Ht(Qbt{#5F#1ZGX2>?~J3qlW?cf0Y^JFEf832*cUgxux3M zpv+WMCDrvOF987ohjvcj8V7VQ{%P}_>Bs|umr z7`mg`7=1^hFwX+&0mtouL1!H?(tBccfl&F0v`Lra4pHpUo1JFY4!y0_Lmy?~PZTAe zPW)9x!?XR6{1@8ia@9EK5_?coa8zQGJZqh2#oRpYZs&nF+XGRdFrLbzA23aPyAlN7 zGOs3?n{zcTcgMw`cUU))l|SQiHZlqOQg}TeRSxtfbV?t zHqj!cY9lGBy_1Lk(1?9=57Y!`crocLK&sbf7=!!t9@t?O%2QMmLW=t?1V$v&F{beh z^Q9Qf0!-ag(hSI{K7o850}9y2{-(@yH+n2q^DfKD$zhTu?LI*0Lh1+LzBrlg-v@8+ zYSfMN28@V#-Cb@QRQB%^js`&l$$LjzpFhkcZdEg!FrFbGKRldJqYV}_*P~l^0^N@U zsRsd2TcO;pW+I?2FMj5dF963p_*%~2GBsQAThptze|UOnB{%C+CG@j=q)MSUjq+RT z&;zt}#I#!?-a3GNMPJ=~Z*&3q6LmFd>Pm-OZY7h+cV9-%vbEKuTHQt5{*VxcWP$Uz z)KjZPV&bqOubRSx`lebP20y|fiJ$=BPBwF8>4Q=h-$gEWH$y(jw>{9l3x!Q-DCH1k zb_2OVzKCygqrk7e*rkX+pyxf0Ys>FVaX0D}D9UvZU5CEQLg3njEan_Me-AnY+F*;@ z!zX~6#Jt+`H5sZXGqbax+pn^q74>Lwd4SG1abPb~irIU!0y-)1#oQJii(KiwxCk+u ztOzbX{{D(rZ>JH7<8y?D>61wIuPNeQF9q)0Ucc}h7V%Nv+sw{`r*~ll1>v9)=PFgu8_BRTQ7TS+|Ng3+H^s^pu+@e4j>)Ojp#J|_%?0mkKg5Zdo7(q;YG|qjj$dBcd(i+?_z508lP@E>R%Z>jL#&;b|q5gbX|>MlakisIIFM+1~Mh3^(@%R@Wep za(%cm2=%mY>-#g2o?JuX&P7d!Bfcby=k5|*&2B|CgOa}^z)+|H2t@jzs=JfV2#VG} zHroroAF-$I#%2I1s?f09Jhr+T70v_Ley#i%8R6<|N zT1$aPT45iI?^E`3heO`h?)K|4*?~K^g{ND7J&6t9j8&jYksok4L3Q0-^= z8s)j)t~6NrNGIZ(TIlLPa4q|gGq~1Vss${WZgy3mPJrNPk44BXUE&mLah|T#@Z1@R zjOaGzD&8ep0dR@JeGD*R2iV#V&~oDDB>Dh`ZJfy^Se1XX`K3158k~GDgQ#?s4Vp8p`79OpP3)(DboaF2lgM zL%6oMu_56IV8p)vQ9SuMWN?gcjkiv(nV9DyusiahlW+vW40)xlT0OyT@{gn^8z+NBMyABap9%8MYSN6wg1*_Fa;C2uDf zko0-e6?$sTFhM=;XcAx-}deL%rsDp94?<#8u?`13jB%xO~x2@ke0T;BWBfeXMo zCok$8h6?uH03d&KTv-M8_Tuw7({H*5>=6tN`N)MGeH}BO#lNv+zcJD{pYraEJCs#HwFqS%&g%vSDP^jJ5 zG#!u?ohe)@kN6b*RfZnnw=TW9_O}IG5%|t%#dFVI5w6} zc66;k=losc08X7;bme1ma&kqWbVA)%C^Xt9XEc?UgCScG)~kp-gvktfK^a|U`gZ>4 zjqKb-N+GP%S4%$QC4w73>5hJz>hJg%DQT*!-P}$QWDPgGay?JF_|1R8P!}^=-+k3u zAFKae^h~~CF@t$R7jZ2 zl@z{u*%Wz%l9&G*3a2s>(oo8sAJ2%0)Cwu*?|$929-)p}=ek_u%8g|o-I|P#kB@64 zQDV$5CtI?w+#|9GNe<3uE>QTTBl>fBQJW~O3L$?P{`vO|>c$TUBuMIF!p(<2Amw2Z zrUnxgY*qX|6|mn7YdaVI=kD+LGy%?g(MP0m%5;gtdV`Nu;PJaWSW%(#NYvG2oL4oB zrt&leWyk8fRPUavWS-2RpPt|)(DBRY^wLSUZlMP@>Ph!^9JV$v^cti3*EV7X_*C)6 z9|i7X`QLJJX^H8m){;Dw_nYLDSOhu))@Lq0zMV^qzYLMSM<0X?QT_{g_-llb!B}hx zV$;=j1c)BMz3-o1KKnwiUjTola1ZA;OMtRn8vET9lFYBwxfIO97R$Gjb0B204q%+Y z{+mNHpN34mUCzX*!{cX*?%qf%=y8SO{uwO$kk*CDfblTHE4nYFRU~?EKi^O$gZ(N% z(|+<+d_6FGn!$~vsu2C74=_XFg40vwhF*y<)t{8$-FC_p z(r0hHM3u!}7Kn8kE_@=!!p6(XOCQwEt@lZ6(`(G=#k=?)&S*Ni0R(KgC!73U!;;>u zQIVE0rn}~w024c?NXW=OriUbPvUxs!VG1XENnad!lk>U5gz!pK974K+h`^JgQWPdX zP!5b&>KyjVF!KzwSoyzL)Y|ek`ggcHCY>cdEx=n5oo3FWKH_0<_5r6^#aM&UdBgyJ zP`p|8GfZ-S(y8d z1qxw%R=;{>27Lm~U$vzETu(=n#{2*}l95O_Xp3zs$a9hs^2uI5RlRs|`JWAlI1|px zmEGer@2&CwB^@o1uK0idc$eF$e^t!(_27-%+eCKB8I#MTw3es&zdj*W0FkWl;LLp* za^gb)1~Ipr59S65N*H;WPF)WRQ^kDa$7=VbzE9PPyExu~g12ZY1d#J(9o$-+Ng-$6 zgmu_B_dT1Sx9?AbAGFy#q1^;4M7(y}%4%1Nd=Ly}i3W;q;1|@9WJSV5Ll4734Bm@e ze_SYex&wOu?7&522RKDW1gVf6kc)g$r3gDPcHr=9)913m9{=mwjJ2%k$rs8`P{64c`{#h3R#gTH!9v*GSHA*5 zMF*Psp#4-uzQp<>qpa>}=h_RNe>VY2?_|{LR7iVT-m^|wW8@Y%9=Qq=_5UyyeEW99 zKcd=Es8`nJTJ>t*_j5=WK73FzA%vCLmK_n`&v^UG`Y+@|6-s?@p0tko)RjwXp~AaL zMN^CH%T#S{lfD|;B{%&GpWS3c8EVaj-oMv%;*XGBE)b!h0Z+S~nm$JZmHG1J%Va=< zdtX2abc%^SuatmRqWi6}sgsiv0pm`*jy;wF5`p%VjQwN(-BFOdL7XQ7M0;W=(MNcW zOhOB(Jv43z+5_fu-Gzjqo3F#GnLD;LpvcRyhY%oyCiIIt~>r;)7 z;g*Omu`k`)TuReWpkyRF^}<|1LpiR#_fBjU;-?2M6UWEVc678K;%AKADZXXc=JaUoB=kHY6 zWO&`&+;mhzYZw_M0}c@;%PSR3<5MP!0~Xdc*Oh6R=%cb_*AImbw*&Q&vrT^uwV>Ru zB$Lct`u6K3RguLX5G2ll=e05C?6R0SrN%*)2ukdwt zK$tE=>3A^>UR#c&!=D&o{}CCf{|-KbYj0~k*8aZpg_*yptimPnuPGa4lifZ2!#$sd zqc*B0<03N!jVF!b3JNe&Z={^1L97H@lC-5PV@DUOwyC;AhkS?bb#DQMUv%tZ4dTCiHil+20CHFhua(I^87lU*99pj~C z{ZW~de#}e)B6~*Jp_w&FXeeqIy#%K`-ELq zOz)P?$5fyV+#S=eHRe9JXIwAuQN5#LyJAy%hpU&Bh)i8o-BV3n*&Y5{rJ}0(HeGVk zfFKBV%0D77HP!fGYQ1qp{S)Jq)Ow#B%Hc;7DF8T2P##T&dknb>HjaroDCS-NqjRQz>2^1@Q3Ng$ zd7ND?I~n)S|GIa>X{bj}{oJ}bM-||7V0N3HJn5h!9|TwZLIb7P?F$dTH))p*sy$5J zM8oGUbA>WXOVfed*n4LE#u3^Aq6H05LDnet#>}32*fG3yyi10mVAj|xZ>L32j-;~m zM&)Zr!){~eSgF7)nK9lVmpu2&xmPC@LIPnu;X^><=0LZ8;+>cM$;+;TS>;aOh@)!v zh5q#~7ty(wt=8UGrr#<@$!5uSvFu-zc-1S)J`TKJW;5UlOfd}&%*^=D0>au4BQFXy zP{g)Pj^kIz2Y~ZWB2GN4h@JfQ1A^8fQKI@3wBf4sQdB>ZPD9sCBX!R1t}dlovjGur z5G!d{MXDyD`lHr;K;|^Q$8-k;U#5PBM(ur6t32b5&!vw7j8vSBSbv*A;DQkjzlr5! zO-oNbOn71bp#idlo6xQV&V`;R=;?U&$d8lFc4&UrxODYZiO%tFSPS`%_8R&eH`JZ} z{{C^7>Dqp17hR!Jx>dIalloL3cd-6kdY0%8-%MW$HX09UW|Fx|Ge8%O0rEOKaVc=a)pmk5pd?;kXZvS|LY@e1$B|ldEJ}@QVet5TM-!o>*ND4DsZ) zvJB~_nH{K7CPV1@@bt=x^IG3+K7v=Wou0Un%x3&5r21)5iM8V`OT=poQ3WMOKU(Wd zZ7jE9v~uZeZ^xrtnqI7_ya+r{5ScxTnz}qR)z{}V3b0s0>j43FzovHDhZZ- zMr-8Ls zfB0_T48|hR`)sKPj1-#Do@N83bHNwYr7{M+{+pyub>6PZtG>UVONJx1 zJIL@4(8H$`IF~nDe=vV{;%j%zL`vQ8Bmc&ieKYE*Ew~ViPJY%rl}xd>v9+xQw#-Xg zPuOUm3mM%Q??N`I%2WUIF0|^=aK*L^g zm_9q(al$(=8BaOr&s_rpGJ2Ny3I@hmm&>*PQZ+8HT$;1J1B+{Ou0pk3wl1(kzG3^M4KaP9mlPUdRyK1KD) zw5GsoQ^xOijq4(#k(Ov0yw}bd8<}Wt%F-s3%DvuZ!_WiIyY&mG|^TrCAFgMQMht^p^fm^1LltN(QM>0NF$8+bFPYTM?* zGcUx;m32rwY;+U!3r@df0bz=`rOhQr@m?2_1>)PwS2l>UU%P7hy?(P6P?+$G0rn8) zgCI3Dt?x}C{sG?$3Z5i(Y)?EtpgddTHS6>SOVu_DEo(p zLKT#=S}xD}ej>%_#kMhK{9VaMp0+h{R?kY29x%axx=ZLiMEu7>w@&j8x~_N9fzkKK z;L0csPn(qZQDO)Vp^iQyj^2%h?$Z=UT6z|};?2Wz)7f@xa;me+P*&EG;ip8I8*Nru z)Rp?G_($`G?a0Z zRq62wwWWf{ZEbC*p#W0*aIR*d2>&8RP9Bzyq{su0;@W-#$``2UuZWD9oN)bhjaMuN|pnnDC%2`nU z`-h{iv71hsVs;#Fzo)DRy96KhA%TQL-KC+gB5l$ix96M4TW8NQ--w7$kH25Lu|EdM zT~Ftyw9-2-yWda6^>O#P2^0nIp9lOwkZ}Go9|;LD`xT)q%e+N47QQ6LcX{j*OngED zR|WW(L^2vLDw(9D)4&SMWhkroEit7Pl!82r;D+)N^hYoZf%K*SG-!79!#kH`JddPa z2O#M=q#&X24_C%Fft?*tl;l%`1j)8X#Uq=mpxTf}&f)vc;)3v~>NuO?%8EB>V&M_A zuYrflhhD-I`EkuzmSc^^&RIttd;->Waz7W_|B+{Xb|xG`M2PRJd=`5}()#n^6lcWI zUl+L+{XJ>9TD|7Ebi(zik@vX|>r;J(nQ~1-u|o$`LPPJVgsK>*$RFI|--iG#&=MuQjM`7%*?8P{%x>OnF_VLK`PO)l8J2nCatyVk6k*IFo~#ZSB* zhb0VZVXCc;^5B}Dwr$YU-#`(RU3=D;Oslh7E?F@1By#i>6os8$pGEm0Z@7U)coiQb zM5yy~g#MD&nK|5@aw5i4g7Duf44*$DT+XQxMqa`g!Jt9_^QOm3jje`3z}Wcw?Y?{xMSuS`2OP+6(1bGi&r(&|32AGRn*{S zQ$C-`$)MJ$~t0%c>VY&q8<=f$0mE zPmaG-#SR=O_eXl{>lS}eV94lkjHahT-uEgN2KivwiPzJq3(j1JI_c1epv$Mu_^--w zE1G`lCS73bCDeg=tLCYV`*)cLuTsLdXOWA30>Nv@^VoudM-5;9# zL!+akT{Pu?3*e$cIT4J=M_*fLWHOCXoV}>%Qq+fp@ndNLOx~ukeV4oI~!5bn862 zETc{VfAZUN^P=15vTq1OCsEIkrR6)MWymNi zb6^i5UqI>01zmSB52epSs%8chtk=LBAHhq3)+=oYY(e{HA&qDlqn{~C{-Y}LJRFYh z>lbdU0YvNo;g zWl9C7 z=vCDDJeX<>ld7;K?*CE`IK21zjb2`k^+4jM15A0CQLR{nDs{qV3QkNTi0^=!73E3#c z?`_-#I%T9DNGt|o)_8AQI!x89zk6`_&)lK%IPQ5c-T|95Fz<#ObK!7x6U%Fn6^wSE--2#Ad3167l7;C*=aSl~3h zFlpcE>ijNLwF_4)i_LJcjVE=8Hx9@7yII6rqCt)nF5Sb|it=TmIfBb!8jov!#*i?4 z)nPEF9dl3xvQg^)*NuWPW&(SrFwK}Ah3a6)g060HXW&MiJ@)~G{0krnVBmRNoqg8U zY6c4y82+{iYn#CO#^AeEoAIf+0{eoaF~+y{e>eX~@n+Z5ecif|OL3xxFv21qbW=4o zSHxil{JWC);{*ATg(3Lg7bfI!t2ju~7)wDXxpyR$VAZu!grba06PX7ctmm%#;opSY zFT_ZD!?!NI%b^}WAk;U<;zrV*s4f~wcA@l1@^H)mO z|6d03I9eD43+F_uWns}CA+AqxpV{B#opxV_&`PEx}pB}>n1_3O}a1% ztwSUN4kPW4ru&*a0f~YEh3S59rf60a-+hF6vB*KCu2jNJVa)tC>#ba7R>v$l*Y`!I z;td>1uqpIgSk$u~Cc61*jF`R4LQWpASaLm~{%WvTE{E>-h=;JWYd#y(2d$zHxVD)7 zZu`HVQ;@stuvQO)?*pHr!=xqB`D|3*!Xx;4mz?l`8blcgZ0&F2es(H4xjY}nH17qk zc@!n_7E>d3ARuM8nn@#7e#Az@hMOuP`1E;NzoV~YG;;};e~Jt154%)bOIEJLhCaP^y(w& z&oHv?4#2FsZ-ESyUfEnG2rZD@FwkW!cl$YRYJoEH?BZazRxe4?D*F}{CK%6DeN z*o`cbHl|}NI@)p_QcVr=vO*1tFx1f<;u0c-xfoD{#JL(PVf6`BmUYN@9u$dx|)y? z0;6B8;RoTVoKd(Wchx=a41KE|!V{D_$Nn%GH5 zv9QjY0TGl3#X#J#-0$bu424YUDaw3>gKXbPIT`vdy-M(O7=3yJ2sCz8PRqoHw|gW+ z-M-Y#w|H0&vPXUuPMrEaewT74$wH{NuU>EYr`-7^neMYaF<0`g`;|BNPt-&*DaQ=C zMU!h~JO3%TyL<21ibq#0S=bxn>*VSdjG!_?zIrgL(<^nzp?Oxk{U{5o}KW!=C}0MH$a(~nA3nOxluWhBXJ4Xh0yQ72E$wpq_QKZ zZOdNT(LsYqB5=n~hm%3ilRGH&t7MA3LM9@C<|`-kV7jYU+w_uys!|Qi8c?sST08&> z1`~*8H^{cQFNfvBK!CT7nY*~bP|b7m`2(#6+<+M9&iTP;@%9KxJwrSqGo%~k`BABP zlgW$g#l!`NeKSvA2bCLFE50yz$pHaWB8(026_1?$&6Y{|Fd;XR;i9O@8N&H$!ZZJe zwYPxkvir71C8eZ65T!#xKv23vTDn_6Qc*%WRT`x`1j!#Mp@4vhh%}1QA&n@Flz@Kg z;Z5(j_nh~R@r~g)gFlD&7th{%?X~8dYc8dE%6}&XiY?`sQGVn0`gl?4umc`p;>n27 zNc#K6L3>&%?Jwv-n+M@V^Nx(rxTCie0Swetht>R*s!)^5J}^3eJ2KBDa$tz@wOw#X zAgd+CB^}kRd2iXpY(*Jsrdh(^kEjbIsC zQj01C!7^nQ?j(k5mtMuh!&`AfTZo&NA2e=a#gRYY=Tx!1xx!TC`gQHl^Jbx1dck}L zj57Pri*_+{^r|beW~VT>*c4-?-$BC`%Q1Lasxk5T{Q$F^{O(>*79^6y`W0ZcK2&Nk zfy3RiKzGkw*>fNa(xw$8H!9k)^b2E@LvW;hus-8l66T0{tXK zI7wb03XUW~)P8yM(cSn{xOSLZEUGDYwnv^>#f#`uY@DU_-8z8w_~f&aph^23KId9Kfe~wH!BO_b9isC)AYzSzL=k_02LG&6G_X*T@`SV;g1#%_V6-}bgiT|pnNOcQw z%oy%Vx|Ggk-fW^|MkC-9$S0liYZ;)s2c?1U%mKIYramxsWJYaidkN#P?U0oxt4Q<@*=Sx2F%^ zdDjt^3DyR2*cY7-=`shoW+H6w;t|Qi6@I0Ji?Izo@%vDwl?bhlRx7}gaugLrCn5bi z6gA~-6IA=ukFLH)CojA5L82DYLOyT`S4!eaRXM+Q()X(bL0Xrk4yrzt2y%8Ens?BB zC2Zv8a3Eh>0|{g|P?Y%!kC$Ak1vY-=flNVbQ+Ca@+^xX&OwTshixdmDFhEkQjDzXC zGG5ZPX)Z>J|5@!KF*TlpHFhxjcXrd zi22Dpcb;Hc9tbHvcOP|=g@ZDFWzUK37G=)r@8}Xh+#LUC>!?));&> z^0e}m2f%|~`cSdv;RCVLBsjrwCC@BgqaQ#%Z4Hft164LEriCi;eIS|6UwnHEvQvGZ z&?jJ_;2vBYhuR3FcN=!~Rh2aDa)AJ=v1xWrc$NijGjbpt`zYa2&I2 z2!S$jqsMv{;+sXdjQ35ZZ46r8jPOk~no0wH{fxWnsK+vF`KaJT7B)C>)vO7RB7Q~31sOJ`N3sub+Um)B4#Q_TkDkwW$4gFJy=?W?t!AxF zP<+xk4{aNrbOSBO0%l24;OQ3D1ns^&%VVZv4m%_c#f+7T`xK@O1pg|OddOKOLpjf; zc)7>`>)`Y((b!E9{jt`JqKO1%CDOs$n(0c6!ZjAm{9%Iiw`j0)8E4e_t8h9?KNj5U$h_>0mr~2k6X3%VDR+pj&7DS% zRWfi+>fwB`J`p$f>bN+!^T#!8-NA*CDSqy!-AQ{kUb`#BaRa`w~NVq9#hV#9d$yTxL|@uqt(zj-!)BF-9sA*Y~rb2*yVskvT>QR~awU-vtCk zx%S7WF=q!@v#VDQ&K!opNIRw@FzzmKEm5+aTB9SoW<$3|s6OKB$VbiG@L1wU$6cDC zYt8SqC|jRQeVb6Sy_U(QY}??^C3lZRKD`5H^YFC{l(m)CX@|_e!CUyGfGxbv<7FnL z54s4V|JhMUd9_7e**zMFx-K|}fRUXS_3>tJMZz>?? zeO!B)K(|I?MujG==b=D$(Z+&<)X!jYu-dymculMS{o-IXEk{KVr;*xJy{p0|CVtHg zIY+IUj!&ZIAP`@G$yNHZN!#yHkL(91wt^fi*4hu(U-7^M9)i7F`Y<#b6%<`Ek*j+X zdNC5tFK{_Z2i`vljj$48Bc}Rr^E(XtNP;T>HI&u|y+7qa$LnLYoF-gpZWM#Z7>YW( zL5Dl@#_^pkh0s-(vlRnihwg>j(1t^}%vFUfV{E2+(^5EirDWs9n#q1()skzZS46OY zI62q!-_rqkNC!$&DB9)FnTd7L>&aM@YivMQ#GWb1KsTtg8NLjyC9*=CER3PKB6RC) zL8q9IrNqtudnpxLMYf0S*>|SKwdQ+stK8PMDeqD^B*Z>__qbz-?zu`qRI03ek!d!k z?QPvuf~N}#YBqC8J5_c=d|o9TqBHj%bn*33xYT&23EpPG@IIqA{9Pan zx}_43)Uh~PO1Z#Xr1&3MFLOG@vPxHB{O}Dz)RP=W{iVLl$#$Y^A9BS5uIB5LVvyl@ z7d;QT7f#$mZ!z<0c!PmKJ)ghl;ZTBQK0l7NoiR#DUl*lAqGKwXQGN}Yw6KB=M`n~o zN(`RmBDX!N%5Ws8%TqprJQl)uNPI02A`FmvlHq6;En>&wl__doy#U z@z-$3I}Q}B(H-J*W_nc-H64JDA&x`XxK|*%Tr>2z2aeDukJ+IuUV^*^F1 zF;do;F4AI%<)#XFIY+IGDZYCAis0+V!u~`6<+leg&cjaVL&EPjF(k*6po*r$kz=-u zP8E`AP7#rA@K|HNU?iDL_k-Xo1AbCZ{A<5Zm3Zu48F`_AO_OEOI@^oFPCq7!`K&*k zvLDQ={r>GT@5G~XHAPI1X^%N0Z(h>hN-gnRn`&ax{i;WYFoR7+Fo?^dS;xq8&n0e4(ewsm;dg<-zygp+TQi|_U2qVXp+WpBUk$%p zx0<4T(WksKI`3qYe7HCBxy>?)5l+} z?1WR&gXD+$6jX-gL-%L;*Pt==931a9qdGwYdtAjlU43<2Mb&zX6uBR zg@-$`cy*Y#4P0u`5AeU?aH9wVycvm!AutL!z)#xtx5i>om01 zf?r;=hKTEnT`0Tr0pU_^K{EOC-=OhLg+7m(A=6T;#`^&dRxxg{E_9$=aFi~WVYyOM z^4(3mE&Qu~Ul}`(S!0orn%OIV)1OD%>MSpp6GtF5%Ncv(K=Fo{nVEeaj{@pO<@lZU zM;AE3M#Ft&0larmG8Z_88L}-yIhUOP13+C}23w{?x56_W=HL()19=-N;ALEG2my8O zyr9myj7tCO``P**31C4@F%DtITY8s#zH;IxlOn0mB*+PGM{oVSnnhd%Ek)dRWDz+Y zuqDbMzHvsFJ7OHl3`(sE5BOxhfGZuT?_xe*VIQLkj*Z7Wg(iWI79)52cOq;>8J5vC-(yyOS!E+wOo3Vk%iGVvl0QFFZ60W(ifyYXC0$8P;4xOxjTqgS z6RE#mMSxif}w>w{@;!*H!Cg)jyHmH2>npC`9$D`%|*YF>Wt674uJI*1ygAv&sggUw2 zQ1k2P^6N-^98;S0iAgL_&o0MALAzc_g!x$D9n9ARvt)S}dxDZeiQ^!VV?z8Rbwpfi z1yC_LSLaG9no*0=6h+{h)a~&ZTB>$eHVx2SJyu90Q93X-O^WYk&qd&Ab-v}2Qa=#U z;dt}Q+1_V}GhCXsH8g_WE9ZCtAYN<0B(!QBbg6}1@}z#)e=3S~a5QRgvzIPW4+|K3 zKO|jyCCohRbkzs~@If%r{&meHEa2pV{@NMOrj;v)%R(fRA*0d_or|2YUjbcl+262~ zj_gHB!h!|LJ*jg(bJ2o2@^vuBq{QI8KWSVN=kf|TVaIV9R$aVIFq^~L@DRxj&}J^f zcTmPVf5k2)ZuCw&{T67yIlB%|KQ2P*KhS;`<<-N!EwMdQ-{gBxCBoJ*2~mO>YUW4E zwy~y5Wo`v~VnA-r3#vv4gjmcoqe(%^cZxaI_;*J0C9+wDdoJIGvQQnT5pUCJx+Tb7 z;^)5A+2G!zFmndLV3->?l2LY68uQJ2)O}kK;>1||U z%)K%ZMMw-xuRWU`x8ZaC;3Rx+wun^PWwC?h(zzGl;xy&qbxarPe^y6eyw)RhqTWY= zFRzoUEYJdd;HP zA{{s|8W4(>n5UuX0Pea2rK16t{20zivqn<$7nneAF0OhXM&e6)A!&j8T-dL1F41X< z6UfGUnbZz{TD%KeCexBuQ5_zaUK}N6IW%00a+obAwlIorK_;hjV=@Tiw2o*el7m~8 zfFWWI$E#&iWB{x(vy5&f*#4@3J5z!ic6br=nkjP!_^5ttuSX^|3Q%0Ebd3kt~`uJT7k0?H3VBp9;JQ1Q}VGAmFJ0E{|xm-(zYjx8JG z%dF3AXr#oj8ALE8V*56d7a-;($%SX>yWokkdKfb&8Yeub#QjqQU~w+UBDPNzqvxTY z@~Kq?O|>;J8q}ib6Dn1citntsSG1Np=#%;3<(ZRQNG9dKUX37OsbE%1`(6kw5&7T7 zYD>lsVY0GojZpoa?M1ck(;~~gGL4~_!GD0NlWYUjW6n9^B&f*g?8+@_*u)pm|M-MA z5l;0Uc3m?qx}9{yZhq0)LuIQmyMes$Cs=G_>bVQdp|!YQ5<9<}Ev??($%0~Pij>fu z?!TsNfiEztq{Y5L-=%j=Dy}HNQul{0F2RHBKh(bqIPn(-sby6nmS3iGWKf>aBcmR{ z*+Ki)^iol^FCZ-exQoh2dT((Wvig-6miDmSXuJGyy#ny}L_nghkTW#aU^O%VUCpV` z6~!}md2q+0HwlwO!E7|Hd$ha~Bp7?=N1v zAG_SrN6kE2s81b{UHll^RH2e@8n$ z%oz`87RSpWS4fiOA6Cwp{V%bMcg>l8RXGp=+%Y+WxIi;MIR*{(1Vsb;xg{ZJ`Phrl8uDS(F1uszO!_t;N>pJg|+{^v&mM2u&A10N~%l9%hxea$M2>YgeUfS&i-*Mze9v3@8&W5OAAntOkM%B zGmZdk27*qZ|GWuFF#94E8^Gqf8{DSC54gh=y_r}Sk!pe2f)6cQ(H1P}lcA_CN=n-= zgbXIwAvT|4O^0pi_@7Sz#a=RivKK$}7z%vcRbK9yFLm`o@XAUm1g2EMc>^M+ zN&@&fBro{CMhSWprp5wSe%OOBMRbySHpaX1^ATazVPEGPvys53$~sMU;zcq5bE*_< zsw;f}&u|&47eiLVAPPQwB+G*tZRxri`D zB9dYb#;5Xm>N=FuP5*rD*wyd>L+c0oe#lqF;YLdL%=Nmvb6qgyO*aOlvI*cd)*-sy z$OKgo{#j2r>d=qQHBh99oa3iBk`ybWhM2Pew8CBQO)fSOMZ%BJGx3vAcVqY1twge9_m z^#5atzD9HmoQ)SFBUxR_*&cq{fV~bE3_V&kBDjha8)iAdsqPR%oL+r%YPl3-fCEnz zh?KI#>cO-4x{@u-y$yZRP`q6Sb|yz)&0Gb_Q+7bsou(QMa}^%n{({|WVmyv>V+7hr zNz;HI%#*9Ev_gVrnX#Z3Fi2pqjsSOY)a~Fix&VWv5R0gKnC}z?;|!Ht$2N3Cz#}S$ zoX2cpH8pqxF?D@y*k**-LAu@iLT1<9d2wun?-s$>X#m>yPjM9f4y}>CM+8C=*Bc{1 z6;p{Tq+%P?q`meC{)Yj4Mf@aH*X)xGVF|0xm2sXV$Snj<2Tr61Cf@Q_s6~Pu^vkiw zoFL4a>Na!0kn$XwE3UV0F@-Telf)J*OcxZ`dB9`L>>AYFu|(*D2G$Xd%zBj3J*c#b zq3!X;Glci#yWz=^DX&M;D@+1N=QC7mJ1mt%@V$(v+~^C{?J0iJf&IZeMK0Ho&G@f> zrjQscx3)#XkwMP@cJP!s?+XQVX~n<+Lt@rUV-O3{qm_`r`qV}}c=V2D*$J>Wt*6({ z3`SJno@|JN%DGstERD;oQRvhByT^3N;O3$TvECXgnJplFsINLCI7EByt{Cd-uHGk- zh=E9?2pr&GQ>>D0pX1XDU%;PuAwStn%k{}B42_;@WQRJ<)%OBLXJtE}l)B>`FjN-D z=qgMt(`QPZ^&U}+r8`vyi~16xBMBp+DoU6n-TQCu?8 zF+HuRMiWM}dhzle%ooc8V^vhu1k@Gh%9|Ep3Nj`irJPjF75T(^(9tM^1;ivRca5sN zd}SE+ZivI}@@sOdS0}?Qi@bNcI4f|*DjD?%lx;~Qe>qjycl0a#FW1&TDL51Ga{O_u zOF+j|qC=e1>p-_c79ofpk?)P2Zh;32KmhuT!^Z+OtpZi*V$+w;9qMsoy9{pxV`9&& zK=v62GjpVEIBN1?W_ER4xBstW4{8CY6w-cx74xO!Su-D+0`GzS48KeY>XZt(YRGq$ zA+59qT>_u;l-M8#`D`*J#)DE2hj5_5i?|{LxB}xd51kRCx;r_IhifmvJFCMnrV5d@ zfIe9F7Cp%}06IF|eIP?I?Y)n87cLOpEd#(ot-%=@r8^J)6f#OkR-qSc0_Ft?BcaDK z7P6|R3D3tsnO`qv5itmtHLFT56?uSD-Eof*^jA)RVgCU7s4~`6VWF$%A$>0dyKh41!TXm~JFt7nsVK zAIIzQz3pcaCi|t&pfKFq7>3Cu0|!^0bcU6{@s}GlEpKMLC#(Fenb_X(bSD zTo@Sr9PsNBfZmik7P5z$x1^@M4;GU1AscqMj$;VERk29Rd2iX74x^ao8~vbu)bY`7 z8_Jc(PZe=T&54xWkFbL;k>k7h_AEC){*>kR*p%BmEGzJ{j^7v-P-q%0t-rW`p~ zSc8!99U?=)W3mclUlRpAN$z`YZhUEJjV`&gcw2ESFO|h|!kSdv$nDTNCKg*fD1a`s zqxR+5g_XfMm$@|-_PAN`PGU)g_pS`5e2^Hk>RTV*2RG0n-yI!3*|(Q!eC3Q)qCn!I z1bVBuN)2&*S;sQmSiDtEO$wxMRN1IRBPZDSB60Hx2Y_53hzR7}54!_uP~zARmuDWq zOi*p};XM8}BbcniQUE4w=6=qQi*F4XJ9mPTX8~$<*!DO!06io^Fe*9BPp5Oy|CFQ0{{BGfi_tT6hZn~%O_b{yc!22NAU*F4x!%9RFlm?wgau98 z4r+L+D~QPI*tO#VJn{#u#GeL6LsYhzuQz(e@wl=_-1Ox`4{mvzZfo7Yd`4NUJB`;_ zY9%}!hwvo9u!Y?W!Ufq*L-5VjO>CgohT>6dqJW;t@7M93%kltAI8@UPG~ogX#LqR< z93fnys?LrnEOsaNUn0jb2e`f1Eu_l<2AJ6t?P#L)8rr!e_0bo>lToilmv`rzAc}=< z4=b2Jl%z3$5J_08yr!!pj6(p>6k>|kkjvZDRt^VU9`klc?7MPv%_2wq3otc)E-j6T zeHyW4Fgum7{yh*jx0F8ntcxf6$kf)s!xU~-SngpfeleFverqM=YWoU4ke0sEiLP;f z@4S;AzCfO;dY07;VL+xK3SfB#*NcGeX6CexJ~d#_qE|_!R~3D6z5`QZ$EiEk zM(dKSj}oP*JH2zF4?g|LQ&NSe1kjGI4foOqsD=i2VW4?{PF3P|;2k|M(o-l=3bO%{ zTql?^gjFL)%iu$<{G?3K#zN;SbJ$niiedXa%>FEp_a?o2>vS=|+FEzT^0UXp;t*q-cZt^G`ExiJsZ zZ5^3NJE=Re3nKb&jF*u?Tqx8e*iz;j-S_6mRLc@GRC4sj&gU0T2%bF`As`)l^S0J$ zfEGpQH%WinP4sA=A*WiTDbGlRg5M0D(WxdtA{`CKtA{hCYF7R=}Y1=%tdwAr}0#2UxkbRw2#MdE`Sc>7kzZJ2Hm58`N4gvHqYY$Q*fcH#99McY?LTal2on&8?N z(eA>?$`YH_=fiEZd^TNqc@3Zn5WOKCsj27yE#<^D*%L24DjE+K(@~ROAd$E*4D+$n zab1jj)M_|-V;Jrmc>oUo=v$VUSFXzj3Xg3f;yL^(8aKZuelo z#-KNa&v=7-N#pVExPuXr3)LaS$LnkVwSKZ-hJAHyVBQ2NH0g;G21W&!SQTUSIhAHT z*-K+E+CfmnQ2A|Mr1L!I3v0EMVYY2oEmGb%xaFDb&q*d14va$n%%YwprpzdN^|Frm z$M!!-1w^RB4nC$&P^sI2c>*AC(>2AfBG0?1s1IyAsm^3;m?Cfx_rT9yXQ38`-xc9G z#$?eyk;eN5_Sy-YnGD=Ip0W@56|IVVLjaz8Gh8En@5_5>B?IDj$V^!<503rpf2j8C zwN&H>ai86b?1VrNQWNlv10tLc=NuKyj-4mQ>i`!7${V}$c2@$s!>t-&EFSZyFrW_K z0~nlVv)$;V*mvcrRuk~cYX|_$tkx$FFaQ>E z=6gl?HBe`r`iIi=go2`8+hP)Ce&*hkA?>D7QrUMpb6pkv8gd1bD}C;ngB#!?Xv>+9 z9B}aM`*uwlC{T0DSl zpD`HY`ZD6r0lK4OBpaZ-Iu9dPL{|NAeEkl0b${W$ehj?| z{@f!@dJzHwDpYTFs3DL_$aaVS2Al?BG6K=X#V2zlfg2;m3qh5Vz;KaPiM|d8Gv7^M z@4Ky5iALdc*A)*MH%vnF5%#-l?~)rkm9ZwL>MajXa+(at21_qoe#!*h5EnBynH%Y$ zkwoD?G?GvvVMM0W;vy_(2vQ>BT)QrVK7>&E-olo0YlzlwcNs~Wj(A1(kk@wmzx>*P zC*Jljw>^{@bT`26*{%jso4zNLavT7U!IJ02NW_QqY@9DVWD0d&lSS$SD+<#q;0Xdk zUre2sfMn*Me=Q-H`@wHQl&m_CFLcuHqIF&I1g289Wn~NOjt{Ir+7~Dc`@Z4BHSH@s zSSQSo39~6R)J8z?mwMSM#3FiDfaf=uhi&CzWFtAKZ1pm)23<-u7 zsG=?M?X2L@lb%APc2cDESiik;B`3tQd%fr9pj7@dO1W^uUvMHT_K=Gg8$K@lg+yQ% zyWcf>syzPe*K=+6Scz5S*1{E?M4f}5#Rr~&cA00=aa6hHAp6+BzsW80+qq_*j)3Tw zg^#>1agJNNHk^54JLEeUU8|=f^#tOC`f+e3e8Fn%=Ts#@@c*I4iPw&m!bJMaJpcDT zvlbcnPYf?o6Fh`$ffyb=5@ZxxypiAXutjx{APsb-VGQe3*sb)fP){cGrSs1j zEE0#x#lAfk=98u=(#=YIqIOE~`oBKA1r5BIQ#=Q@GV~0}B5R71tPQtnicCv_$A0|F zOL1M7l+&v$xkUarNo*g7poeOj2>$X&I@OU%9xh)^X5q)Z$agbrEhR5!4+wifda8Za z6v=?R3BvJ_Sid1K%!oRrPh2p;;QMALF;VVq__ zbM3A;*|Xjg{gBp zKUpmjZQp)AT=f2T@MWH6ho_W9I=2JAO=7WV$LDMgtX#QkVZltig4weltGLWHqJCj- z{Vek3f>R@@AnIk%AAg#F+%+B= z8B`#TKrX2`9&?F`rQL<-wJl&L`PhwWilz^pn|6|TWO=P`mo&bcHGJ{eaBr!fUY5{@ zob6dxHR;=18~1+O^Bcm*j#lWwg2R0z-$L*v`2X=_wM4dgl^QcJ8-W7pp>b$@#|2-y zhq2#XjTL?|k2&JyWlLfUhz9~eyt@bYCmYzNCj%d^3@RNP$fo1CO-0_kIGptOtOU8y zJjmj-Uf#RanJ!pigyF~ooio7iu>o2d3kqAG#@&3C3u{PLy8x_6_V&YF8|3TvkD(gNVqNa3D()iG(J!Cl3Ff95nr zMPjJ#l+|YG__xwI)x&SLF}hiFC1RXI-)Av}UcNw<5_K5_Aeuyk!qfqanswgopGQC3>;eek%j8?Axx`H=)YrBkK9R(~QAbWm}~N;kZ^OEy;gx2@&qTQbITDqWn>)X-6 zHcB^NVB_^m0H_tg9?TkSR=##aa#n^Q)`UQ#qw;f%sEte==(=F0`NN(paby4E9sQjg zaea)$4&`L-OBY1kVqoBpj48V2CD4csz%(_M#0%oyIslpF&ewsNpK_^zCzl*DzZbkA z6M#cjgoN&mS^zZeE2RsRc~@wIY6*;i;^)#}Ojwcf4Jwc*X*7*H2C$#{-L35p(Q2v9CK1o@%vj)3^x*>i1=OrR%%CnrfE z{lf!XGLdFNfiSeq`{rBoor!gVH`;LCs?x-+_H(R1^Bh|B8G7@RV8CbhPG**C>0YWQ zbilA^=E@-wD5y#!e|QBxe-m@JM5j2{f2!1^UJKyz@}D&8_cv9SqlY>ABP0WeW{rN2 zU`V_4l*Sy=DVW3@cvjC2Bj_wH2qCn2NNVpwMTf|xtoyS}0ir1|6Qa7jkKT$Ck#QeR z!D-k82d5n9RlO|M(d-TCW5>&m{MQ28!l-2dcZeHYn12@kb@=Yw+r*mXkIK(T-{#qm z7sSmhe9u`l5OT~RSQS^j$(31Nephg)!jQ+*$ld+$Smy0i0<@jtVt$eshpwFLoP{=| z)u89JhH(A`BxcGcah-cgOR|J?_K>nD3r+d>0#G*a%u0cUO}h0x_Rp8lz=^tL1B1!t z)18}R5r7Tg>qLTkFb8L6iWzi&Rp2c=C_pw#W#pY3VJL?|F`}`$0-@z=6{CE_#Z=7J z(;QLKH)O9eH>L*>^8wlDeu23jvi6IXgm*#N+p@|BsHYZVCs3S;n8`wSZ|Hih0=lfV zCusLx>YRYnMFs{22miJsq*uhjYHbZFzp}V)dPnFXRZup750)0UsbN|Mv&?SKg{z9Z zX(BcuM*82}-iE*Zjwj&Ud{AK0&H078-VZrRRNzy!V$qqM3ds@`ueGu3Ak20p7Z8@JG!;6Km@OWNUqJK7GWBh z-x(hF4f`QPTn*s)Q!}$!?WSzst#Dc8H*7kaxb^U1ip~}x1RxTBlgUB<`L;0Z!1ap7 zbz(sobTqi&4W;rw*7cga@-`LleW9sVcf7P(W!Z~uKh>OS-SfTis@5c{`*{jJ`b^VT z-fAMgW16%RuXx@)KA-GfGNjaF@N7N+pH=BKBi4l=FOJN?B6HcT`GB8?&$bm47g^X% zXS^Qb5e_3E%6cRm0*t6lbL0cd!9(~*VjPPSn+9>G04UWR1##@)K(WizCSeumU0cV(1k;D+RtnB<` z&P5xAm?Mu`Wof(INH<#VT8N_6dm@GQuB=EXq#}n8G-u*|KXe?1N{g9!bS@&S59u7z z$b!m$==XM@)R5n>+1IORHw{`0C=_`B3~rj6?1lSW*GEOsfOwMEWHNG3It)!KLN9s+ zP^@6o4Jw2u8^5K%oGE=pw!CE)06GW4rn_HBoak|62;~w*bmBg?16H4q5bE&Lz_|Zs z=@xCIt@!tEa-3Q2O)wISb|*u;Y003UKj`YFD~9fQ%^B50!{YF=>2Or^Sc~Xq$hAv6 zTD<3KAsujfMdb48-+^P7Ny@O*U)ZV*et8?mE(A-$K2m)WJn;>{faQsqZ|)_z$F$-) z<2VF0nJu8M=cVGc2y~DSRBw((T4C-}3Es|VAmnk~EVgVMd9wo}sWmR0-^e}7a}`+1 zmh7iuvGBrr%y9H044)aOR{s)IfSI&R+pjX&up*B3lJ6U(#2~2LMadO|Z(&Cj9|M%; zP|+-UD+X1!heZ@hnAP*ENz5O`plVADqQb;mbKGt|7Q5W_M>&Rxq;1k^o=neIxn}Fq zh_oo@c^eB`PS4f^b(zAosWVu?`(A)l=3IHuv^&y}Qvi4R$4xWll_MkpvxYlCXI$08 z$6@?=nQEqp?j52bAo+-PrMX>c_giSE>ZRHSB*=^W1NPTM4J$2zp6W6;??R9-iMWM; z{~gxla_99gi~BF`#u)#l1voM|t|zAx0^v|p<=(6*2}fnlR+_7guSp~xGCWd`?=wi% z=3U0q+!ncJr3^4!8~Iza5S~_|=gaN72<^uf_le|k(J$n+fNw={#63$a@uou+z|dKc zl*ag1>9=F*yuFp2h1=FkRE}T0SnpiO<3Doxz`;H17{j}{edo^>t9O*|L#SrC^NgD| zjTQ_q&+bw7N&hRmmqKr5wg~^#`F#Of7*r5a8^m`6xF9&@nI+7!uu3dPJ|_a?Q)iWt zcZ1OtCVhR4e+@#myHYas?u{u@y48@CcGEaF=KMV4rACwD2&}EvD}TSnD+~P}riE`z zu;c!DV!QJUnqvEizc$)$+gSgK<+B{ZWZyG0q!7>N|HTpu{m2Hc`9%mT;U1FlItkAD zDBrCioH4_;AQQ|S6`K9P^Bj@VRqv;6*?qphg3Jg|$bSYfG%ho~&aDb)^jVo|GWO#o zqN_XvhS~Hsr3^O8CTE9rDqrr(h6JXoB=q;z*4%dsIehbc;geASW7dl)Z_bH?n7Iuz z>|C7Pz(a zCEM~fg+YNfOv~#u-gBQgMH~<I z;A{1ombV3T&<0Y9uQs%1Q#0p$gI|F46N=*Dwnec!6W=>wcp+aYh^RzQu*VWWlg9Qq zlUzsIaqt;5YHlC#ToO<0^CntlS(xHHOK889(0O6-BYN};%|kebso_a@81XB z&W$}Yk;_m^H~XCg!;tiTt0%}+858>Mr~|_}k8pc%ufHU~s=^;~zj|f4$FNPh_8GiS z$xv|2dPeA!&<>tJ3Qf-kTH?eXU_AA73$vIQ{mIlZbi;Iz2GF(qvuuUp#w3|m8LmzJ z4-j>*CuGti3wu26O8+`e#EqC-o06%oBeO+8B*7aeW$;GEr`V{>=<48gSci`<_sPp& z=J@@9akP$uD3*Pl+c3mecX=1`#}h`+?4p(kKi~ZfMB^s~Nj1R(>LP96r6wD^RHnKP zo_})Eki~vXQ@R04fqJWkjh7Y7&aWGTA|_(|Kv4?)&YNTq3jNW0ZAy`Dz(KwnPdyn) z?^d2s>k@%+qD83HecCC%CvRC$Kc#3np*^@KQ&fM|%#rQ%4Bp_onjoSTI5chSM<4T5 z&QeSIH^!xL=oC%IozE+T8aBjXaJjtcCRDPzqUvpl0=JBI&?IZZATh1#t_N=e1_bwp z*oG&;MfH4O6i`MMU_g^VE^u*Km8Qru{Kj=E`0}rpE+)Uq@xW869zbI8+55^p7O? zon)ye#$VLt$qCs}JfwLh)#B&*;t&`Daux>$aaQ?Gw zB$jUkpzxcdm^_jUx%rB*!IBDo$y$A?05Kq-$y7CdnrIWyJ|?di*5^66YiWj)f~>GF znnCYE@7UG&R%Z&lcMVcA=y4Z2w;d?Xmjk9Z*I9|I!@Vv_tE-5_5yKLDTqibM$WAg9 z#wzLN_(2Mrv%v*ku}FT2xY$pR(h@W>FyMyQpqY=Uj`e+mK1YpYR&H`Lm zj-Esh>iaW<$x!mkz)q9L10U8P?vkZwo7IN&)1`(t+F^J>`$Pq5nrPVxx?aB?4<@i{ zGs7IEN8bdTr%LBr5hj+y(|gyJA~wW!GRt;yvY%euR()M~Xj^rfVFSdoht(|{{mPZc z5*^3?<_Jd~pR&O{T!duvOyP`-}llz-|xllmgbAyh+v=_!gv%E2gh`suD{RNV9!i_lUd@8 zh<-dKJd;-u4Au{?cU;Pvk&qEiWnxc;ur@TQa00#HhUo(n%Mt1tb?>2hwq$_W4d_$Z z|0(#{_bEsHQx=xRz(7clcuxcaX&RFktY9&}iYQvd4C9eseA4`AD3y2&s!_(2?s`*J z>&w0yJfNUNp&LQFLPAG~vLo12#epiISeU+but-xD7wKuxxO5pBWiKHJd;{&TEGRG{ zh-6C=u-UnQTtfXg$KlPOr{i=#1)KfM;lquPJu$n017N}*zC4>a{XUoc7dIFppuPg9 z#N;hD|&g)okxLJ(zD)q_8jRV~<pn|NA8~q1pH< zAiX?Hwt?=$8*{z4Hem>jAl=zd1%zk_Vo$Wf)%2m?=Pvo#+sMfeRyKS$t`lB1$6n?Rc?%B}G53XY!VUND}W=N=-hVtJM`kg|PvR?*IA zT*H@+4*h{i$lm1vE~Tq#5sr6|_GNKx z-jgxY5()ts4GjJ;UnH>}?1C$;u+9{UO5KNV0>6iP=%$<h?|AAL@NTB_M!b_#i}m zi{*NT0Wi=d65_^y0|D0i?t?`FGjSBAs#mCF{WxRsL~f0J<5Jd7RR@Z%)?+{J8SIZG zI#%7@5uy0{DBGi}pf){EDV;U$vNrZkEp{(WkuoLKdU7duU9;bddt3V-tc3lxqDl>) zT?@a-pWGWGcCan-V$|I&lhdxu+ar!LMi}RXVScw>6OU&YRc^|^yg}T zq=(dvwy2zDqUDtn?C0_gxny#l{Dd1U5z6V0#}x}oQ)PM)ZjRNgeu1Vli~pspNTl6I z$+dCj;*SNpoM%NZfkqy|LlgQuv4detRMV?9l8g&15N%>(UjOTpBT(3J!X56pt7wq# znmGpw{`)eB3CsqdXq(KA8v*@&&~G+Y&f?>IUP|PIq}WrwC5kQ_kbh+gXGXMs=d-z3a z$kb1KgkL$dnj;jWw>Wt_TIT5FG#R+=BG}WHa{pa=GfyMr5^c+DKKyow^-tDeH`T(8 znYisw)*+1O{EIb7B&z+t92l$j0?fSA@;zg(Zq;Fhr~=VAU2SnfH2(fJzd?f*A(qn1 zJ#h*_(jW~BgY}OcpjM~F-AAN&l2VJLA;^9MgF0&-c-NIgo@D3daec#dh+pzf6jw3@;JPw>shWC;3X4Ar1sxhKUOs zExgMj3AdRlx*6FMySb|(Q&biRMQ0#Wf8n?7i{w+3NInH};|&UUUd@c%Ua)9A2;$DQ zWs;2Ps|ri-7|qpN7C9i~Y;4s;@MpW76il^(;E%Z5NB30l5vbwj3|v@A?1iY#UB3r@U>O-}NB-<&S@*%F}PNADaBI0h~PTYCACc)9T1-Dy2KZVT8e|m;kF2m!_FCb{F##1oavCqAJ2L1t1+UgLL386;iPP3MSuBc z>$Y%U=E`e3K>th$^8=)P#Q@BL_`CBTpuwBS#RjtTy!o>O=+TWYQ=cXNB<$ANrZbr> zFyM`xVwgj|06rTP%Ag2O5r3e~b=;o~yzSOI>YvDi>aEi529=%^3Gafqu@uSt&A-2& z6Vl;Y_VL{`e3&Dokfft`#f1fYMasKilQKFm+Q^TQ@BMlg5fZ*?UA%#O{m?$=WKV|h zh3Gt%qk67kMhHW2eDP?Ut0a+y>u2zQP!8WYmhIZI5AvP+Q#fM++1E$IGXG(uOA!gE zF5d~GQ;PIr>hiy-gOAn7V$s#jTb*C++@}`9SfLl!wyEXW9laMDxPZGNQh%NAUDqW; zvc+28Qi2#bvYP~dVMw>f*MV`}zaV_J<|6EKN;QHvco)$N8g20}22T+Dbz=sWAz7pQ z4=U(I2&6+kH-Pl9POjjRcj=4%h)ERYk&?xZ^T#}+AG>k% zH%SAyyK5C&IN^~uwzjALEfyTP57vD?^WmC5vS6ov=3m5Pw&?N^xN#!5|KmKAAe?lf zDlZ}Y&k}@X8tmakxN2wIlr6p z*B*S~mO=0c6LD|#r2I1?i@jL&fCqi_C4o9y_6Zmi^>#_pkTzRO4#JQ!+j0Cnf1=TLds~ybI&(oXbm8-E>vzYkPQ$Ob~+w%@)}awEs7E zgdrFsao&Y(fIL6Mwv3-Pf*#~eT#97&Sc@-YX^Xqi?VgGMnz|a1HJuI*zj+9#xlEJ~|D9!4Rmrp`u0$c1i0-F)CTF^w8 z6Wrq9cbrk~aMLFHi!$^!K~7y6_2K!wqh@v6v;w79@2NJCtpMyff-} zkW;sTeE9XcP400-@p4G+f+4^FL6J55Mv4TOBfmZoD1^a&>G;o)32=pi$UO+lF;W(A ziYZgP7RnishXc+bftUoy%m3EPl*ER7{BCW_z`t)@X>jE2n|I}{4u9A9!e9EHKg=R&1PbAbt!PBA@TFXF=rwQER?XDzwu#>UuXX|gh zLhf>pd6W0KaGVXUTqfXrf?QRXp5VCf|NZfwBQk=aWvdPNjX%N(62;VG!uB=)Sm=uo;}PWp1~y!UZtGtV!?@vA*3ufB7su+T{iDbj~#dR>=@? zR|cy|9}^20D9T--V@Y!?UCA zr#*ShVBHLXi0FR~L^A`1e|Con=7HH|SJEZpHiBg?Fc&@1f|Id5qQ4!5_<_L`HJP`M zUqxMyV-5#WLn#6*E0OMBaB_Pv{+o#1 z#jVQWkX!tftRModtiTzbH{YcS+zLWTE07}{G!2K7%hRPdGX$PT)ahWvS2i~~K**Ki z8yGTM9G|}|b4bQ}ByLQvY-{;3>Q%-XG!93B$r8}sYx~c2^ZA$dweu7ikWS(UGAShQ zMEI6_yrN|u;<0b?`XB9IR9tV8R&v3D zC8?dk02O-3D_fr*--}DlUrCVX{yJU{fI-I&JGDs9&P?n6>gs_aw2}O9=F}5$oNBE9 zRA#JSSqQvjH&pMsHdWARRWc&^N4sB?6%Ul=@cXltEc`kKDlzmy<4+6AE`U+3VXZ^r zTmvXHi|^%kyavU`;4r)f4~QkUmoMK->cgYtx(N1ncT4xad|-OLhsZEFdMycP1XRKI zap7aiijXicrZ=N61C}-t4N>ByP1GjTSNrMka{$>AB7kaUwb<|G6-Uz+`6wGcjI1i~ zKyci}>KCueB4-;z8gSG**W?DmIy@Nv4`tsS&vpC7ZG5fB%$7}&olUYgC0k{O>>>#n z*)wEBRzfIyuWTV(WMo9P$jFZ8eDwQ0(2hZ+CMSB%Cyo49X}@G<~*;;@hIN5pLj-?FE^4O{@qOP15j zr&1t<*SP&kuHWjQ74X=#k-4V1{q6di3h>$jk zBN2JN;ue?$kRV;^LJw5dc%;z%J8=uC{M9mG>UKrH1ht+{KsTUV!gZ(2N(0dhv6Tz^ z!Ik>9UCWog`rmf z=XC*uRoEvF7-bw?h;Tm1#qy(jpS)_Mzqfuu=k#!i zVZ@4DmLb1Fj7T|*MJXx{bTO{FnSxH4o07y}vF;RrPuWK4b2BzVM$qDLc(T(!GG6QP zC;w+(>fKZ!2e{|*?R?ND)=neV4bUtpQw%;5C&I^HxUehM?bjeafAI?P@Yx=Try3Z3 z>P@`7tt}W?t`wb0VV>u~ML%+%Q>Zs_agmsUIr4je0$vkmdX4L5a_Sp4}{u8B0AfOikrU{nV9Hmw*Ibg z4H5zr67fJlM3|V*d`~Ku_Y%$Z7c@<7YFCd%@3`^u^VzU*njMcgJ5FIYG)CV!q#l z(D6VJ$&F+qe&%0a>cLC6nQ7R_xrHDd?Pmf3V;NJlSb?f9>2{}v% zs>Cn{=9^+M;UmJw`A3%&0ln6J!b4CVCjUiQC+h_x)-ycWWViIXzn<4XM!xPFQ+Ygx zwjyjmRzgUaD|R#9T*`+nD8+q2+A)8~MAHtfdQQil1h8sy?)qhEOZ zO79{8c{ws}u26=DG5LPIyH=@HZ~mh6NEzsMamHL^HUghEQjzNx#AySaGH)*~gMeGn zhFp9J5Cii~Km_nD^E3{FSH?ylDtJt5ieL#Xe)Dz(!SM?lO09}Az-jXuOc^PODVZW< za3!F8c;r!P*`@PGMA0XP_z zm%nB+Q`$ba>FM z6ncwGoqx#cKF4>U)1u}y`Q%mVG$ZvnD&+x(j*LI+f+N(*WcprE1#dwK^$YmFx89eN z4#SS#toU-R>X2bH9nvP)gY6-k?PkDy@VT=?6ZDD@i#yaC#B_YQVVA={|3#~ zBj1?9WT;vPj7sQ5ouyM%2$n89I&kXr$X#~>UG^v5jHgUD5iJC3YU?8)w-fR^f(ur4 zM~;orz;Uct=J{V}Es09VA?{_QFqck4n1udfKL02Xv**z2xrhA!y=g2MeItDa3q6XV zKpH}Viz^0V9H5zmJbwT`=gJ3m>+qgp7$CIRT<;()fS1`OrRilq$VEW^vdUZ8Gx7@x zca;lT#)15r4aV!Jy;0!0_??23TapRK%s@sweBJAv$0+dFE}N50h}fDN1Iy_FFl)nZ zW?c=r-AAfF-x0Zh@YK}or)qU|NnAuyvdcouWz(4Q5O&KWL!GSaA@3cj4qjd(CdGx}orKMAi9c4?)lqO8&60EIWei{h&TSCCP;%! zJ2mS$@mow7VVw4yDz}AffI>W!IJf^D_TZJr<%9E7LmBP%-_%wvDXJ~+S6`9Xt*H&X z;PsM=*0lhhp>`irQM>_NV>0)$*UZS}v_Zfq?BX$96}Y1u4@Hu~@8RXvTx9gL#%Vll$j6@e?vu^M5$CoErGbD-EBN)S50@3fy&Wu} zC%gpcqbtXAs(nBiWvfmR2f(bLfOS38_R-*7)vU7kYx=UC7WwRjmb#%Pz(|bE&t?0X zsRlZolG32Qom~jTZ-pwysjMQX0pV)B)hvfkyai(#`j&|S6u})npHnXtX)*`UHl~tv zcaB(~5pj%wx{ulnS^QE@Z*TTBRRz1Rxg{#f#x}$%8g`6~hU&?6p*oG(rPir}%_W@7^rBtm|6TYWL=IZ9xd*Rvar^z_nYqZmGD2P0JI4 z{zl>_w!#bKu-yf16))#%l_ct%M0~1%Kp$HuPqqW4%^Nab2eZpyw%hz{v%l8!<3DS` z(3z#yNTKi9_nM!jLsE8`%sf3BO;%Rc^x;E}8$?7z!NenNe^Lgo`2Yim9<;(^kEo2q z$-WuoXH^|=riSKw$tGX=1$FH^nzDOj+-`8;LU8kj4A;Hd$#a~h>;3%wF;D*f9eF-A z{u0>~Wkz&(d=G5TpX(FUV{tLDXL=B%9D{pJ^MTv}+xLCIc@}zsF(a|Hcq|2sbhg** z0z40_8HiG7IW&P#Bc+>;^1F)kYYg+k?}>0P_B&8e$FvhHu9#9Jbr4uphDi6M$I?7Y z+X_6}7^c`7@L1VXpC4{3gYplAC}%8$oh#OsYJ>k@l4hnIVjVg|E>cGv^VS=HlXl&!YD72T})f9?kg*GI+z<8j%74z0xdD28XMyVxEs%P{Q@E{PR$iA& zE7A_0lUR2a&di$XYF1?yjurKLd1D|-|FE7oJHVNpl}qcHYB`j>&4Bo>wew-IthBTR z9y79g`pPOuPYY*ssH$Zq9`#4l<`;NTT|o57>?b3eZhMj~yS=@$^C~~#exvtgD5i&( z=t1kI^Y%{_l{qqf`!M#l9FIS3y)!ctAiofO^==Xrw2-2``ox=G7s~0BSyNYM0hrCuH&6#8yV>twR8+)@pP!$pkk|*h zr@=@A_}{>ceV`<$9diaWL#KucbNU$Vqs!d1|AM?Bl)(zuL&bFn9ZZc-kHaq@s!aWy zr_hiwr+o#ofJ<{px$Zf&InCvre0RZ>W)ly5F*C3?i0g~nKH?)noa+FB@lO2cG>kwH z#dnhehuHP@KTQfLD1f>8u}2~Z6_lWo+BYb2-^yBIDdOR}wuHomLG@3~*9FeMoXju7 z*VJq4&*#ri(=i)N4zaxsXE*H~te=Q+v3lK?m;asPy(3=6oSC*K+x%sDAw`37C@Hs1 zx5Qi_uRFw$kPBFgu0z zKbiUL`H%AocP=qcf>j`DF|66w`4MH^F=#p#90B>Hw*KO*qV}|~HSNIf?8yxcH(vPr z4+8UAC8Q3rS=QO922Xttp7(1)3X((&QUTEi@>pVn9}5cDnC^_U#TRGBzFD2P9rH4G zmi_T14drm=r;jeL!f9kb%Uq(RrslwV2$KGh$tF5#WSPk}b5o?7RR0dq7iovf`yAQ; zzFFO0nw}{|<24`C7vRUtTXIP)@WEsT{h9VMr5wKiL%4faqkWADTg_eGx#l#9gmRpt zwHF}VP(zm_6tV*E9Pw=5lJt0pWQ}%WeDWpX1%krGsSz`!}D-ncG8 zJ_0yB3wC09dcS>MuivXbCW$sp4zemrs-&oQg`6GF4lff?xfn-GWt=~Z_$%tSclP!Y zI2G~yltRSjY(ImuGlMoUWKu+|sSrdR2LKJ|0Sy)(8etWH$THudk{6=X3v>kBrj*|1kCgBMzasJWbP7Ne$0~(*LIR%yNFEEu3G>VvXH%Pywg(c`@ zUmsMu$7Trhj=Zp>+&*NyCG^Z_()i3ap+Ed2@pMCZWYzm*ODPZIb+ysZ@UXU#wr-4u z<4_W(h?d{2dv=_hZFpPiI)P;5KLQ9iwj-y3G{&y$UiV}zVV54iS@Y5>;_c+>Qtf*_ zM}Pt3GRdlv#qY_-i#@{1BOcja>gUx(TOWQ;RP;@K`{_*yT+zt+x(oK9Q`{_x~@l+}%^ai@1_C?v19^9ErPzne4EDn`g^Jbv!`BGFSyA{U5={q4 z)%GA_iECQJsiN1rBa{kS9fa9WldvK|K@%c-YH9{zf|wf<=Wb36tKUtq z6QYdun?^^?;%kx&V`RyQ%Ha%t#*S>~{cXgX{ z)I^Me?49WF1=!4{(XD){*4PscJZi{M2mt7-oLXnM$h-oTt*}qxuy(`6hm9M%z1M6}> zl?7ph;d>MTg!sb|qGJCsJy_v?b1~2}ktRWf;r_6PCZrW?Lb}|F0Po{pA`uKXPg}wI zDo5EDPhc#eTBMgZRTZ{*Ji zcCM_ac8E*4=5mf?TCgInHrnpWrqQH<;gfa#x@A7|^m)bjz zXfCp5Tmln`D}B`?hxADcqO2}V>7SK5$h#XHl$SmUAFs1?6$p$=VmY@xHuUtW^w}pr zt$ec!7JhDM8}(f8W~D0U0ha*pcBr%FzjYzMDUYONzKGF}hUe?xt;x|LDADURes=pDsvCTkHTE#mr#5lU(B z#l8P=dsc7SrqB1y71_5>tv$T|(j|Ek1EEKE&pLnq7K^8ecTRa+6QXUiGN+Hz>GyRmjnY7)6~u)+}^P4o#Kem z@;3{{A@S_U)%4q%TijlMb{$0DKS`k1b-In$Z!8%(*gMEiE>LSFzY_ak%Oc$E>fL<0 z8CKE(3BRYjQu4-P-V#>@B{O$34u74Ec%t3A&4YLl_Qapm|3KFB_X~=1639K%!N{hg zql-ENI8zg%eF1|gXzgu-ZfPly%dZgj{eX=hfRDVe5I+z+rczvqC}KSKL(+()9Z3E6 z9UL4s{yRMC<3iq*z;SD9o$FD@K9dXvr;J*s&VuUMl>{s-oF84oN}|t3$zoz+4xWsf zSBp4MTciyP+>R^KB~6#|k(HN6or<`S7zx{5wl0WMwl;U%-;3NjSh0xX)WRnJqW40Z z=8D(pHud|yXLF0cXk#-f7m6-BKhnHXP|%&Hvo$pIx@{tt$->OZn)iv8inXjc88>MR zam(c2;C<(Xi3b6J!EX)cDPCW9pkKHDb)XmHYm6uP>G1pJRsm&^r@E8w?IL^^elZfh zPO&#BXnYi4FMn{o2zQ&;ZuS43-XyR8Ydo)=LG%gxxy)??G}%@;5^CzV)AH*8I+(_x zdU|@y9++X>Rr3@b%L#gwia+$eo8X&{Ve~i$&d?b3X7CWW+l6ag8StdUGT!cJZvHU_ zxxf%i6&ju`2GlYT@@VhVqd#_+(GoAx6Jvt4@;&+I6|Gi_F7F`3CBN553>V3#1zWG~ zI{j|lE zl~Jo@c4veH^dk(ZlTX@fHGEWcn<@(@$*rSc!*?jpUMPI=Y0r>?nWw+UL|r~`7W`S6 zW|&t}k4w7}uPv*rGc;Z{=``p1>~IxJQG+h3j8gNR*;I$YCsXnnZo~k;C^KGAbIP|rnw{M`Lv-BwlpnmI*b~k( zvs*y3Q@d-Bd{-8i1K~t=voW>}6^HNz1Yj{;-MxnKqOpm0ndJoI`H$m2+#k8@qpv+@ z`uUVQ2!mRUh8!1!lq&8MfUKAFMT`f5&Xo|Oe?=>CG3R{mxA;p7Pfcd04KMx|w?bVj_Y43c;=a{XD>qw|}m0P0jgHXTa{mQWm*Ydu4|< z-G~U>n{sUE@7R8`4d85ks`uSrTKau>gdKQ2QLgJ_d`z#{%XODbSN3CWbA&EKLwwcR z+WP4_C_Af-Kx_TQpq2M)PzCXWO8pTQHg;H;b>eOrr~WxfK@@Qql~zM;Iu6DZ!j)&w zG15K%QNT=-Q7`;uoju-D)@s`TUsqOeb>(@RzJ-eT2+e|?HILiVL z({M9R@`bk20F9&vn%l3*D4$VBx%S8L*-h5;*rSrd(o#J?U}?a9zPSn*O@x@o9G?fl@(ZiT?N(Pq)Crsk-PPc<)gUcPMMT_!87xg_nD zh*4ao`M~_rYaVzTg>g|q2R~~1Z`A*;3D&99%zZt1F;F0WwBxII5(pn^!hCx0DwxDq zVMH;+L85MJqrGTfK2-fo7P8|rZ9+TSoEum8qgXK5b zhq|sVdQShootX8iWVyo#x=G{FJM}+v#bsr! z3NP)7OG$kQp4$O1Z`}AS5Sx2-b|u#hKPMW|-zsv~AA=Frahpkl5q2@& zZXO-oTZVGajaXz>)a|Z{#W*5yE4PVZ-zVF)AUY;KPoob{*v8(M z#y^N4Q1wQUl9mIuvh{P^g3Cah0Vir*?mw^l9gMl;t_u}vOpJVJi8q{@2Dc`0yn`ZX z1Af(2ss5Gs(FHqXU#vd+O>fnc8urTi1_=oXlg1k%HDR5?+vFFgXx{4m5kEMcv0h2y ze4k}Q^y?-@D|ST0YEG0ZyLe*05$Z*Msv6NNqZj=u(pOLzCog787U({bB$X|l5ca#4 z;$DeI#0ejNM+RYeF#cv+W{H{}4@zWUcqg4xdgsaY^J2sRIl9)L^=VpOON}?Qj)8ZX zD;$jOb7ybWLv*d!fh2$eEVs3Atw9jQc^Q~VJ+f+|DKL}|ACz_ukM2uKI0^b)zYQnH z2G_xCY~fwikDa6I7ZQ34P(eNapk78S)af4&g2bMOw>t`yFIa_&#r>alnezPC&&y|) zoiTj{&VluPr3BG3U9rC6FB0zddKm0}Ar%!BRTT^QAlx4RW<%qydGq>A=C=6LErJO* zyTJVTe2dn6pUh9`cUIJeVqR|Iq)7Q(pls-ypIg9>jbJx|=`Y2P2WeE~$u#1%Au!U) zu^dO$=oj4~8@cu^#G|m#RWH|`er#f5Zgpj{^t(3p0~*xEJ@k zSJOKWi*i(EC&J4_T|LRRs}rPuaFJ_}VU!_?R=9o=MSb&w$7{JJS=_2tAMB&4%z0H; z)F~#L7~x{Zs$|5%5J}J?J_hksHkS*n7XfFw?6JRb`8RB#b+vM}0Jw=z621`Ez13!k zl=0_S>=?G0st--&gI7}@`ZF&LAe2oHU#|CTdQsm~ zuJv%8cu%?Mau?WhEnK3ph!I1N&(JNo$EL%zKSM+c1*(`)4({%Fo|m#%=G~Jw-5mUO z68nB6KHSlIdoMeefQ5x+FkjmRS8V-fvrA{1Q1I?L#8WmyIZ`y=oWiotj&H~?-#>C| z3f2Dn$o!1@XLrnQaENieSJccmo>mjuZ<*>{kH>ZrokGM_`EAr|6kO+Ep?AMT);K$Cc-hn1%_%)A3^~{!H-IgaVp-bk~z^ zFRCMHEDy@-WM+0TT)T5Ig;FD&b~+}*l|50!A0gk{sAiN#M)t<&es~`wt@d9ofZq7i z^)apClF}8B*!F-x>N=ySXf=;-St(wGACjph`O0KnM|WMQ?#&&qWwy63i0?_P`G?@J z$});xMO~>(Q7ST=;64QsT~TTbLhfXx%`V{krat{?Lg-Dn=b-B0g3D%LW$e79I9oOman#Vgt}g1@6o@|lIu|YYuw-++Wq9qTL?hMY95)qu%NBT51)MM^rNpGM@x4k z_8x9@fG|_#eF+yO(gnd@m5Lzo_&#BKIH{U)%CrQ@iwTO}8z6#%E*$Is?h4UoL$-alx9XT=k{V zwe3*h5f!CkVJGklcM(sKSj2+z3=)*v|CuB1*JSv_cq4o&;I&?XjKa^JH2lx|X|eP- zpP!=6?n+WZnWUro$4xfe(g&XzW}o~a?W3;=;7Tf6RTtmcIet;wYdiPrxN5BNPl#*5 z6Dl?D{K;oq8uZM`_3V?u!&L7`pSj3 z(m4S|cvleiKk0x71gZ7EPg?Jnb9^I88uI#JTd=9PqCV4B1IVbfDxOYRWu;WTRWHpX z3~PSx$}=8u2K<^qpoeCF`X5u;bBT6~bJS#tm~YH%Y*?bmd8_H7aY^2r=L;X>__ZIHd-sEscWMPLKrc}j z3~;S6mHxEG+Zn&U@q~V&;%KkAzsTgTR<`l8gTrHsl@s#Z%~3whSb7-uvD8!;Yrptx zmaEO@y-*j&Q9!7!xF@7sM?{<4x;kqk*+kwnH`tyviG`uc)n`xqJ}`JS+CygCrG!Yp}oX*njV~UjFX!4EtC2 zMOon`NsoS*1U?<(0tvd`CE{G30EERf0VR1Jtl>_VWuS5n!Y5`SG*Wq{*p&-z_L6i{ zMz9&}(z-%(>9g6`P!R%-+56`ID!nA==^_kUMc-Ip$i4i#N2{*Dnk8i0i$Q=wficwc zz+#U%y&`7v?f9;^FS;gbk1u1949E{mR5(dszohpS-f-Z5dQ^mWN7QG9&U<|Vqr$G* ztas?ioyOwg+q+Z)SXVSXl}n9k1jwVO*=`^{5#M-;gz8d=rbC_SQQJ8G;*CeEq5*B} zX_VLQ&}FN|1^!D~4N04LOzKcdpLGoC>~DZ;=8e={U@hF?(#=%QtkbRYxUBQxp4{rY z*uJAbR8&HWxNa}gB-?7jt%*rU{Gx8Ub$s0#Hhai%`uYJ2dMlax&d(c;=|1k+pLY{N z8`pz~;z_bnd}aE_@6bzGg9$4~_~trSZk!ZdjVTa^FqM%DG3;n=KT4^6=fCYLuKA+s zo8)00v0lZhe$OyVcI#-3I$kpn~lC z)4rQ+4QjWvax}H%1ZF1?g9h}N(fM$U`_k1!vcPMLBS)(c(MQFRts>JzrkvxaKB_4? z^x63RUbnBRFEgLtg!+E_;SkVjQOYYdr|Q}fLmaxKigE(EV97YmFj7tN2@O$S_rpI`a%N4Y8P91NJa?h?bRO|2(- zJv-96kkzyeCEs3#SJ}GID0YR|V^^JpxYKLb$A3fj^D07|Zg{&W3r5q$ zdRqPWxCpeL}{F@WSkNYus1%uM?J>3vzvY2%q3%`4zmQ#F`t`2OwaiC_nN?rEx zPv|A#{8$zd*8*0egli4et5Rs5e*ji;Y6ffsIryjbQ@Hi#h?^`{;DQ)2F-pYenou!{R>ye4&Be6`^r!JsAdGaS$cnXAI?Y5O&NwhQSOn#) zBbLNZ2F@IlB)ZpZ?DM`!@lMsdt2$D=0!vmk)|d@M_W=L$MY$@@{+Zve_S|AhCUTWC z`u0`)u9CX?iu!wZv6?+7yARW=jrWzi9t4f92uSdL7%0vPM^J))zTAV!`A3t`3{eqO z#LrBExjhV{!>L~Q+V_nU#7KT)Mb9P~^L{|iY#P*J$jQkqwD^t%1AboltF0b{p9lXc zJzCjfgEUKd@F8<57By-wS(I}5)hTTp5HMqd z!=79Ci5xcL?OV9k-~~#YpFX|S;rxJbyu<CD*zK2=Z!<9r1o;3}(bCqws z*TQN2{)(Tu?u9#&!^8MZ4-k(a&43DUcH8M`v>Ez9A+VrXw8O@cx&qBd|KW^WT{F~+ znv}ez^p;ERLR^=_l{IN3iRkiSV-e+E%DBhJKFWEFAZEr7P{EX$t!2$X zVGzyCw4A>2X)Un9VasZz+m&am85-}wD=RkpgH2cW_!9MX>$uDjd2vs7-c#m$U0dDe zOfR%)Qyin_Ip7(Yam0=QpAL_}s99VUfAGV{$9i|W!~ zpd*vPOst5IkPzazai#~>U)GUhRhD)OHj|Z@8umX zcen^H8)@*iBz1-Z8PhFsEek|*$}V9D2L1SO#eT{p*DEc^aNGO18T~&rjule(Kfk#* zJZ^{&%rEK9NhWF}p)8;F<*4`cgrQt-&AuEii)k0T2|>ibU-Nr1{3xInYA}dk(tfiK z_*^mX+3UusPZ%}Qy)Pxo|R@MM_!u)1-bIIi!` zr&}oi7D!8=XkNd0vpETK;hw>4g7WL{Fs#Qb>?jcmMO#@18X+g20x<4aGdwX$B?-v% z9q6Z=DG2j^X;sTg!56Niq4Xi3L4tKozmO2+?=`>COd3&51#%BkP4cL3xI?vdN>wvQ z0&sHI&w9ewi;|1~=p~6Ogo#=^$7-k(1Rz_c+{B0Snt9#=SjNU~%6M&v8S`wu2P5Mb z7vUQ}d)btwwGgxqqyN}btHD%FVWHj9^%ip4zI~XFCgug}=}lh5$BS|fsEgwh5_UB2 z;JBtU>fc8By*hK0i#*Y|eO3Em>QA{9^>aRRv~LiKCOIkT*JOoVq9Jfth3ITOrhp0_ z2}d68({o`f!si`dgT62ID@ZXqkNA3A*4XN+_puMv7Gyh8Y8#`tv-!lJUl`UsOY2v4 ztKrevDw*ZAXgndK_+beOfCr%I_7!yM8E#iokL1pLcJ$V-Ff`N;{#t*3I9E8T8DYTr z65@LOB@G#_tDoLan_~AT%vp-tW@KCg3I?P3C00fs3_DO`=IT3)9uaFi@qZ8ixFOvN z*VU_3LgC+}(=eWunDrm!dI{#aLPDfhAWGx3iOA7jd# zDXJ}1KbVEB|I@F|;Kh(~l9D|E6$82#7a~=aeH>{s5rwWNg-HZ(zOm@NV?kUD4IE7c z4&)L*`?J7LMY^&O*dR&T#+fS0QJidSKe2MpC@p!oE7*6vfBdI^SWL99Bp!l`U)I-0 zF7q?&&Rk0kMzNu!RomY2#$Lr?y|cgeDMLvgt0tEHB|PjfzpMR`hIGXUNmoW=9?K$& z#|=@v?-?jPQeAQo3m6g9YFnRb-8zZ1OlP+k2S}$W3y%u?bm|V#qp2Me0|O&QZ65u+ z?WD+p3Kb{%SLe;>V#K(F7h*WyG(6j;|6%sys@6Nk3;I2F0|OA;UAjrBpAG@jA46(~ z{s$}~K|fHomDzJ3Dcc^;B-kc2ZGm}Q+ z_}vg0W#VGSz!Hd$SCWp9-9u^8N%?)_HBozXD)5Y_)T;l*-i-;hMjoTmt6_;eJkOv1 zi}&byCr%ijpY43^N5Yt@!YSEStBZV2?e$bO7gl=sD_ClGSLlLe_U?^qRp{xi9QWD^ z2EVK#I(oTI$@`%mYdg~`e!Fz36YY;068sq?zj^m?OVh~Y_5a*EAv{5Tu#g6za+iVN zYo1uZlsVa0qfaAof7?xaA7Ts!JS0Z*r9nk(@TuzzJaazG(^0viQLE#unvM-s_8-w5 zgq4KC#if-m#C&q!cZ`wTU}DsPMCqe_qoccgf!7XEjX_U;&1%YtTBM^RsAB$QW}Vut zbH^%;gLRgRo{~+o7l!5bGZ@3CBHV$7kE@5y>kP}k8u@dYnG4>-U0nM& zlZ6JAjQE&|DyMWqU}ugj_wj_1h&s>u=3csT`e>4%iGB!CxAkMirTSww_5o+}_ue>; zd*g0=Rce$`Mde_wLjjv-*>Sg& zR=5@j#QcqsXae6#j)(MNrE6OUu0?cTfc@g1Exu1dKC(w&$4xC9td*Vby+Q42GK#Vi zPn#GwHMihB7#@A+m9u}DFBOX;mBYIz@+d`PtF9HL!ia~lKW*HahXb<4jk#-0=f(bR zcIUlQN1ZR8w_u6@8!_~S{Ui!uakGMq9V76^G%-u4554C7M3+Q z?B+Me+(Prwea1LaEhSa7x0yYkK#3yf;J(=l)@Ulf&znwjM?0@_UzK1AOfE2Skq#i! zs*IF4tMH!nu~%I-lVr_6M}Jgdh3bjn^>@P}xF~C?e|}eK{ctu5o9Rf58qHq;=201q z4?hH&jiaOECkGHxT7*e7SBSaEKrWn^M#z@6ttzyxkWW@)1tz>Dt*=iMSj@7bafu7lFYE|P z+e%O(xGf`kJJ|v0vVZtXLUZTTB%@yN^?HvU1DV!O9=H0gfr0%v++78r5a6mRp$HkI zxZ28o!>>^^w`Ch@O<G?aQw^Jng#~U8Mem^OLC${V~3CoVP#IJ!m<=X`p;V;qdM`8Mh@)zD}s!9{hgVcu()*+o!uxvW~qmb3|cT<{!_u%KfbGwycX@7fcO2m3)T_? zgIr*JWVz(^_vh*SA!+q*=bN01h5oWhs&?GUs@D8kMwrT&P3XQi&?L|jX3ng)8tg=U zi#N~k(K3!^uAsd&nxxj0$LMAn7#bRSJlyP$!@c%3?_J7A%d{?-1rLOD|6=%6iB{Pq zc`pbtGZQegVP2;~MT`*R1@%Dxk-h`-XkRy^G{$qQFXuWEQ3dJokbN-`zq@ZqlN`T- z?{a-a>;1hkenL_{F29gY=k?lpy41%S0``pe?mvQ);c!&5xYFh#-0s9rro)L2@zm_E zGy1?X9Ua@S9+2mRLOgNx&Z^{)L~W+xX^zo5xfKFsEJjSCusF(zv-H^(L~VdF=p{+|L!jtO&C6=g7E z(-io0Di@br;NXRj`-Dka*NNykiLJlTw1{qW-CLUPvN3cl*5q)0OvSX>9DL}WjST-qz$yzyAkn7)PrD~jHU{q<;cn9f*DchQQ_Lso6fBGqf3E%b;Rh``!9hVmZfL~{!hZbF?usr)I&1ctX~o6i6$_Xx zv?wT-CK307E*_4)zJ5SZkm`2Q%a=rVvPsij%)rW&@xT*sy!~9_fslP)7GEp_yua0X zDW5gtGW=ZStubXFYz=qQ3DrM-sj*%Cb{a_67Bc)aePXxLAXn-?|0ntlFCYB zsE$KHyqjD2RrnH+L1W!1NJ)oCnyg-7HU$98VNNz{Mm2*+I>3Ui^}`FsvD4Z9c%)E2{WQw9bVf!?XAJ_4#HjMO6DqoALF(E`6taa~3MyiCsWFCl}+NS(*n1b-(*!z8PQ5aQjY6kz{nxQiGV8rVIvLf#E& zjBPez8u}OhBBQ42{t8C;Lzl9yOP~d!m17JL`Mw%mekdFh-G7QIrf9m1=9hfY+KH6! z0>&?Ud;3wKw~s+f{Hh{JF$We5+En=pQx8L|@1xrbW`9q*23t!2&SD;41_K+B@bdj# zQ=SQaLVI_QlS53^T6Ln=-Q}(8`Id$ukJI3!UGdLz#PSoxqSzaxRgiQ*z;EUFsJTJi z=XFxj|Gs2uYQM{giF5BezLZmB4P}?PqJ2kGN8L8C`+7$>Cf7~)vM-MBKF6D|cPi3) zsENsmi9(VV5O^4|B&YH}eAxtZT3NRsZ^@vRnn8l(L}ix{2POo$4!xXZWLnO?C0lq1I?b19Pa8X79>iUe9R7Yzqr1i<+KqB z|7o@)PsKl9lycPndy!BwroM{27<@GFx5Q3!mTl_x=3v+)xjyyZ8^f5jMyo=XrxGOP z(ZuMwGB7wj?L7kXJ?s%F+!I65J4L9zv>V|tEC(A0h1x|G8yAJU@FR`{uHEamPkqi zbRXKqCZO3bR3{>$3HtqJ7Z)im5fcy4Hi@&~rz5Rhtm$Y(t+D-4EGmrcu%>J(rYnqo zh*ZsdxEU*ag1SqQ?WQ{LYpp-Wu$sEVng|+kR3l)Gq)&wuH6^XjFIG0fpZS{lz!+|g z3W#+ih`yae)5Ex$en~m$MkAWEGJ}XE1!XIfUmLEgo3pb4@L*wjaBN%*si@CsJ!=}m zm?ZLTj1asSqybMUH9CFJ!;bIdzT2JhPjiplTGARq3HHJ41kBtAf_2o_2j5K!zHHTM$Y6kZe+)Dz8S%w<1F1-QBwcW8`h!j}j<(DI05y5{t zmC%!Uo$cMA(X$QMz^t`s>OA$hH}0C4>1tK$S@fj`aJAS%u0^=bT$O$@(Y}kY*AM$5 zSl~Ov!5l8bljGO)O#*1#kzQ{^FsV?p4KYj2zvDGB-n@G^9}CL74g4Hk z8$heig`UWa#>O)=G`l+jl%L^bJJaA~EgKaGZYQFCGN%G2MgSz-F~ExUu7nb({+A1| zIaBl{uEes7)WFEd9Ave}%B*4isY8oD5rv$d+dpdxgOIi1_8in+GZEhr-wY(j_x{{_ zO@x?&BI^6$<9Bv5JT^b4uXeco{rh?5HNQ8zo`Z3y>c};=>iFP&`i|nXRx&T+!aIf^ zr%HtTc1|xJ&zFCGSpI8*aNas1e5c+pa?#y=lgZmq94GRwV3fzFC#}Nj^!(Jpyq9GY z>Djsynlc74wTf+;Sxq+6gEZUn=HENde)k@e7@MDZ z^ECHQ0E{1xl3boZy~=7z+0)swH|-E@0MX0b8(&FS6!cW%B()SCBpd|kws zsQPuEDV$m53+6?0dkR-q*+q?}8nt$-o@`;YP4jNem?ZAjQ6NWA9u zHxNVN0_%b1RHF+6_mq*@P)ca*E?csyI9ZL`+P8~xpNV2VovpTC%VRdOlxOu${-aH| zVt-Uk?f!RLC{5Dqh1=AGOdEYe-Ztm`w}QzP5BIqB8BA2xYuy)_ZAEe;+wCY-X7p98 zxhJcnw*=UTN$8{YH|rmnE}=_4-_F5UNM#7`ZkoBJD2BPf1-A312C@u37? ztoYe4^xQPQ{ohT)_JS!3TJX7PNTWHRuM5YzQ|GJ@FUJ6=r~o9E3K)L&amCWXJSmK! zysoAO%j@*S&@19;MQC=vt4fm&ByBx9ZpqI&)EFyWDe8v7B1)_xH^RN|h|lAzLMjJw zNu8wFn?48SQ%6hSM5ANLMbz?t1}^H`Uz$Q;>P%Rg%;84hr@varL{TDay>QE`w}wj7?& zd!LZ4JFaP!`@>vYW^7ql+*M}0d!GyG6jlZEvb{^P%aryRRG4)SITy13CZ(|0KK?$B^YYQ|Hp#>3?41PF$7Au~ z`g~?q>X7>jUINUvB}9eg_wEm}lpD_o@4mDTEh*&WWs21}HtFeq63*!=D>(V11oIGo zAw0Ivd{e*a8=7FzN>tIQ$)lsbysJs-713j5&xRLON>igJ%|)K8@tt61-HW zxe-*RX7n&0cqy*-6L>{wjj?;s*`!zSl*8=`oNh~pjLN@@AMk&<_~xXfLIVoD+bt@7 zpetF0_7(GYN9UYXbvN6Srcy6>$FU)hQouYUjWC)5T^ z*AYBnU83_qTb{Aj6^5!_Us*-QV75+8T^4)%GkTF?C@H#MhZ|Z^Z6?Y&Kt&$S)6?_d z@bCv9(L=iNQc_aArkdPMGC?z4%ARq#Q zbf*YN2#83hQU(*IaYf9gk6& z$fB>LR^AR>HrCZ#5~LAiyI#q7Gt_czntJy8ko@n%9=h_x0nR=~Aqxv$k23QYX9>!quGhqq$9QB1U1JVskyDHqgU6`8s5J(s2N!PUd5-TL!Fj)JQlvpWtMyFn|Q)? zv8cxG#axF9QeGebdiOv003_v;ri(CD5l;zE>5PnAd?fgs@Kqj1wZi~ul=~Nl^n{+l z*D1>R#^2xGrD2ru?rQ_-j!z$>GuSm}R=<>&STxs>4n|<_dy9Mq_z)(^066=kD-vf% z7AcrR$m0Y%1tSY%I_aR80<$k0p!Np#(G8nSiSbt*`e;{tZ`_DyPaq`JQ8!nT&yo+6 zM&_<}`$1kIf`nO6j>6dc@bFM`%;!AaB20FF14}W(zUm@T_XoZp)=>0Io<_ioUBkX0 zYLyBm4z9t(HyI;i3`nbWe)(dQ`4=STVEA5b^biQ(DnMK;bhkYj%v0#ZV8{ms1~6v^ z(pq2nI z%Ubx9Md8x?R&{AH$9*4TGs^Ru`nvS5>AN9bzZc(J)GBIRO{fs=P-#d+%k z4<;p__oe{rinbw()2$k*u9QslpWJ6jWgy!keN^N}68xW>=@x#eS|Fro;ZJkEAP9rb zjh-K|OU^yb4`U{};NXaE(uAxeg%CpZyEnZ^gMa^gM?L-GC#P91<1eVlGBltf+}N$q zSvzWn0d|>4X4^Lz)Q>>fg>ZB27f1v?!P%dD`vzUdp6`h4h@Cx=#zF#i_M9kpr9<*9 zV-pivn4jb};-q+Q4D+!Z)mj9WN;~A2GfS8_!(W4DnKh^cVcx*6PAe;d5i?!#Z{dZU zym1eJgX$;P(-M4Uc_`iF#i{ZJ5j;@1L6!1R#YoJkT)*f%Vw%`}8MpDJUY;g-R%Dgq zaDl$n6*V!|UcybCF3AV0hWkfHFLbi5Li+n`CmUm`?}nepfaqEFwD@yU$smb%y+={a zG)-mKd(#WmwsRha6-MG8b4CrNwH)8K|8R1`(O};Dy!h| zdz{60m0b#qX=Om;M*H;Ai@UYV?AKfd635M;WnWaCxqGkR+T(NSJD=^|t`3Pj^ZNR$ z*HZGAFR^j1MMP}u#n8~upK~WxkIim=yn1Ib#vMbgKareZurc^N_(q{m-)Fgk!kPzK z8;4&Q_%mw>`hQ$~QnFF&JgHAPXm&ZmYjN&(m|4-iJBL*xKp85=m~Fr8@16R6RLI9| zWE@mhD9Y*{n=7KZ$~9jd)=Z+b*4%J;C$6HrXuTZ1HTA{C-1xAg>laN`wZk|)<76;V zm>P-7^v}S#`J!iD#REazK_uPN30Ca^m+rI@(TR3oGy^OxwxJv1>A;wP6sa1bB3n#= zXm4G#+b>3Rz1y><95=5rg&~6(#j3lj9gj59d~cHwzaj*vc2Z>swG|mo!B8hDDPH4Z8(YHQCDFNNI2z#T%rC4 zXuBx;_()Roo3NZH3VIj40W^^XjH?n=IPKoNy*r|2r1PWElZ%*fe=qC?Ya$h|q59z= zxOMFBZ@$>6guJq-6A`4A3h>9Qy5PkQ(_wO;-21`2E!kFp15(ZAqPq|Jd=8V^5YDkEmO;f$L)yfNRBckL~Dtgf-U>o*b~m(O0{6!6>SQ$wetV7Gg1sQU>T+DSbcf8+F*`Q z#}GP&!aX$LBZ|t`?p#exOqP~e8L3+7i$z6k`6X3 zehGW(z8qXirI05!=f~BH6J)WYG|(W2rwUkZVU+4)QP$9?XdBRk(N?!915p(T!&fF` z0AlNZxx$)HNT%}^h+scKq%G=PN#cOYgNXGv+AWxIFb#?a@miH7dO1HamD(7vyVE#9 z_(Ncws2U4mwS=GtG4<>HO*Ld1m&_&g?h}|@*gUE-UvWO_xs)#He7RU?pYD&#WYUC& zPLb$?%HOh0>)a7Lw3##C@dtiihi-4t(r}R|D`#Vhw{lXdPJF$!yf(eO1|PJ|%Lb7G zLgeeh_L&A6veMql{^l27$x=EiEt`0|>ulex`|KVYF|MrDH)_51+q}0X(@c|5i zF2wO>w(1_1s3Nq;x}Xk;S%0EIp{^}Wk%$=uzM0*!LWqC;Nr@&>ns&TB3p{FeQ_|tcDP<#6%Top#VfBgM#yXBz72TPC ziCI|6K;m&&^raod#Ul67uVAU%nw2~$V;~PB^$1l=Hn4wSg6@X&(XGif>JT^P+Xg}Y z=M~cxPCx0T(0vN&2-#T~8Ki!n(a;kWi(5d^0HQ1GxxW7Xaa0QJoQRpm3#6O;Vp95C zAQ%K5N((X?-grVrqCd9mzUimq(sC_Zxe^erj}Oqa#)!W-<(Ve8u{6c)F-!$j zuDoCLrQZ7MMwArO%o2`_d%wTMP3AVoi|Xm#O{*2iIXDbZ=_eN-zN7e%h)#liAd9`S zCSY%wj@Uw$`=phx&Wp3mH|ic*Rf{@o%vY#F1D$(aPf6X*o-eigS6bDJLQ!Tn=21Rl z5~;2EuAY-%=;?CuF7AWooT{$js2d>ZBNf9Mxc^+tOLPBmB;%P8W2ir8uJO zhkuAy{aPL>R5q*?23=|?4RqA+wD=V!g@BkGCYg8vbY00P^bk);OkU{3V={(abDADO z!^1*fw3j6)$6HmKWCk3A#YbY={hek;Pm1%rn}5=cbPk{nB-dbEtmAngb@ir_ubX{UvcM1n20tXz7Vo%Q#bn1b@ns}kj#{ze4fJU9GQojfm}M7;UIn3 z@#6;rXj!Q!Dx!Fe%ECdxP;;<*H%%`udNBEzD+i(Pg3J4LkQ^EYtV;5iaj8BY{CsL# zyT^j2kFT$W)rABd^RUyc1ubXLYd)MpEXx%2B+>I&()P=oJc2%jfyz%sGSlaN*Wiy_AJ z=+Ey2zV-U{JF0E~U8eGSmGYv+owjkJQ)A9>;%B7?1%B0856oM=KG<-eaFVJ>m>k0w;*(g_8Bkyg4gFTYPt^ zbs41|g{q#n-F_ZiD5XNxnEJrXc4u^Wd9?gas9Q}Fl=!{(QcE7s+DG46X==!$qr5W4 zV}UQ_vDB6661@Bh)^VNq_knj|;OQtHqs)DxoFgx_I!4o?_1a%w1y?hDb@qOJt-ZZG zJ4Lm(=j}LITD!wUcsgqV?6qFvxZfYrrS7~rHJsVa{Qm)Hgw&#%*zq)N290r+OJ8TF zKWiZ%@_6tdhbO$|{o^^NiI04SYIhv5AO4w0=&JdhFqOsoH;6L^^CZ<{GV8iM7qeX?QX_b*NdbWOh`*fLxF1#m~c$>Vw{+BW3M({t3 zsZ9;^?9mU2KOrTC$etSv_uB1E6!*FR7mL4w|7M9JtC-6d-2NbEPNQ#BI)-=sH+S&% zvcF&2ZQT#O31ZPptD)~EBdiZY^H{@M_rC*UxA2~qQesVQjp~>8U-ExzqJa~49kL+u ziSG3im*jV#ImrX+BoR_yo)|$dyAf7N>!skS) z^;s*D+!~&sry2SB5L^sa2SkJ*^cNDOLsfXn5k#U`S*XafcA$)Uk9*$8#8Ue@6Ye?m zhj^PqkaO3M`b6u@o=^M;wA5)pt9%D!*CzE))TN>kfpEFmDMP0CX8im)TLNr&5HPvt zv%5;Anu`I{C*ThL!cBL4SMG43St3& z|Kx~OHEii0hZuYTXd3+9pMe{>R$^uuZ^p7v<$*I`U0{lE0fziFJiwNZkob~x_!E+D z1*%i0g0hU|U(3tfaxl`G!(Iag#|+r?eS2dMok`^uA9I5x2tWUCn)RG%vQW-PT6tx* zN0d;sr`m>RvoQUOOlBKE_qyGOn}XO3=|4>M1sW8)YR70%O~7=KXbtk18uv?$gHTt3 z3kqMeXFR(`K=d*F%G{umB!z+sj6mrSOf)~#BOjb<3zQ-2P}1pnBLuvTYe-zWoLPR1cae%~=r%sj2A(y59>@m%lqB||hp7U{peYI=U?RRaaE>ap)Yu@J`m z2~4)ZyGniJA&o?OR_j$vM#C)w^Qybi6`~;ziqj=MztTN=4ikx)oZ+JGu?9-NfB&e* zQ0c><^g9R<29z-+l{Z0MR?;()uK;wjLm^MU1HKRXR3tawDZjc6nsC`N4+Y;n06AK2 zqis^-+aN(LSe93!|Hg6na_O5$Kp{cAv(Tv&aDx~mY)~nSxy*hixH+j}cp*c=Ew{Ln z;&;{OMxzV8^${fvmwEFc+Tbc(rZ9Gk;zQghq5vFc&zJ+jT8_;%ASxxH_|-j7hzcBV zSV%hOUtfrMhs+K=N*N&9+jFA8$X z5qvx*jcgBEePpim%A8ox-lLnwfk$M(0gq^02&I;>yf}DnBk$&&0@C!luLMM&v!%8T zS+fbr_^OL9th|CCNouT6YUb$34KkYH$ZR=O)Zgmem{-TD;-GfcDEI;SQ^L@fJcx}+ zl~I1D$5JBb0e&5+J3U0lJ0p4@;#qMZU1qaz+ufYIzLHr6HSr6;VlgDQM+!AwklnC| zwt-KPVi({P!z4%Vxip~q_&gOmt1vq|E@Ev^IY*9}0?JdO-OkKA91U6jlfzv*R6D0s z$R#*qL^^QBBBrn^-EP1pg`V*a-u$dIl3@T(zxuxnD7pcF7b3FW$Ez#4z^g{px}VV_ zStS<#+}bD4t8)_)YC7=u`@~3ln;**{ZNMAb(V?KZ{gR>KFE}+Yr1{2OuFEK-u>_ zJv+h1pzsM|Q3CS3SKk+w}wVf#_#bI?M;P#H}n6>dsCH~@XBT1 zyzQziiKwhBnbV`7!EK+ztAAsr*SBRhzkckM`Zz}VCcRV$g>m44B>{L%T@N!UOz5{4vWL#Vt zdmY#tXe8d6T@ufe^XHtTtOJEWb1)tC3o;NUbprUB!zOSuW&y@8pFvR8YK*!)9=^tr zOF^X}ClgCkcMl!Y^ zZ)vSWNN$Ri%IOHx%#OoH=)sErdvens+ZrLl`XhIwrT!WkaS{ZBMUOk8JfE$S)s-pP z^F86OyewJ9I!D^Q>NZwQ-j?hL%3|2%?zqc68~{}^PEwjPBB#^z$Msf+qu-*0{U#Ce zLUZDWOQgW5=lpb_uE+tu!Vo;OVQIXscT5(E+B}~hu`n7XT$Tk6W@oYi+L_;Gs^i<(g<0q zfOdDqKwhR7^`%R(utLuP9!s?2$TYbwyJ;h)i~GO00NnFcFf`1S@fR$2lIBHN+kE}} zG|&3-6coC)bASx-R_40XrC(plxw={GD#1Sj(X_^h=7Qgg*5#ZihLLa-r)|JotVH3` zwa4*Xv(g^(1e$4r0y+wgLo6$epFrxS00`@nzFX{^y4l=OXk@0rXl3o>?{qJiu2jQ# zC#$E%cI55v;oO|^6bfQA9@(T5Du1|ivlZWko}FB^aXaR@cJD`>fJ!T<5nr0+b}grv z9S81jFV6n^=kL})Ycro3N|9283i@x5p+qf2BBwMW^Fkw{DCl%dBy4tu8ULO&{XF33 z_l^F<&nQ{C%Y-G@S!55b7~9`4^l$GOxZSLrr-u7Hqpc4R(7>pSd{YEOce2j_bs5Eb zxDyuA6nn~bqbwOa+XSdK&i>fDjcSUr&4)Os&1ZI$AqKbRYvQ11CVW{^^4n2Snx%)M zxD#aC?>!d#q5!Jm=;O$3qSQA6YTE|bR@}Deyqp6Pm{j2ZptDTDz;I!6bPn=^YB1D> z20l3eTZ!^C7z1!cF3Rc)I@uiyzcQODR6TH=IWQb?T(X+3zVl>fw7B8+}Rnm>!YVcE#Gyriy)@P@1I({SKB-Lv4ZncVp6x`$k?|C(%%=5hHuj@TkJL z$};g74eNsS{k2UP``e4m^5*0hF1gJ1)aU23u;%KZHX2{djl(>yqC3(&K%A@|B@+@{ zQJX0E1WhIuA&8S(VB{H%oCsR8R_#~8D{Cq$!hifDo+~|PX;r+#h|D4OR^oNad?i^3 z*l&IQG&G$XG^;pyi+2ru1{@B_MX%LBAa?lr>0jPBO3={kwMVOXh^&xjg1=g<=UiTc zxL`=^0u6gJ;o#-GsI1~>8eYR?3ir+o(n3a;uZ1v5mB}h8X+oaY6>CB#V)xp~?5S6( zK6-N=c!^y)_EA~;f5D1deJgdLv=?bpD2+b8K*Ro1^DRu+YkFjoc1-y$U23*{^HpO) z7CITgw#m2Yj3BfKr%l`U)nQF0^o7aO2c+8M5}N@pt+{Yt0dV~SI6IhFdr+o+LvIW> zT(?0k{9JPGHmEok5n}zWsGmywO5tHK%h{u%s`?Wew3z<8dtGh117 z$N-!OTIZ|?@vu#aXiK3oiO8& z9}a^a_}Y(py{6|{1bRw)ZY$#z+i*%fkOrqHCL0Wf)ffMH z^$m#4YlPm~3bGBEVRI#-5E-Yj3SjNNQ;}!y@zm>U{xzJn>2_w|++!{}M){g8YVcIS zMXDjuInEHg<*O2-)wB`ybV$zwM<_4Jg(7!umLAn*z<|t|DWzJym|xKKc|d-t4>MqiZZd7i6s{aUMePJHjv%f&~3a2G^gdKEL?>v( zyqZH9Y7_rIOARF8J|&1QH8LpdK7DQc?S_jiX<>K1$=PF@Vol)B;ImB3~qnH>740nv#1WAb3} z)j9a$9ysKRK;FuUqY|iRL$snTOyqw|@=VRSI}DvburUxvv@*H7ez59){fhJgfou?Y zSo2>u7SHc%KHV=_k3}NcZe1mhM+ValGFF|{0AGE@Li7Z84awIaw*cC)^;PUYf;lI6 z`6c7g_t5e*-J((6d-nCCgxV+;qE|d9dEM6LO8-6-aFFAryJGe4pqzE6-7Q&jFVcz3 zbGV14vGu2VrTQ>Ey}=n?6sJ)4OpIeiyYCKJQI|n7&@BR3RX$hP&PHjm`k#RN6vi`a zwz#%SXTr-H7`EAR{=J62&c9me}PHf zOqA<)nP(^3h@NuWr_Y_jfnUOg8|Yv?TyNbkE=TytWuS~u2{B}mUI8cO>N78gM?CX2 z&2erso1&Y&SFe)aXU3+(__4Am2Yqt*W8l#*Qsh-k=U0pHsm%}y_y?qR?L$Tz;zMkZ z2vUb15>Go(9rY_ObmEFTo(FY(_9R|BR>#~@{ZiDAcQN0(tll+m9H+%ECw_K_^8Ccs zRRdEZG}QGz<3AF?x+0N$P#9$DE{Z#yp8ePaQcL0oj$C_62@g}JI%v{bM`dAVXJ;XM z!@FDAr9MIQ1J|Q4JJMVpF*=~kCAbB@y*xP*EHBE3et-nhli`zN9-;S;{fE5 zIxk7)4|Yc!Hhq}z?7yHNt=u;^H^-)dPHn^+gq%)!L*c~nuso;VZoU@WCxXtB8^DCGZwtU_xl{GZk$fv z6-0zK-r=i;E86STc#mYnKMyzI$W0|8B2qClOx_t?h`7k`8a>F=viIHT*2_AMoG7f+ zENDD4a85d;wurk;F#>#~3hF7(7^N;p*?i4h=&6K3F-@iP$SapGD@CtEg9DS44b`J^ zlh(NwHPqykK)wP5Lu)W1y0*Is#^`iOe|7a+Lqeqp(`m!6Ohq*yoFGN|CL*^7 zi;lrg4O03_VfzhGO7`a!kO}N>_A=Y}T8=;_eWf7o!%cOs%ihD`C7eC2yI*f(D$tPA zrOeB){)j?f@78fE7-wkbI07p{4W%hKSppSH+7!OOVi=WrP%s;-lst#Nn}<&!Izx;pyLCkNBq-UWVWqysiS&b5dEL5I3R>t%*Mz zuG_poOC0UJMe%-2VmcrUp4ePo@aZ*R9u>I*Y@g!Fs8tblMTs3mEV6cR(Eyybot^q? zSW`%(6Ao*Oxr=5s__~0Waf8Rgc?3d&yhv;CaVo#5hz;Ga-Ur))X{0n|_}n#;tu*mD zo)zj3Z6a#&^aeRs7+lhq4NZt&4R_?srKgg344Y|}x`8Wr&TTP39F-gI0I zt;Dx}Ii84N$%{fo$hI%^y=iIq?M#o_lr3t0n+(Tqv^Yh%6ss||5hJmVluFzyGS8XP*+46 zxrW^p-L|smkx*$6u%Ls3oP>4xC5$x+vtvC>8+e1$fW`8ZwR|aH=q73lr(x-sl95nx z!h`x8%i%#yrW9%dkA*m}J9i6*#iUv5Ge{IbaZke_3KI?UeX{nP8{_D_D24?=d71$* zMUZ4@FwP(qQldFTYZTkOE5k8hZowrCR*(DOsCjB@Vv@cuXG)Om3<5LAoBhu4 ze{<2fbFi3k((OL1N-^);kVt->{nGwS{i)Yp-zjVH+KNzD&BN)ydSJZF@#JQ_>DuBF zhnspI=n57-g4vHhwPT~jkf?ab%l&`z32LGhSwdc*L>S(LKEppjDf*()7@0qjl|ml0 z7p&L@W5MlzS4Lj$hZ9oBHh8LcP(K3dPFH`f+-(B1I4V4en(!Ndo*9?o4cFdx3RBs5 z@{p?|`r&_Z3Aw>QIzz-Tx(ZWQ{`Bezv)!R{Gk2#|RHmFh-7AhZXbrC*2- z5rJ3nbf(n6e8VziQ8j1x-d<9aJ4w?@C3uJ`5&Ep1%`OF>Un6QC^tYfkeU!whQ{dCH zPE(Ex6htNoNIJI%AJ-7rUdEDv(^o^0tU2jJTTJdKsEqv;Huqc`3zj_+ts?l)DLD|W z#uHXulwkU;oL~--=EbT&Zq+92=&C`WU6OfXk>5a+y6hV~ZoxNC5Qd#qtTdJhs>9%n z!;|OzOH>oK$t;GSF&o({LWv&*yJ`S~Jg1u>!XZ#k3?@^;&^bVFFAdfcpc4v}v5DcC zE~5CUnzn?s@jjS`;_5?j7ULg=n~co$(p6>~dBdT!yIxjL2w-2u<(PlQXK#@yv0vx8 z+vH)i@OmGfx*{FCD*5LpQ#i*vdLfwcVDV45Go&GyL!k^UvRvF7mpYWw9DdFu!)LA0 z<-C1)vv19ot6gS|9eF?BRNjxv$vmlMAT)vRkBnIY_Sm-i&T#@!vzOqL95F%y`Ij4> ztYh$f&)7UHH3Ml;#RS@ac6TL6Z=$TB)+A=h+3dzrCMXQSXBSbNr-X1H0R+XhGy7i` zXBbek9Ro4H2}9aYLBe-Dq(4T1LiFPe>RE))p%t*%O+yJ9tv0pi=fKS?<^-bSpj@#2 zcH1rY`xeUZpo^=v=(dE{hQoRrd{?fXwo*sG4!(R};TWrH%r>v*vb?2L2;D_w7o|rl z(z94d>)G{XV@LZ4J=A%k6T{@WM8LLtgnVeUoO+Z zoc|3yUmaz}h)X{nP;+_bUEd3F{&1pCJTFMA*r;uF6gdoQ)gbf8XXfklL-${+msF-& zpLo>bfXkppe+g_uA~_mwWCQm4(7l!@62+m8W&LMhQ-ItF(Z(c6KdAO zW)!{&zp(^nK~42BvzAYNQB5e}&lDkpD1Ow?1r+mB{XLndn2f*x(F>cep!O&NmZ|P$ zpS(lF`tCb?W?753j>9WU@5gaExw>%wd&1Z)tj3<$r0JRWKHBX~=vUyg$vYPArUp<=b8{ggb-$ z1~OJ@B<$1}SvffV7PqrjLvbBG(MqdQ4EXmcB7;7b>{&D&yr`6v(8{frV3Z>vi^{@- zNq1iXS&# z&vk}(@F9-kLzIl6<(Ng<3$I0!1<~`HYk+a_ib9tv8vU$VRC^sDVtLaRpUqNu?rfd7 z1B$x{X|RpAu(|VfNhJQa!)BFVUNHI)T4w)c(n$KO>98*JW;rOkck4_-#Sl zZujHbHyl$RaHxLxedrA9gpq9u6$}X@a!U1Y%0^ zw?woC-nkDrmDD6Z?Dj{gVSlh6iuJ_ra70Zrhy}4l=&bZ@mf4fengV+JsV`efG;FR@ zN@)=H9Asbnkcih3pyPHK`R<4^!h<;E&8Q^qyzDyN8R6TUP_HgX$y0vn>3qn0@x{Mj zvQ63$uqEwkc}k-*U3xJudz?}a8KsSE43UMW{ju|AZw>5wcXwL)f6)+Wm2-akVs2=> zvN`^>$s0nM$!J3E545sMaAHduCFc5NIrqEY5SK8uXXld*p5t$&$d7-(&Nn_(b#Sy1tu9b!neF+*fyz;F9}5Iym^O z)vfKop>e(KNbtq>$o)blf}LMu>%(sCC*GIg9_0*q=@%JwB^@!e3rsPTcw)on;QZKa zV6EjRTr6S#PG-m}+^$&k&w93D2Ww^1B^`M%4prUs@Hl{fBq^>)7hT|0Jn~-npWf$x zTw8|9YhSw#jE`!jgRX=ryi8P!BLj>;{()&ly4sQG*`Asy)K<}y#R!uG>X^V98#TpW z7{mjqb`ph#A_JxzgF7 zX!+k#SzQs)PY~;_>X~hlL>sW(th|QpfRugCRQB@lu=fy*oSA2H)M0w59UF^)Oh->A z@)8YJ0FE_v-stEnF}NYF=iQ1#L&u>^*niJC8eO?<_#gs?IAj5N`%(>OQq+iM$@UM@ zOKIb+JODLwiZOS`IgL@r)AKB+<*^_fkEnx9KwO$0V^aOXX@9fO981*$uoi+_y1f61 zpI^pfpj&o}G~(ac%|t@EFJUsV;QuXYilA;a(7Jo#T764E)rkK-Y;Ls~S9QsOOO4?JY?*v-&cO}= zJ4tz^0}e1yQWGl7h+Nu3$OY1`mG6bh%&XzaVOiqB`rlg+K#7eVdYZQscsk)A zhkA@v_%PtSshTX_hD1m|iW6)9da9{Z6dxSlMkS%~Zy_Ne)3@I`-gJj159OfUd|8(v z=)puoUf-VwN@o?%yNmP%Ezo2hn^!-5;eRf~8v|qdNV(>Y&9#@S z+-564yGw!N+dspLIams7)GrPeYhSpf5CyV{dIGeB|1Lu0)(afH_KsUj z4s9STq^pBn3>^Qy9S(<3*fKmwHahW@lte-tC5%$Mi#jk2@G$t`Ac2*QBh1{PDgScC zoQ#TA6}W^Ypa9~ZCE;f24%K&t9ikYfl8+wDC4mg+2<_-t(m)8M=_t}_5WwtJynqi8 zI?T7J+4^Q<@3XDdTf`0Kp8y8--_8PeuU-u=hDo!%>|Ef@4o(BX=OOkx6#c54de0I+ zY>9!yIZ0$4g!$kP4i(NymYLAw&K0C!$HIfL+nwvP?5JB1$2KQxAlN~jnpSdXZ|v{wQPPOQ8-rI)W&M7)Ef#N~YpwL-yB4=y;xZcujciIDtQA0B^7Da+UU8^nF;ksof?`^RN@xa#Sok6>O4*5KP*{j>dj zALofCrt-0>uBee-GA6PJQ0iuRSSedVGm5%o*8Vuace`Eq@AW+5cNnUtR{Kpa(bDsM z2^8X16|q>Y_?&cn9&|hIXEZ%NK0X~>%|g7X<>6D4M+KTiWrTsQlWmXhJ>dJE^5gHw zQh`RNgT9s1rmy`@XjK*Sr)1uz#TTa)lhpdjCBN08WD*p4aZe{6oO@&hNu<3ySz|!# zpwp+`L{Z=yH6U?_ZwDR&?7BV#tD`H=WasK17}wTIB}@!?54)O&D18Kyvt`7X#8;Ee zE*%7CPLCIB7*PSJ2ET=f_)nKn6Id{a#EJTaC7aCUJa8GA+7ZF2)m~a(XP$s@k53n< z`SX2>N$*^L`TJ|dk4_L@XM}|EqK6m%QBnvI{39PxH+y)*WQcAboevF#)6^XA z9?Wb6Y20!$th%zbsKFZ>d*~<@zD(sSM7~b!hmTLZuDsZ1x^XXMES~G3rEJg^Etej1 z@Ax)4{v#hnPh4iqRe`Q)mxJIMbqj&aw~0L_-&>Co^kZHQWQRZe>TGiG*{sD}5?&zTw`NWQf=(V0 zDbMtd-%?L^ravKQ^u@uCW9kUQALceH5OW9?x3cY1!}cI;c<@`$^(+v-|LAMdou+Up zcrgDF`I1C3pOIzBf8~reQk7|3I68YPCW980Gvx#oTI4nqw$=r$-2B^c=gwOjW0(Ig zE`U(%{>n4S-$8ha?x=Arf}1^CTIOynK}CUWJEAD1TjcHG+71U)gfp@sFJ>>}p@Kg$ z^P-ax!{LlaoVf#VjEtf5<~;)_P;-*A#Cm5jvk4~3ND%BlyheKQQ_MJRBy#sqX(e^O zzD~k4x3uXr)Zi(gC>sDH0)ph#tx5e8Xqu?1ze(q0p{JZ}Gpb|2ih73VGKW2XRySh3Y?oR_m6*0EEZ1X+`u z3;0GumOy4A_Sbl{#FFo)=hM+zuXpEp2IgJ%NTzLO-@2C=lrvEWoaK?C69&%hGK7*$ zF&w^6f6@CaKd}Dlhio2-XMg0Q00ibzM}Ofp?#1Bo{pNJyYXf#)z`<{t^s{YqO5P3f zuL3`a)?ZC|5B5J}kH7rL$9lU!Zdv3Fo`}N$3j?<%`pxrs#9UAiDF?{qiQ%eZ!J-1C`RU$>262MVN@Z871v6G)Nqw^E_zpUW2w-2I{_ zl|%E{{X2#kEQBQpe0@H?5f`#HLHOQ?y(w+-H6%bhzYp>12ZQ)MLzm$KRmwrbnH--e zFkn^yTIT0>LqkJ{yh8m8>MRJFboiYjlQH7=?QO2yuC4-g(*sDh8>ebG7SN<5$ruh(5j%_KE1wf(;t!YdLrM!*V14hYk>b_G{XcheoC00w-qCy ze5H3rW3C3FxxDYCl~&nJv!~H-?A2GauO@@RmU;(5ATkHhh<{O33I3pMGFr%U*JHrJ zuM7|kLzetTuf1hKOgK}>^?mok#$d9@#;69a1jPvhsy9pI>@%FWvY2;lf!-Z_LbI(; zSqJK6XHUv;=x`=*Lw3b@avC2TWVG}l*DjG*(F!=s*NX#GbO>dp(xx`YA~5OvUW30f z4h&meG&D>693LV8Z(^rbK}_mDH?%+^!@q1RY?wAxajnMW?e7WfUft8EH$|U*_TRd+ zVOC4eZC(;NiEReYaD4TV&++_~0mjn{xp(DU-emsWW{k<&qEibJqi=26OE@g%%&{Oj zU=U|8QvR71Z9R54U38@s#?-3yZq}O$90$&2vOiiN_)xm6gT7px>L%Vc?6R^q4 zz(!m}*7$QV%OkKbR&)DN_gm4##6%e{?dK@_3<2!RXG8jJRh&<3o^rlYE%LLEAOEps z+qf0wfwxT&*+LV=1D906tvxcesKhJZT1P-@h~%Y7C^g ztF4I{hlyVI-F3eG)#kh3-n!sS`LyD-Wk_q$-)UUouVqP^4o}UbL}%#Db8OvicfJ5Q zM%H(c<7`}gj*XchqSJ5g=X0)$>D5-XUIJiBEBXYoiDaazF>TBK2TsL+ByYy%y+!M; z%#l_*r#W&q9tW55S{xNd6w;J~x zCxXMPS{+^Yl|pH9EHC(JU&h&y9xvnoGH6#Z|5nv##IHg zdOP2yh_O|D`Z6LkFG;Zs*EUbSbD-#GbD&GY;J1?-D97w2+A2Uiu}402su230RPG#7 zXt!ia(N=RVITQDM_ybSu7C{MTj$G4)!I7jHI*L$6p}%UWjN&FF@UuCjk!{;De~!iR zt1S;mZ~Ha;kZlI#doG4}oAglFrx!mhLtH5ZtEMWbxcJM@ea`ax2&@5Bgok7W$-e&- z-o4dTdU=4T4tbx$9<7l#59OR(Mcv)O3mZ;P>S#Us3*H4D+Ue5NK)343)xn?nwLLph zSt?g$3VAb#w*OrFsimGL->PHcNz?a!U#Q1=XTyDY>flmomFnuf9|bvHcQT87{fdfNkOmfBz(oy8ki7{-PV+;Ds$-X#I1(SC zgRPlcTq|F#?24?4l|Rzw z(7ZFZ{wC=Fa!=_ zNVU(5WC7)bY>1vAmJ70WsqN>>oxojM$r5@r+Ior_umdW7Z%E2xAMgb~)^4NH9!!K< z$do{qNFjpZ`Z?ChW8AK#x|6h_*lf`vQ8wea>R$*-9m_Ynv{YXSZRJ|yN^_0PzK>>a zT_>gQ0d2Xt^Zom&`yS_s*|1&`aQkM0p?qngq=@>*ts+|dBGK!bU2S`$%M;}|dw-^5 z<>d}-_Gc2*gEVG$G3Y z{=p$f2Kwyz^lDuJ~@* zHIEf~IY{uLW$q!~yU2bq*ThwFol-pdqZ_BEI(T%Z;2^tfr2Apm@{Gk$NP$q}wUubTvTg zZUlQVhwD8pbfd?jQc^^n+|K*Q(KEk^EsBH%HftR*nzr2EM_%fYdhp@;|NY$)_Jrg{ zqb*f{LZBe_vFCl!M8GEhr)XRL=llb_Go+mmqKh0f4c6of%5cyYFhBd)XXJ5{69;7f z)?I&gED+zS==Ar|M{SJ`JKW1vRb4p@PNcUzOFxPn30=}e7xVKaVUV;Uwu8$GNh=-z z)pWJevNdxyBS-u$&?ZNrqunOT&;P0@NBLVUt{q3bi8KWTjAt^se1Gd}a}g>P+cYN; z2!`;@m0qrp6_h0vd=`|Dm@F1Ue-P!rP*&=c>~kkO^G6` z|FK&S+A2CZKEBm@xLW=Iu&Q4bFJ61mX~K3|U!QKbB0yJo(XoViT)?JYaRzjb+pupWoga1T)G2W)Wb`Jv^k1vFJu~8%JFjXD$a?} zi1|rt%)%Ql^AMqnMQ)%5)W@{H+uOHI0V(tYcyESQO5 zk6qZ#j9%ybxAHue#)1INLGu=ofV;6^`x?IX2JisRm-jy=iv;u$`*t29pX$GLm!j(m z|L>308(Mi6PrDCGNafOy^$Js5?j9%b_aGVk6javZQC0y4q6io1BC^eG5&{DQ)1YbJ z`VL4!Jh>d@dVqh1->(ypm2IgY*6NL)hzU`ZhRT)R*49?|{)}Q@rnnaQ$F6>KYO1;P z?ItfCX|HAEGI$Q`4UDMIY@HZu0U|dIq<6q>k1a9t!qBPMdc5$@@ywbXRwKqxpa&f1 ztr2K?uf|pn*;e;S;2YXjXdML6N`YJaJg!~JK(5OBJ6ac8Cah&J#eu>o2=F27&yq1T)g21=L z1GB3U3l6yanDNn4gG~@qLPqlv`(cdmDOloh4yg;~Pzjh(&N`t7vaiATR#DJwT@BF8 z*g&iorX8UNy6`sLD&dKuuE$4sQeL2hY)|{+#E_n$ogO9 zAj?ay)Wz@Qb{7>Q0v3A9NTvR*P?F+@O+B)O+gO{ArOO&$6*z%(E~OCHLs57nUgr0i zne&Q(59I>*T(Pq>u|dj^W$?+aKQzO>larARTc+SO5&+qQrO}Hs0wMY$a`CAGw<9E` zj|bzl`ExAVgD&A+pzexiRc5iP?Q+@Q_?a&2D}tOTrN`%ss@ZV8-E%|!eWq+7+Ux(` zIvsot(K|*Nh#?bjA(|o9z<(?}uwup2WDsmJa(Mywr6TyiljF;@8a8ooo5iWJiC1NS z170}FPP)6UJJD2quG$D){(pWVOXL$-l^d2~eBi{p^5u%VPV7(p?0h0|T}8!f$hVO; zH;e2w)awkNfdGWXnwFyw%mkD@-OD+bB=4iD+75Y(_41y9&!cFPLD_f%Z#f) z17-ZA@Pmzsp&{iP2xYeOuu1~F|H;N*AglB?`idp8O0ZLE5IR1xN=N@z$&3$KrF&4c zdnqdFuJqke#-nt4eTgYI<3T)~GHlTJBt`Qz9CJ!N=c{s@OK&p=0Dw0*HlMJAFhZA~ z4@xOd!Ha&v4tSofT)E=+Mwh36QhilbMJ0WyO&4cPD#DQ&3r13CeUJCuTed#&VO$*G zGP~B~wNiK{;Ce;IXCt5VQ{kB$6!`2H0)baeD|tVE^d;=%dJJ?qRF|4An=BIJqe2llt%rhsGtA6YT*8$%$j!%M73QduieSFVu{ z5n_!O*7&0ne(n=cmNu$zWn3YGN76`WKJ|kv?z0~1O-i!=J)K2hFc5kR-qVL)MWk-DoyzncS(?CWmWo2cB;h@sYivks& zI;G|x)nFJFOVq5J7MYp-51%5c75QlY4{z@si1q*P4@W9WSs_#?d+)tc_R1)m2Cj_A z-cpH5A~QQ>WG9=9QuYcNWo66Wo8R+w`Fzj$p8LMf@0`Ex|1PfaevRiIk7um%3%(R`oj@A)7HPyMm+HZwEB9F2IER7Qnk*r5;AsZd|<4{@pykQ-Bj z73BcMb@Sadf@=y2qfo)y!Fli9_wV16RHONx1qFSFLW~e5HEP(!JhR-H8Z=;Fz-4{$ z&s9K5xFS&;qbCK&YojSDj`Bh0kWKpj#!EB@rWg4--f_KHp!t3jPVDS4c#UF{cOf%DllWS#6I)aB~?Z2ma`qiMDA%{qc~ zLHRg91x7sb z)~WVBR^u^*grj{gK)X>YH!qn0J0jS?q04mh1iOK2yzFcMw`Z$Cw>o0ezortzPiQSr#9ZozSlVrXWfid>@ncAd;5NMo2nGtE5R-KPxP4`)@ZN!4E7kRb zAXoFO%+a;7^|VBv?ev!WqqF9YfP*u73h*1+0gD>CZUgOfa+Hw%7DKLV-S^w~;58RY z?cqwC0YEP3L`IC+_=!oh*lC^HE+&Bx| zWuVR=`sjrKu0LQ8MMa)MOY*fx+^(K|jul>ChNp?j2704#Vf6*97>M{cG4TIbD`4qf z5#p=SLEg07#|&Xhn58lams=S`+y=&P=HOSpY&4HqNkrUdck{)E4|5z=jtt zp$0O_jli6H2yB|~3z&ODm3yZ?MKjXC+Iu1nSC)hppi_E|16DQwE9(n-aRIwBHSEfg z%%wp<@gf0*D!-VY-a5x{>j?G~pF`cR5bsqTRAKeKJww%$TJ&nPb}2G@-13N8~eY+dMCq^Pf(GLv%bDD|N!WA=LaP02%x` z0dx*k_Z3o4@D|4!$ncIGlS>eDwz70`S}iX-9sUS}$(!gyd#3qw${TF?j0obD(Pj}; z<&BTdCrSC`Yos2#P>x6KS4>t)gJ>*Mw1Xxo4=UzmVrS{3$ELOOPe*k`KaLI7o=JdP z8i=aTJCbkKuxt#|ipAy!E5tqh38~K0WXUc7Xybbb$Grx_QJ?g}g#nGHj3@^J@zcwP zu8OTZFf)SJg6G>yBk>mozv$QW9^#mBd zi2aEsO8G@R%FHtYKcbQqV7-{>6A;W+5aXP|D0HfXK5*Gyoi;@y5r%TEzz`U?{zl?< ztR>F(ee7_oGeWk0X&_n);P1CkLT4V$-#`!`h)R4E?)|6L3ah}D#i}B@n3Dy3t_FDw zwK^D76K93?hyeGtvso)e*_mP_Iw~q^0;lfVH$7Vs!&N{P!-+ZZ?FbxmfBfNv^n3s2 zeTbgpwiICJo#qmLIxxHDbRWeZl$v7*VS}SjzjWsW`osfd{;HZj_&1LL%I1$mtAzL} z0Zrr^E5bGPO{vzPYQ4Cx7B8=un3(W`BLB%KA|m1modtrYwn4VzpFBybVYPprjEw(! zzDx-Zx{}?*!{wA5LyQVT!^wu#F#SZZhJQDr7=|TaJ+1lt^@^|v!ms|fLw$3Q8|dtQ z?mWR10xtSJ4pf^t*LX_@-Ie*U75C)$_}UGCNh*h-87h$+R@}i;Q};l$06>-oFE8&C z9U|XTSQFbB7ZO~WVxx!N9H}B`YpM;9zrLc#_Qn{a!I4J@M4*s3dS#Z7PYZ$(Pd?s; zF$1Vt)XDhbaRuBm>zhAipS^ey zn$RTys7JwQ2{#PipixdCGJo+PPxRg?(&KjT6Lbvy&tXfh8A6VXIIifY<1<=}u#yY` zq0AGR z?ivw2LNH^$xPVYW{=j%iM`;P4UAJc=ryP*#Bz^Gm@cz!TlX_x}#6EOpo=>A`2})3P z%DjR51kg1U(;%yVyCMmgdpi9u!xzXRkLI^YIqHc81_!&c9mUj&^2_7Z*;mh>nz_zr zccb?Pr=ehq(?plgBpoRasvj@P1gWT49-Y^SGW-44oFzC;Eo zUW)C^^26pi(<-SH` z@Vqn;A>l0Jw|r>rZ%P0gHd#(2b_aS0gUw8R$*^Q6akwldjU^H61iCk<6gFQc)E$V8 z0a8IP#X&{_Q~VcSFGHOaocSJDMR_OYkG~&z+vqi zn8PxSNIJU0r~X+_^QyQkHaY)O=`ql~7XH((z;eWTFrCg03iI#8~}gZv(60bEGjIRuGhb07+Fc9UXe8{u{k6 zNJ>c5MzLs)R16Of&qCH)o%tL!^^3P}-_}FXvo{STrEtge^TQ&Mu7A|S+R5e!w6uTM zPu2FoC+9J>B#2gSA!XidYuVr2mIdJqvc;ZCl)xtF#92trWTe6nux&mUec z9-fadvJe*+_q@p*;EIEy0LRP@dLrdTC2&rlQ}-3Z6WD5FfO65Zv68Y@^+MBWjOo$M=J`jn*rvE&WQW>n{V4_y?foqp zF|(?3x>gq83s7cYId4oAdnjknp=c`5=pQO9F(rWAQ$Lw>{T!GhxJ{5=^n+FQaj~WF zU$F5|#>9}r@DhtD=i{zrx(Qtfh(ZI+iG?{9i;7aF@H2lYm4YDN3}K5<%?CiLaDPVJ<}lg1Cu@s?;=?w@SB7Njw(G<(@kZs;o%Y(9Hd z8I<9p7Q(Gh6xOVY27$RN-_mS}X_hpwobpo(aa<8rNs9u0B z-rwJ`1Kn{BB=yx>x9Gqz34nIE%MfcPNdBfK56<0J7>W01dYX08Cww9X0%O05?gze; z3sgRUc#_Mvb#+D5CO-eu&J2oH0zj*40Pb@1!AhGna1U6;=|^hIDM>BR%s@UQR9HFV z@0aiK^SQYvc_q=kuweTAaXzLsyFOFI!#tKDfxK0#)tHyZjts?eM@IMrNgp7E-e0z> zip_SSf>Vp_`~T8d|Bbv!jcSGN{%6qmsrXJGioUKF+2}tzP%MG?5SkPTDfjo_%j)Ib zk;6>~==NbK`Il8yCFHYcW|=8|TEeRIj00l2vH;1MQVRLT7rn0=kW1B6vHglgE4e;E zR-!3ZICpjDDRC>8Y31%QUxN9kkNbdj-h?2{s|-lY{`qOs7n4R*oYnNWQpZ~HzGY*+ zO!{11@!A^>lS&hRe`_8qpZ(;_mEkInfK;bJ^5sy={LfNdjXNHq52rx2eg~-7>wrDa zAOHp}%X8C_6(~zo)QY(WJ-@Y}(9I)Sp&gikzy@mFU=BGa$h%QtaL~3tJTZB{nGB7; zw4C~%7z`o&v0x09;EqSg)~Go~v3bQ4`1c&nrG`7XZ2UNlH)QNDKVG)z&woM)r<^*V z+VtS!RkLd>f5)b7#l59s{Z~U>?^6)czKGpF-Xn}g%JM8Kq0s#7@x}-=l_bOb8D7w5 zt`VS^$}5{+;f*0ZC8XA=f`M{~5hh-kV`soG?;{ixIYa1xE6;C3FIrz(o_EJNImH@d3mU z6+GTK!nJ`3A9@b}X{q3PBNC?i0Y?w=C4NyR9t08Wy0y@r831xy*;?nrb(|3>KJ-%SFFqY{gBO2r6R6o(g6I9bAT&Yr}urVX>f zfbuSMoyLPkP+2d7>Z!WWJT;`5S73lQ&}-jCo>2$|J~_$5If zRHUuAH3ZutxlOse_W%>BBijOlbH!D^??jXzPK?$&z}D)86gr(CY*y>C*=8GZK_vvAAiAY{>c9uH$kZQ?@{m5b3Lmhc99Zp$ zRy2KvxvcQ&8ya0l4b$#JSrAssv=E>DD3pY#iK)Eeg=8dT)Sql(z)QWJVWN)wA)jWw)8S zQ=`fdLzgpB_MgKQONpVOk2fp8tBI_P5FqRdz z850`MW&Rg z-@t{*@ri;UQKkdWIpmtq;Y1*r0wKVZzYbLY1o_ImwLrxCoFWDRih`SA6p@x#r@s>s zP*5w&QFP)b&%duznr@yVFSsBLfq|Z=zSq8S@PWS6>6;z;4rc?1XloGw6>88A(~$ZC zt-r}!fTINBa5zYKFvON;XLB@I6EX^TN^<}wb`=b9laN-#D!@35`jH*caYKV#ZQ#(D z`^8~-7zr}04`@*x|24!J*}AsMUu4WsR7Czw+za3U1z5rKhjWA=^#CRf^%Qe8zBMBT zBa}6ocyb>l@g@dOV=Yq)1zZOd)r?IwRKef|mE<)K4Vi}4ahNwYlB5}2u*tL&Yngh8n?a63szNM4&I0L1Y-lM0WI>z|qa ze_SRQDD(-H%~9O6p!)o)tE(9VMn*?@9mW(@<3va#JyxrCw^mZxK!d-4BgdV1nf(I#CZIb@;Ey##2JZoAhRPiD{fr>nrOob)M>9K>>sn zW1X{NHLB2!E-h;g!W#qC(JZ6^^8eBvj9s|{7#hUFiF;ryLRv@;{?g3QVVy4GrGEuM z8pe<^mpSS|uNAd8QAc?X7e|0s?~n$47YOhh`lQ_m)d`w2N8()vzW`AG516d*EKLj? z0}jc;=ngd$1eJqN(c75~CQ!qo)2~EZ1HXMhL8k5IQfw>v6bc4<_bB*JfpZW>Z>xR98^rwK}n?rjpD5oH9J&Kt|Vv11dcAU>=0e z_B1mxnIMf5W#UiDeWhY&zT6EmrDWY_qaHkaXj*K00Y>pMd2%?YPAN(O?r_H`-KxFy z*l)eh=7t^~$U!a1+{r!gdlxr0iu;6@63%+Q13~2V#1zIM_@0S5C!943m#91!jvp0P2(7`d(Kz3L0Jy3MtSaQ#8yOW;}nY@!H+Y zTU`zdssA=}9m+isE;|~@k$r)b^isw4D&(z{tTQ=}iN<_2|4OtErg@tCN?7AXRbGukdll8je+k3FwPNFr{}CN8acYf( z^1i9l)B^Z`I8+Vo9S_$2-VnIgegp`uVs+JgL(_ZW@P|`kWmShU4#lSB{ZMa za6Va@1u3zPj{x)gUgi;Q2Y(Ed4}IMB!d$zCSGhTI%JO9i0U*C2+_8lFHkqtadQX4%#tMNdO5Wb+J?uD1YY zX%q0K>=y)74btv9pu9zjW!iqSFQyo7o~i3&?ghq{A0+J}mT zpki1M+_vkWyMo830;oYC*3dmE^scW-m^UgsIUkV6UY-}#D(jnv_Kn4rm8;-L^4gDl z^J5m{^wjE)6te7K0C{vA9oV_VN3f+}Jts3P?rL6wA4C;|&uCW_T5H9VM6u#q`LUm;An{-ggMQ}};X zN&M*mI4r1D_E=*eP^lLlS!c7K(Se*3!xeV>Ow%eU*e$bU5EUh50A$fep{6~Q;XU#~ zWU~xDnLS@UdpC;9_~So7ZEu9_E_$rbTIwbNG8q`cVb_wNcwfaq>-!7xl;4F?d#l=K zxs3Ee`>r*=GX+DRG0A$iHxIdU2nQ=@x;O7K1(y*^b`@BtN^i(kJ_Ex3)UQJJZ!51y z^cCp`2$odvmAhm3xAc){R5xfwYSUqmrhORKm>p^7I4rmqj4U3 zn*byYGg`#2lzob_bGQhm0Mu!`g_H?t9keSceM)jGTLZ)L3S3wUwTHX=mru-cMkk0a zhOb{=rs)LGVMYS$@usMNkWP+{=n8B6B4|Y61FWh}B^B(mNK96>Pg0fr`xVVWzkijTi$IR{g}c%ox-p%7MU%sc zZ+J#eoELMU&dY1NJ~AG~Q=-A_WYfpe5KeTl_Et~j`;H!q{f}qMiFPgBrfq(_2y*kR zPSf(vp*2o?V3<-bi0ShuK9DHJh~frPI8fMy+K0DFkeFsAa&QzTn0)AyAp z+lh&WUfs+Bxg18u69A$LmIGiBMV+aM`wl^Htn~k1io?scuB62Z`UYNJ5>WTT=sgF8 z=n=Mlq*|f(0PL+A0JoE4GdP5w6FgUvaAmPgASDeZcKa3<|J<&b)Dg17XTWU^OHeyo z{3-}whs*4h@fFt##-Q||4@Is3<5Xq&O$q@0>6DdP0oW!g-~f^M7-5!cMUAHl{wRh( zXNQ`N?5c9C5GMzz9%Oj);Bx)8IAo)V=lqN?*`i^=<`vX}R*I?|2-vHml}FAhGAQF2%8autV{tRr?*7zKJYFmjtOk z^L@7mn8TspSZs^Lo&Sb2oH0n|_w3o6h_y@h{%k)guf$a#V1G4%xD`k%f9rRClpM@$ z;12zyh!M;PSLktRNj@V>A?`DA$w$AGU<(FjL=T(e2Y(KJ91)wOJyW~6HIv7!T3|CL zRPfMMWWtLVw?eEi)a>J1p^ChPdV&I5ElR=6$hwFsyE}s;KkLKTkDTbJiVCdyN zyVE^(zXKyB{poalr9GT%US&n|-`?`SAmTMknCiX$h#^tmdV!ECK#pA~T3$>gs+DZ! z;r_|f*1BOGdzO73tJ@DG5~PA)Lhpiwatf`TSpMl}9nq>ZL7nG9!63LA8Fb}P9F-i3 zqaLg{>Zyz09K{>7vf3l+y|W%h&m7XtpIvZ0@E523^jF5|hnUsIXZ`Mu?>(~rPHo%j zj=aA1jKLk&LOdgMg*=ANwj3{+D;mSL)WM$`PQMIS_?_5H=+FK?v0%bdb)KxlN1 zO~zqbHH)>Iq{DE;+3y-tLf_fMQ_wBxEBvV4hE;zSj$?TXd za3=k(ua5>xD{EvMB=D2Zyoen`(ED?YOQq%-C#O|sUqi-F<mPza*x^&Gh-sa$>#<06vLFwW6PxMFJ2s(46Or8Z#?q0; zi89JEvH0kVe7*^s%JW1ZCHiz08 zkUcheExX0@p~rCQN0NJ}Py8Uwb7}R2n(e2iw}(HZ_c|_~`^M>DC-C9<^j&{C>qymg z+W|kH$k^7uJz1BOJOis@>AY{I-KU-I&X2ExNxty}1ouaJq!qso3<=wP5m&M3%G5tb zCheo~LfroM!`0-olj)98!;@jB2gE-=I=^3e;LX{$67%@WvxcER8#Q%MOG|c^TZ?$1 zsuSl9ZFGtzWPX$YC!lY-x#qCLtCsiBLy%`4?zsIXzX70PBI9O8zh14$yIP&C~E+>&1rgZ;GLaj zx>bsw@A-&U1Lu2B`N$hThg^SUg!7^E!>gI+F>c4fd*#ZZNrPU5pun~+rRpx^sFi(I zeT5v{e*gt)sbTDRtlT0=oA|49yqD-#Ky=*!V@;9k>hm)rwV$9yR;f5L+qnED^<_L( zdfVq|1aj8D3ep+UvlxZNbhH&VI`3hq6Epq~nDU~JPh zsgd;B4JkGHSJ zNw{l~7Ly7$W#6TkZX~IEKADFKVt-!C&YmM!(y;*FJtek>6d+H1$(Dx>ddtZ~Xl5#d zN2{Vm^LZ?IPpPSX3gR?uG`LiNPw%Y2IA3txmBt|1n4v$VOzG_F0v1{JPZ8HYnbWA8 zBdmR?PnaJU?QYVOzNA;@+*;aN7~kezkKd`v6X^{f^DB1PBX{Hv){NmrRvT& z{=TNJ{%af4Gg5~b-W|i~ovBmHeV*^fUfIU0b4EtTUyc$e(<~e6QkU|!OP-k&UiZ01 zk*xW4mc@@Yt!%5uGlD6cF(&jw+*>z}OYt{4 zUy60$i!D#=Xzvrxm1NYY5E~?47LSbJ{AuX4vy)sLweKlEr7G%eyZ-ol&Z22uQ48aE z^=)^TuJW9r;0QYXX-mg|SIH_Jf|AL1bduTcrLC_0Nn0`d-75LXxy}^h*BXBCWLqle zU$p@JpI0ihW|lL!p1k-$vOF#<-S92gqN$hiV$>I+fjL{l)Xxd+`h9olp`NfV@|_bY zol`2Az;8O=Be?i)l&dqjYb56U+N0APehmsce-)tGY1E5eT5~G>^nIvqBynF;7PGar zwY-UwSQ&A${L?o zEWbAH11Sz(KRKP#M9#UM%kV%KN;)Tt4FdLuH%&+E!%}c)$8WrWBFX7==Ws!&9Ay=E zoev)yGt-p4lJ+pc<1eeOFFPlv+Vb+UQJQAO=15=;arCn0S1}k9>azFisg&|Z6;VM| z(Jz1V>MoWKJ1cXhJk(#BZPy1o`GwT z#_wsWcUk{<_ta}+z;)6O#)BI$LX#LNBXMe+eA;IVZFll?IK)2qE|B~I06M{k!gaIR za&N8`JuEzsAr%wX%@A_4TIml(J}_>ed!xkX`th9wSc2 zv{&MVZ%Ea(WDSRWc8mJGysdlMxGlY&=-_j6i|g)Rko`HbGPufZ{3x4h;qxWeq3*tH z#-@|;_mu`YPyZUA=RV^jV?w=Ko$egb`8mdEcJ$v8WD1S(#e)z2PAWg(+S5z5IoM(^_PEZ) zbvk}-XOAX*pe$h5uB+2Qgmb_-wD0$2f914?r^U#{cD!pSO1CE}C-M5j$^PWbZ23wY zd^_T9K6N#RdhiX8al*x=qM5=p&e*-ZsQQQl)AoW+<98x)J{^4*h@>tD>Sn#Zz&@Ek za$ZNh-0;(~t1dAYhrqYF!Dg4EN%^0cWv7~LG&t6#SY@VEHSVv=9>KvQ<_YxGHT8G@ zg_p#yF;R-# zPBeu>QgUF8t*#^ZQ%*-L1?+HJlLo*peZ~uf#>WK4*FvvcxsoOU2-NH_7S;Lp#w_!u zS5iLC(c|?eXuTe^W`$F+=l<3)2}=LWwl*8q8eTZll|CvqkOf7!IS*Oa>M>P=T4{|zY`u7|(kvAKz z%&qcgg}3Xsz8cRtVlq8BuaFQ`I>a3@Dz5v1^PtNamTKPePU1B=YyIjhbvoGfHz9Gxjw!sXu)ckti*` zZ0x=_U zI?MI}ZEs+0yQ_n&Cfp|+b0s>@0oTBCN;!L>@8aaCcyGu@=jet(&fy37C5}CoKe;dv zwuw2>Yh-%}-VQp)`<0waNBx?%Ni=l+<(An>i#w&d5RJP-JNmPkJ}udojS8Z2O71PQ z&~a5UZ#uVd!LPM7g6%X2?fklh1t=G~NXDqQJ}fC|J~Gpm;8+uC>Jv3%_fRqQrKidK zjCUqWu6fq4Sqt~weW@H>c7XfNEDUARWoY)1U zc2jp*3Dq~)Je0pm}5D*w-Z3-)zrv0`B|El zs9(%HPwQAqp(eieI%1e=c-nQ7NwXf z3!VFR7Ui!%v6F#fFJg}LSOtnnO%w8@$0~L?tYW|a_)xJ=T267W^Q##2+`la8xe=l} zw7V0?2&72)cPz}#LV468sPKN5MJ9<@exHnG9izw)>AnE|P<9PO6yur_5=$Mjy7q#Ot(l|MFusIq#XSCH-v>$6zZkPQ2NA*`KpW~L2 zGLe6EetLW8MZVSnhvLI}pLpE>X_UD)`XQQ>ilP6Ew zXvBU)(}GT}$pAT_Hf~_!TI1wwd-N~K@V91wyI@RTr)%Q=o!mk@L5=ZQ2}G=OcXW3= zPbB3#rYK*o@fMxw_f;F-~PxuMaxKzfROO)_|MQk z<4x1lV(gR@OwV( z@tdvoYtHvKa6&!CrbLtYzsoJLdRI&=^^=immS^{OEKyVK_j*spU&;RaoRpGmuG_2G zjTe-88YuIZ8k~aDKy9krmg`rr$~^2)ndASX%sbor@?PF`P}{Rk=^3aP8_(k|ec>SN z)NOZ5+H!FFuOoHYr>zK567r<`?}ZG5+M`>JD~odhp-SL`I!CH~J&xTNF+{>Ckjee6 zmt2u*|1OJp@yOv)xC37ov}>i9R{5mqg)at^GC7KzcUT<0qWfTaHQ3?t8&W*&uNIA& z%n@%xmjB9wZpxR2)UflhULl*_VUN8#va*laW!AruX~fxo{RL*9`33X)j7K)cqfEi91cvvx%qT}@}YjBEK+nx3DejXQOc4w#G3T6qwUZx?O|nJVQuSyHa12! zw#GFhHs%@D+$9}#H|?*_6V`LrH_pgnCY9sC@EvX^QL^gnbav=@QL5cqYPmT@!1p)a z(&1hWQBGLVCr5|zVA?hb*4ZK)jRxJJeFj$Rs)!7Nh*rJ3yW#p;dQ;)_M;A23#d@4$ zi{``SFU*JIc$YPe<<+#62=D1dvhS`pU)~#gQ6|`?Uz`Pw60HwY@EO|6O_d&|zltPQ z{2KBpwZ7_$ZzRVpv1yLSWazrM94lXym{xT+$5^<$5_$aCD0e|Z+(~HrA#DSHZpEnB z{T%ns<7oz(kDn~*I)%%xSvP5zexBTRZ`<*2{5qZqUTf;eyUlR_)^O`lYA2CVlVbmS zNr43M5t1CT7z&R!tT&L1iwXNg2Rhf+_ZZ&iZNBEteee<3(&oGq{9B7`eqAbdExUUB zG!+985!D!5<3M}g%t9rXv8VHoB6?|kpuj}JUv0k_oF*_w(~R+U<$c?uhhE0WlYns$ z0hWS}to{by)k;i07iB~gBaipCQxB^X1Xvy8>FVl=;RCH}lIU9he$NXVi#Sk^{KvZA zdP(EDTi8af?71?|Y(AAaYTmpOTxyc*zCAfZ8>zIh|7848xo2atuz&n^N|2$eBKW?M z3Gu(1R*OyTJ%<~u>BC$X!cGTbl(L)1GzNw?eo&fq_tToKbZ|4I*P2gec^-t2@ZDW6 zp7c&hA-$x%U79)BlH;Qy&AhTa{`&U&@k*(Il(ic{M$$Lc@!7dpU7mhamR8oA@fW9! zOx5iYz3eqP(__tcCBIV|6VTdir%v%*B|3;NvqNLrIahjv)_wa=mByFzOWh}ycWKDX z$9IWRZsb>a-Y}su*!cB(EZ6%)8-D!23hno8&%RGK>r~x|&08i#^P4K*#Jq(To-#?p z`~jJ%tl8(pV*J0!R3tr4f(5S~TY;=Dyyi={>Z5LhLB{K&aTT)=oX9b%5ERvrs217X zQ|KUgbxO4=niOmBuabd|OcWHS_x1fZ!>#%xoO~7!W3H9Jn5R%K+k{2UvGAT$wp_^@ z>Kj_>)a-jO(NZ^D_ZeGmqK=7Z!#_7waeazo-M|Ke4~5&h|ZiXLoREn1A{EuAGDRPPapiGw1m5AAz13*1PQT4UO*FZSLdmW2STU zi}iD=_UKtDDcClKe%2IrKbB)Rn{F)R^Vod9-1W9{(%53L$*%Dsb4&PA?wQxrQ8(<3 z9i79DYl-eJlpU<}(=5+-wT%zCx`ZXf=SF44jV^bOX<%ap6Thdmio3_ta(0FaxX0cv zaW@IJ#MUq0cvwFc?a1&>wq&==<^AsRT7Xuj#|?th1SIc4H+^xHl;|g~)&6SUW9nEq zyUQ+zA|%)3ZiYBZ`#4zT?3_98aIE=k8|4XUy78u`4arodr6zghch<`IWijRJvr(D0 zWeRM5QI5u*`VlH-eYp?od!O@<4T_i5@7zt$=2z}Cy$bh9LIUj#msKB0f$=hN)hJRP zs|B)s=}rCNow}7_r74@X9LbJyN80prhME++5~jFE5B6h~!0L`=P2%6n>Qj;iuHDwp zC&R`6cgHY`4vd$R+RGX8z;7!VcWi}>WZaF@mf6(C$v;4scm@L#QzO{E<7nt7@|boO zs_fi?_OBlS^_=FF)E@0HUeGq7a=>g732_w8yQXftFJmKQI<9I2hjYc}L~PMkxDVFV zO>;OLD^B&6GIiN6G`+(n-`Fx|*p#V36t2RaxaD!nH9>k@FqS*W(=>9g>}Ggp{okKC z^BH-r8#LS{FCD}T60fv1{0cJEFy^1E$?Molb;&s}GBV<@Q%e{>88SEMDf90ArR4if zsX5x^)LrTJe=m+ZM;=YQh z|5iIs4}oo?l5Gm@__h2=lSDcdpRIwPjx9}@$_Edf!@$<|{@X^{ADvE>%jk4-T?aot zdMQ1HsR9q&YsMBSke)|yEl7FBns{U}wUW5gmeb2MyR=5fvJCPJC>|E;ZADnt>2e~lz)>A)5TQ6$mc!`dNs8;eP@rMyT zTZT4SrwI}oVc`1dW3X1AYiFN9@N0?#EDy|sy<&dg`n}&~3fafBw6u)U;yDcp>dB=5 zB_gBWdt+dEcco3`!Gn+8zw-v&VTVh4pd1W<=FC+{#I$!9?Bg%MkM`MTtop%^(mmkC zxmrnh*~uj@Z*#s!IBS5;+qQJ(F^x@s)s@HRujH8O%3{Qe7o7Hnu3ULUN<+(>{i`Va z1ntA?89zU`)KbGXPjO1PPM=RVE?!S>*Vn(WUtpW3qyAx594|0eb*g#fX!7m~NWal9 zAo@JvMgFAG^hpSWEE<8bnRKBj?F?Dy7`&f^2mNcMY7%o%OS~HDOy67tWhUf#v`51m1t=0w4|cENHxmkccR%pg@4t zwDR+~XVN1_IEN*j|Ly54&fpvA`LTMn!!95P4N&X}8oJc2YgIUPG=2pPc3XdsZi4)|4&(Ds?->d}3DI!f_ z4u6Ur)Q$}pXWLT2vlhsTSN$II0ve>`{4Z*o(^K(i3 zG?G^e-j&0`2O9dWpMcGZ(d8e*#XpB+=@F-*YapFfIpKBJ=#O_I@R-hb54uZAKw<{c z=x?2b=vl(W!pm=S;UAwW2;!%ABtFHK0?R~OU(|VmnB#5mp=9sGl+4~aw9hlET;-;k zhZ2u$D^%yeW@g3ow^3kE0)>s!0?K zL1V4223!BhBwvA*JqGxP+u@Y2quytO^_nuIEbLeVZx3`|yQRJlfs|0dQiTLU^qmtPnT?k5LQ!sy{jcpXahQ8)wIl*LU~m zdgWUQ|7cuia!OrTskfZ~d1aB~e*HA|{-x0UPh__DtyY;t&bJ&_x+U{g%47DiFAi=j z(JtHg@}(3_C&QyI7!^FP%dl7BoU9i|aODwYd*IFn!?C|XhttRO&Rx>qt1Z=?lEcje zcD?Sy17hocMSbY$aeJdFavd$C`dl|p(R9mHhvQni?9)Y^5DuXxr;hz3^+L9q41P7? zgFO*E5mDk6=Gs$aNTa>2t_j@|27=*#t5MY-+8$j|r#{s@xRN4{R{(r|vxq5)pEFUY z`%?^@RHoWX59|>a5F-_0`n1(YEs>j^BuR@oDVjnk>ya<(v5AAFN~cUd#jh7MQ?r8K z5ieeY2Qpj1$OzmClw;VZ(xgZ92BgUEU2(d%1^AnAs*}4Icw!-sOe}xHYx)chC-6W- zw$hYpQ(91A784wv71?_eEJtwS5pMA{>n7zFd_JomvtHWYTf&{&+ch$M>vSiGda-bT`8O=fGe)pkI1$h#`XK*5H ze^SL2{~ie0EE_dhjDghsEOS9PyqmG-)-Iv&%{_WVT$Lx|S?L-rF;Bm^JD9J{6fWLA zji-7!#7E*rr0t$;*^LVfvlz8l+H^Qo+o620?h0+s_LxA&!mHDV{F@Q6R= z!THb-MRlX|35N4=|7MXA3v6I%VA~CRrp6O!45V@A=zAkPLPQ!uQou*F>P13Gz5TiT z_6YWRDvq5$qi|bY{ncfd=h~C)eL+k+MpIql_rpv2RywvU1V5rwo_>6R*X|V07wgV` zeYlxy+$lf&eS^d7=55{KEUPWCL9V7f{5M)MP3`(7CJEQBT@#5{$9!asO<@65dKr$> zN5IBF4j5erk_Fn|&Bg< zpu{R7>qmfE+z+iBk-^WOFL`jfQnX)oO6>}ZjJhQ5*wd60R?e8lqphs`Vt_TwnuJFO zCTytQktItu*xJ?-{#2S&_)!$MlA@i@Df0DedMG5De!jcA`@poPWgG5RrVsAcO%@#^ z-aon$bXJf8m=9i5llQ2w!7Tw8oGZ!9%-q_Z+It?hMGVmuJnTm>AV>4}$gaQx zFEcq=jQ#=5vhe`eDhRRFY2_)^(G#!6IUv5%tTp;h?;o}T+?5i~rIGJHp*}t1yF*6L zf6CMLg2+B+UC!AxpV(X`FsltXTszY46q)gy2k$QUYnS?!gGruuQf-tjeoLu-r#IolIf zFJ*yDjN0_;;5h)VXdHt^*PCr|qWN2=h5Ls)y<1J<+M{#&ZTyi4H335DgSa3IgcN&X zpa`Id$9oi+kwQq^tl)HBgdZ6$g0&SlWI?tHq*!y12SI%4Bl9mRKmA*U_VSdrU8-~+ zUwxe7Qt^xL-r`&SuMk(`5b;u$uU11u^n^sraplp7gCQcKpCXpW5fRA*$*8I}M?nSU zOkb|4v|yCA%jqQk78ZScc=zK|-^iqV0RC!#vF}xl_4Oq!6e0p(<4~Xj`}0Rr3@r+Y zWvSbOo$tUy7C0SbP4AS-`=KFHn?_8#(WhkL@+Yq!e5_ntuNP1LIq+*ct{m%fAM(Ks z$5lk}H)W9B2v(NYVtZb)Ik2m~h0a+}FCbbYd~5!k+xmKnTVe++Wb4A@3}>(??u=Z5 zRae{L6%fWF06&1T$^}0szGnA$2!uhZli>nX#m+S%6;FuloO2Z>G-P6(D!+WaWo2cr zZJiN>8SSG3D$2?dmAa)re($t=@~7GsDfc&TSV{4Th&*UcyO#V?^Mbl0hokh4L7e({ zaOA;0%b)z-O+ELGl9*95@`Ah4AttW0Z^SVOoMaMb2dG4NW3Zqo4P>DT|jP>>9 z!zBB)Rx&wFEIBp@;p-Wr6D9+-w8k8_T|olB8+364s|56J43|NpR~sO-c^4#{{?CBN z$|>MYYrq_ufHA3Mfw2|5kN;H*P|vsGstz1{%MLCbYas$J&w~_j9BRJf3Ut+5%|iJ| z3#S-jM{PBqyp~SF&AY@uh}7X$I)3J+Np4?EkM*)5{qPCIC>QyX_@y@kd?~oWbbJ|b z6cJ=K?J+h0@?C%+yxW_E7Pz{9!Z6rXWnNE`HLQ9Rua&5zmpnCyUUw{Rs0z!sJ zI@?&sx4lp9c?r5fnd(=#fJhr{2-ByPRaLvPC1o*Xn)xI^o3{vXvSl%>tgKo9U6|G1 zZ)B{oSb)bTcgYuwCcjof8L*Y$`(5x_Rq`U|3y{iBFIj`l=KHI?Pa!O|shO33JcXBA zdB!EXEgb|6PR(5vJmfar6cS0|kEc~E;*S7U*A9Ae2P=SANuLD=AD9EyNp`vOOlnW0 z?3Ajol@KCw4*It@rfdd3yYt|x^0NFeGfz2JICC3>Kt7k^?Bz1K^jKLBs) z=kX-|isZf%NIv-c-b~7ey5Fdm05e($@@+Evhv*G>cm;Ymvi;D*x#6ka{DA`?$+3D@ z8Qxstfb072z1+9*ZylkT)*{ECP`Oz5H8{fj6gen_zpEgV*{%;EO@4rl^p1MwH3K!1 zATTC?`78$eu2Z4wc?oBCx8J!xqCNUmuMG$>xQK!-GfuqOLxx3)WJSZ(9O!nG0Gk+C z)P2MfP-726t=p3*;oJXZgD{mjt#kS%*=r7KC-sQ`nfO72odN-N6P>A+Uu&0?k`YD$ z_{AlTO%m%9e;|c^oPq7{l%`$xp%E-&rlR6mdvx*Req>Ges>lSk_d#>g7^KRFA`=o! z+Dycp!0_xwTO8=qM1I9E4g6lEz2J`wATa?#^X7w5BEqWwzBY0YPZ5u z7PG&P*Dj5|REK*e;O-c}W-tifeLymL4;3;8-`_p*}?GSE#ZGw`(QoO#stYE{)0WtlU6w(sk2zOd9zRkhT%*A z5ZXJdo}4+y6QG@#Esmm1YT*w0w?eNMJxr5tX>4f;D$*G}8~A_IvEV6eDnJk+7#A1+ z1DyZOqO(xBph4QxrwL-`0@R&jO_hve@7}+chPDU2ApjA}sI2Qe#e627v3S**n{;^k zBtYq*{n9)leQlS<`8uF>b-g5o_ik-Hi1jp#g~i~^(xrYBGP;Mt365G6$Pwm%*AR{Q z?6!q`xo_lPOy2q?d^ANN{|YHF@zf3P|1>__3eN~%_Vsl?HhWf#os~6G)S9_|(U8gN zxcZbTzcR(Aw{Rh+&IE;Gy&eJbDII8YZWFc}oL$krlS;TFn{%LRZI5@t^4F0-EPd)} zRO{<8NP8D)9e??GV045=;9f{6Or93MW|mYJ_~0^Z<}IojXi?HfA(4;Zq4Nh4Esl(n ziIta-=+fO%e)MBVnoU^nFZY)#^d>(kLnJgu0#7k;O<&3F{$qi>nCc&6N}&|zE-@+{ zZ81!4Y&;owa%?9^dwe=}@TPm+cWwx9*YDe0U|p22%hK z8IS@7M1q%m(^q7f$pKmGJ3aW@1a{lt3w9Eoi0VzbHpQ7_Lq-XKj?6M#7mcVlWIHJi zd(0IE0kNQ~KjQ`z@9Oe3>PCc8dt=w{u##_XzTC5{SJ!i6(0-{2Ki;_i8T%~oMRR3- z3O_s&WoQulT@IGu+iVdYTAj~zGB&GnC!~6_htOH$t``-7Vcm1$$Huw{$a{ zXnMcAr$}@gdHxvM%w6L;r_WFP!0ktYz)e*kz_xq(=gUpU6MJcVz#wprx z!=4xWp*=j8`~A%HDi z_9ue)^x_d^JXJ;>&pC$YER@{O^PE3tvReoGxDEtw|swZWK`Vl@%R2T zJ$b>weCN28-5)XR<;0%c%`?jv_?%kQWi#tT><+qic{aa|3!0JcdB!fcQ{dw3p?GIX zox&124I(gBw~qWYQXv)N?~(X$9Oox)Q|P41ucgacRmv(qH;ksfR@=oWYo+}k_TDnA z%5Cc(76c`v1q4M9S#(KC2nf<4-6z;Ge9Pt}t3ga%I?7J`!00FQ=y~$$-bJi23sWXhPMB6TmVYsd= z?)F;3R!d$5OXcA{2dEFq6$K+h0%`p`{2e3>Q+VE;U|Rm60qCrf<5SamvSqt%c=V=V zHlup%Ez*H0;UE-6Vl&qY_ zcfE^tZMFBYzSd9`nW95(KQdRKYc38080+qP*p?VwxWpoZRR*qWjwuXsX>Z^Xq zjTMZW^J9_S(SBd2I5Z%{X5%drM6gx?0d()Es3;52hL+a{`brrhdDe-yDH$VM2WZ8= z%x?0Hy?PC|RqYJHRaDZL>yOAMt~pv)cRO#-i38+Xxv_ykzr(SSB@~?6<3>F+Q2zXW zU-R~z8I)cV(XxwDe~v&%v6x5Hrxfd{;UD*m@c=uQs)wt@IQSL6vli51 zjl$^-9)rV*;0`eiI;?_ZyJM~Tlh+YW=WL?!5(c;7A{vjh zB{S33JCaj;_s%I(qWe&a0-d>?9#{b{35u%f)N13`H0O?3ir%pe;l~+BXV&lg*Gj}* z3LY>_ehETKzi;g;Aon<9MOHh{dAf_76J4 z|G}k7Yw9I3dKwtW?McGp*nV0PGgfVL6%ypih8aDb6%%K>Fw>9+C&&5oZ^6hn;P42M z@l03bo>`v$K)7#JKYo{_r}1|oL|4!I@V2qoCnSm0R_U5G^5@fZxVLd(Al`PVB|wMX zj1)-uG<4@BJ&ozkOD?pnqPHY|Ly}21C5J@zUsU!+mxK5rJgku(%DusTPsk1@qVJfD zS8SdS7U--O*9Vqbwh)XYx~UTDXmrhY6e7U4REflqJ4~w-Ml0F3w>!a@3+AUs-{vrX zq56c+<}bm!32q7?q`R%9P@t6lWK~-!S^v=dHKejh$qgal_9KPQ#3Y7)`Y;s;YT$6CD2|Bi0p zh_Om}6Ju`(>hA0ZNi<(`Ptz3hApEsWC_;yFnrO`jX2dNh^K{`AXS)lCB0?1OGyWIBQ zkIy6By+fTWhN*JuC#Z+)t0jE+-}YG)nnP#fElOGPt?io0bm4gs`QlAO%MUg!un#kL z_}mUSaMTv|I>sSwU7%$mFMAI`TA|%Kmk^nUu?)P{7YJ1y`=qafNP` zJ}fwuI`42VncnN4Y{a?s@i2!y!WK3D@cDCkGgR<%k+<+bpa!jk0UHl*dltaYT;Bnd zqH#!Jx=wBg-iWiUa1KT7m_Gl7`Xis6u&cF-`ifVN#a7pDg8`S4lmP8Wb^pE)YWyZ- z^`w}X^%io?=$=Hzx@vV1+*vj|GLa*LbWg+EP$#eRVS;D~wC z@4W~RX^5%~I;*hKrtzIjKE;U*5}=+OGK$w6F`x#SC3nQ+zPy51g*tOri-D&85o6;} z`%VAsg0Z@~AJ2OdS<^-Pjwv2wWXx&caQDT9BQsC{aTNTTq6lBL7BVggW^+EUh)A3k zqy5IWJ-NLKmmMIE)>mWO4ODZcNSV-mZb#u(bL+g16}cvjzS|Fp_OaK*>V z6D97u>b}!dZi|_GXm<~X^m>e~59^U&qXv&vjc{K^__d>xCgRd8E+4RvM2MPSc@hpZfPi3|t->qLGE zaH^xh=ns#_Pk#JmR&Lyk+8SS3RVlLyz8O1J>>0sP$WsQ#Ey&&vPKcrLq(8Mg_QEM2 zQnGtAqzZz}XhTuapC~8w4TJss25MV~CK@W$LW5T^-Ke~m{aVtcb;90A=KDd;6C-q1 zb5*Qy(O9y`OJt9mZ<$WeSsj)!%~qu`$}|0x*tb-4W>02~kkvGT^3G*<=%nER!E+ck zDd~9|h#WPrNVpYqU|nkS!$0W{japf<lE^wlqAcKcjk?5OY75u&k*(m(X9;s!gL;}Cq0?zQfjf?dXX^R zUH)E_DlSjERz1IRju>PK%*n`G>KLPUA@?N@nes-wgT;&2g#}}~rfPD_rD|A^_tQX( zC}~u{?fC1(kGxk+JKB2h-)8j+f#ux&VsjhO2yfVV=INnhA64(>+v*Yq1}5n{o`JZ{ zEvNEXdspR?d)Y_xyG(&fe`?sg&)*h8vK~;Zsbr(QnJcDR(`**K+a&DS8QzI;ES4vs za*+GvLio`k_p2e88V9}rYwu$a8$V*?;u<;CHyx*UUnDe}nd-bRpQ(o7UqC!PH=zj? ze93f61V+zpjMO=nYpUmjmQ>ePHqTPPV1}z87g_kmZR&T}3fQ?A-NiC$Z=w8veDrh( z{kA6e1wUWV1cyb_)wk=ou6!OkZ~SmuTU~w1@i*au7n!WrVR>nPNq=Hg6?dYFO`f zE5ayZLMbuO&8?z}7T`Qby9tC}#N3$P3kwTGUM{s7;GpaJl+2F|6 zdZavQ+7cnR<3&~kX>9-)Amcf$I4Ok*7X{9VG<;CqQjOY8-++x0biFCA$Bt{Gckip@K(ezlda;-*kBXK> zjo|&6Z{&k8&W5OW=r2JU+J}_LRG4BOjzxF6RGFxHl_dnE@My9}C(86#4F{nRZZ^=F zrEsDRmuPNGXc!ze)BIXHnxIDg&KSNjC<^`b>5~SS@p4!d^k^@tm8YiKd?J*gNNl5#`3 zi}Gb>KJc4$-CHHpDwnUDsH|fquKrYi$Rv#zct-0@v~a;{)k5iu?!$omA&N)en}Zn(9L}axoNTdxzh^{^O!BqyP}7 z{oB`MHn6}e2z{vi;7(yJXe9C$7+&3zR{^={Gn40`LdU)7@&l^=Z{G)hk3y5@D~j`p zM91;F|AslnvQPIu2wf$;ad9$>#kQUjeD_}o3yrtYEb0XlW6ta=XNpwCtFo*5YpZ;R z*uXu;!2rA-{~g@GL`gnYqaBP4y%`V1?cikP{jNs8<;N2k+69j3>|XHEP)KM;j^l|l zaHrm%r0UnNg9`Q}KjM{PIo-1+qR{vcFzKAqa(!0_0mMP5TJGfk#8+5+NaUzS4AkU0 zNU2BZ06v5W3wR$8vDZ-TF)=XWx0eg*ec8a7Tgy{h!_CC0gSo;>@3(g+V&_#e1&uiM8R8Dp-26YPeV54>Wy#b$rBTiaQgl0 zdF?Ul#WBnKvb<1k-=SAh8pWyrV@4+A`Wejq^rw%xB zXMOZJ~<4>D^!F2iE_)kYF?) zQ~<(LCV;05Hm)Q1eSJ^_uClrM0o*o0LPWHP#n1<3_q@D(5l2QwKzGDgJ1~1s?LmQ! zO*1C_LVw&gPF6a^RR%vgtI5CQSch?F`Q3zL(}Igmb${%YRy$4ZkFH{LZ_ojPc(7Z> z?23Aaztdt_E_a%Fn{DxMvz?Umii-#o45J!*uAK|J=$w*@zst&UZM=ZF;DHJyYY#Iu zGW@V|K?GML>Mw!o*r&ja7jNgju`YK6y@fueKE=J*oLEYjb4^OgY*9L*}G0Lc^pfdQ06reuNVPw z4*NTIG^0*_Jbm&#{4|r&y*cW)v_OdpkOx<_$Pba5XUmNCB^4`GztRJoh)7q{KeZ3q z4g*qxxR}_jJ&=oh0+|T{j21Kr;)6l3O@K70=#PCo) z5=PbA_@)`Gg!}prNr01Ym(vyoUYHajaI~p75?&;Tt8WUd+WzyB?D;mRpCXVa52_s< zv8F-k`zr|BDC4BW#7AqOH%ti38GM$I{SjaY!H#bt{x-SzGxPKOviKSWf!n#L(;FK3MDn$Se8I zpB$%K89J2?^|mwRi{ngbNl)FdOUF1S=fS(T8r4U2k?FDBQ*t)GCk!#-GLAnW5P2U`)hNi z&_=Wo`?TX&dvWgApO-$$4=h$OhAKZO2Z;@Dx#~$6=JZOXC zoumjX4(0bq#~2)N^C9QhgZA+lpsb$&@O(!Sj;a;&RE4+)>!r!R(k^|<%YJlGNsomP z7K^$j=x`#+dRGC@z|OLAHu75#-x2kAw*(xKA<$s$4Z5m0_hYT<#KoUJUB5>@c7y2+ zBE%6q6e(Ae&Xey^8*?4pY`F$6ZK>gIM#EL_NkS{`&@dY}X^<0g+?{f?{1gNzd)yu> zgS{c9J0HSt=)8qULroh@96>BG5JeF*_!G*^Pq`r;vxXY(he+e%-XymOtAgCvD9pFr z(TgI2kGa8$`*33O;EHx4Nyg3XBI4%eHUtK0JSlzN^QAr}Qv*(7Fh!|!+^*}98mNeF zv$C?Td&4DVO3E8c=U}T`LP?*=YB&RvDq+(ak`n^F;S$^9p0CG&YqjeG+A3-%ghUrZ+Y|Y$`n9ir0y-w)WJlm8D7uvb4$WzS7VU!MFv6OGDL${$Q%WuHf#=E zA*r27-9}h-{kuM&XA5gL!EyO65doh}mliU;MIPr8Beoly{uob#4?eb~*&3ugi40&@ zioXc~+Hk+~MKk&pD^M_)C8o`1NSsO*L{chgNIsL2w!?QxFui~@FF+B>4h3~f;)`&0-0@)xGBiU zy1mdKjN}e3H4P1c@h1heIOkB6C_1XGVi?tW)J$A^@Vjv#+&edE2d0I%6FiPgn&05uN2DJ?5Qc}XnzFiJW(N$w zc9dl}Z_|^n3tZ#@Wdyi3>C--1J1e@q{$@l%tSs+Dr~;3u7Z^5E%<}8YSGmrOVT#ywxPul1`y_BPIt5$5#$YX@GTvoWIa6*i~{< z?47^AGu^|76@9m@YH)hWt#lZMj3Aa=LAZ(puD4@+`e;{CMo;hOmv`^pH49TTda(>c zNYlcahW-z8?dXn3rKW?Q^fV9OFt_asU4^7n3rS{Xre#z(Hjq2MQ|VNDX=H%Wy~oc8 zaE&e1;NHcXu?tgx4WN^GA5#i2s2LFy%kbcUY$`z@v!bHnlTx-~rTMovI6c5Iw^_H$ zzc>Unbw9sEW^p^%XuoM2hVf9=P@ z!i|K-`s?Zjqt9sCp95ZrJoP&LYi+XN|9!WLD?fuZ-ne_^BCaOe2x^!B<72;0Pfs&} z{$;U#FNCXJ7ln`LhHx4M12D}EvVDFmEG!~#zBg0Sh1f#u9Yb+D`!#>B^4Gz4wS^V= z{U!C!A7C(_(F`tPcmk0T?!ygEI&qPF{yga;sW-`^U6DTmZeg8b83DmEP{hdl)9bAV|Ug{u*koM!5_SF>Pk& zt(jlIInLt-484VOIGAKROaPd+!Q<^OWK@cdf$qWikUq_JBFFTblEk}Ro~y)=IPBm) z3=L%*^O%g#wl12oeq6Wx(_7z_X~4{C?^6kMbO#0f`ipcLki|l?t&f1}X%G$?$P1aS zu{VX^*B&r*)AlMZ9^R|t-DSdwT34qmt?IIP*9=auJ>X9ONJ21}bKVNBy<}04mq!C* z_qiGu?Pc&n3>0pP;Xo2kiYDc;*LQ}CeIQ@CQMgq~tP&vkQM&~T|2Yw~jrRf|VwP~U z9FFy1;XL;#9zOilFyu;izSedfp%n14U&00oO&}Q_mWO<#W(fsau+S`@Uo00SzHxKm zCJBkV6VSsv0ME?YSsI{A0W~vk&~MCHNC8g@uD}WnT5#1Wto1g5S7Zmq@>7G!qdEXo zKwHqI`5fFz3Bmjd%NoAjV_m<2icX>|FK_ESFp4T)x(5UIcm5o-e7gkE>nf5hi=E+l zpwP&%Q`$8oB&3xVo{;@fc;t3fLQirTfMtr$ZY)Bs6Zkq(4T$9CknfhOL#O1ds2F4f zt{{3)TIYTJS;0k1n=PuWtegi1T9B-RWRW6BB`hQ2;SDD3xzwZ&qr6r8yY91DfqM^r^`$nRN zv=01wNvrfe;9Vt!#MxnyN|)_05JpOQk|wRItD7@CJiPoA z3>Of1B4`FC7pnl+oG6&pNK1W>ZPvcz;NS)5H4l071_f$Y@$vBy1NS{NKyqS%^fn+M zJt;{5nug59#T5$Bwm>se;?y&I+5sHZ#SOrjz-&h+Uw<(VFfxxbGc)sCQB(6I=gkQ@ zxmwxhBpk5DhAt#{Hc?D$gM=IwkG73&<|q2vSh!IbNu*Ka$!pQbFi`bHMMaOC!uA6# zjs8dnMA(4PAfX-p<|aPAxSqEH$iBcp9>BKvsf4nKjIy%2qnzcS|H4$^6bVA(mcB>w zcEDqOmu*6Zlj)Z3R7o(ogu3|pZyAk(GR-EULVDaFlh}t4%>b7I>~6WFqBs5cA?lcZ zsYc+|%6Kp@IvX_BZvtp{5x8+i6HI~@1OLd1i=%puXH4r3gI*#xI&5rgSun^$5!@B1 zh>eSD+xyen;5ssLIzA!cdRJ%Xk2QO4C;#su}AW)jfIayD#}3ngiO|Awv!FhG%aNgH#3vSc9o zOJ30I_oKfR>5rd5fGVlHn?q_!fa*$Aq7%P=5x%tl_OA>GveEiUHry9Fc)uCY{C&Cq z<(*&~H--UPGw+1}Sy&&L!TP4b{3V4ybv81slguxTP z1Vt{sA^@$f1Rhk5zvGYtP+S?xZ{gnarD!7y5(84m zxF7z%=#PJJ_`ki`2!bD%`O5|k0#=j|7(Tkx>%cziA)La{^nSn`$X_-_nLwV`Whf-T z1or46UK}I`UidE5Sm$z&T|v-*yxdt;lO;Cr1H71*Wj@MtPo{U=C=~&VjSk1A%x3Q*zO=hjX#VUPS5nuQ{c;W%n79qC{vugY6I04=<0 z{++eI1S>IsN|?N9k^jpCz)@S5kW?=v@SvK5ZGRqQ;?-&L;pve}3EXSIcYHC;XMfo_ zxS77hCZjGo#snX!12*=lhwolia84lZ=>$zO#ZcML5$b1%UxF_1ul&_JECQt#B@*0! zyNDM?{J+SMIW(gtQa?TGFFSt;fYH|t9@bc0D+}mE> zJQm&tD)OuyYNffZGD} z-h}4@e0Mn%4KkzU-n6hWcwcS9&3-za)R2_QZh zchH3|OH|drTvJm(nyiRl7ckn(a8eOO5DMPkV3AN4+2W=gl>WTTCcQ=gO`mZih(jTm!VL%Bp{AqF1rBk4p()V@4_U@?{0*0ODT#-Fh9i zrwi>&O;TZ(C5{U?r}`vg+}}a{>*2h|m-WQ{kzUCJKQL``iM?HX<^O_>{~~<<7i|1z zIr{%^u;G2Kzb-Rno=f~N@I0ERDgQgJ;62GbSdkSh#C@^_H>4Cu}8!@eHzz1{($vb@wn@J<^Eac{I-X--MVw<)+4NS*Tlm~yZ<6ff3v7@ z5SrOPip>xn2Wb*qyKIO*l?5yqufyyuCv#x#8!&a;zv-_vKnnn}_- zA6?d8+kj4Z?aEv!+EDNdmY4UQ|Boa8S=AxY{SO>z5JpUNNQ~wd-wF;DKd~gh6icXi zmsSJ%?%Ih7h$GL8hC6O@ezm-o=FGf%7I3afJC$;;n;y6dQ;yyxSQ#Tui-~QAVH5-J zDa6CHC6_+T2!>LKKb1JTPfh*YEVP@VTH*M$xdl(gDtD;L%Gf zpMG?y5GgfVqZ==%MVtDGiqe9F=oBH*caxkt$wKGeuDAOjbH1+meb?+WQ(J}X9cd}`IbA8 z_b0zD%4a?$@+0^NA5fr+#Hdq|oqGMLHm~D`0bot&9ZXD2qTOE$bCb#NPKkea`DE~; z7_#JE1Yn7C&-V|S+(5WMV0>Ywhg=goVi+9o1tdV-d-G~W`99W$Cmmn`&GyZut7_hVXMwj&%5X% zxoB?`q2NtVlP5K)#}nHFg#}=!-)11z~BZemIE`PppCZ&EZTDy^qC%B+}ju&tG@#B8%gZckn#qU13*{ z@7ow^mR!1fHvcZvBVs2iO;-Gv!Z2*dD~&ERTWpkA+o>qc@u#PUM(^#P2&MfYN35Sq zk$>{XZmtF!%$Z9>QG|)2gqDbcg6a?$r?nwsD3%W)7Kv5VOX29DT;%)kBDa7**yM>` za(%t$h&(&Gu~f*Y8(%71fQBDWjm|EQmf3cV+~ySIDD^CUti|)r|G}U1e^{F=A52pc z-r@h^#K3bu%itjY8JINlMVE4eUA}iY^aMuoA)JPHYCyTyUK~cjfH^7Ge#M<~G2J?= zfWqO%`8I24d*_)6MILH>CsOa7pUlNV>X{o=R1}ZsT2_4ao~4m=wmTScawtfV>VG}2 zQI{7IANtZf#?vbSCSjjiv|WjZQZ8ztCHgAB4moNOHNkzIDFwvIopVYhu~tR1USp|k zv6iLR9oL_rK@#qTfn1h1YBx8@dQPI$?Wx4`er@JqN`voxL$N=ZI1cPLW(zAc;>%x~ zPeao9LgqF~DeS`MJY7Ynaq#mTghnc2n0-Xl9& z9Zat*p2zceGEkVj{vg7}Yc-wBa)H|ZdmQZj4Ik_)Hz%#@tDkvb9otVP(H1%yodc{n zC)84yJKotgiul$01MH&q`RL~(0Gn5xzKZ49v64~-lXu5Mv0JeoRPBv>p3G{OW;}C5 zxnd+}MQMeN{UeabY;A)-HYu8GsZUN>BKz(cxEJDEE!E=0d*B$3zmZn)Cl^?tmm6NZ z2|v%gH4u&bif?<G@;pbnxI1dglYr!TSZ;%E(6Zh=OR>X+d9M)0{U6d>j9Aj$H9xK(xV# zcL>=LesRC&l|j!~pc}C{!9v5nd+b$*-L=Jtd#7yroh7#l#Brhoxky{mGjj&y%L6CCWxGpn zT&SKVDvp@Kp4D`Abv?yO^OS822$#()i&x5*I=r$FTDkO(DCUpyT_ww&UWunv7B zWFwW?%6CW{$3tqaQOx2SyL}mb@2&Q$(-=Q3fTfj}AKgeqjd$)k?T}gnpzn7Y-^Kth zosZF2FKW>mXi~&SU%z`@IhVn|9p3r84S|Jv4DF$yG0B*H-TbY#a5wp`!J1uRb|6LC ztJho}nw7m-wp_{pXoDP#SdSim1*)AFKTcwJEJEbdYf85(@1N{iNBSwPSNh5wRXd)> zobjDx4qBY3>FMbav!2{%&zhu{h(F{%OG2>PQIeGn-kPUNN_id7<})snz?X~>JGczG zglTokQkv>GWr*(9oT}VQJ{@)3ycIQscEV!SHZnC8T)N~mIlnmFZ@a%(m1Yc!PNgsQUDq_y=Hyqw!19k~R=Fmw7s@Rb!l3iV%MSM=9ZSLL%e`tH)^Z99;nz^=6J~S)W__S-GQUYs2;zrjw zMeo@YB=Y#1@j{gWQO4V^0$+iVj1P6?@GtmkjNPOq@{B^1wj%ZNGQt^H2^q zu?8G&o~>%Ae}^IYFX93K3{?MBi7RAsSl+ zz7Q&&?+Q2ZJQ^y#@5n1DR{sevnEd(s3ntm3D zV#Y^@sd!*a&bHUMi-(RNbgYONIX+sZH4!{;u$fqFcZ+p)N-L9gO%82eGZ}*opjdGR zr1kB8opML2fxxbux#V^gP@uX7O_u>?WSpAWWFf5~cuLWekn#M5Z*C>)gv7io_M2B; zbRh41EUn?G)aQtym}6w&z8P{@q_F}%)!xQ@Uuv`M!Vp{CI@+@WZlTWBE)P9BISyVU zuxA~LcCn}`DMU0StvU859xw|{@|bQAQ$mVkwEnf;m+U%7`p{{y%69*>Fl+kF)y#dN zSAQfB47fJY(YhfUT0PlfEX}4d!GpBo_rEv^2E5aKY3xp6_`#md&98_Qc1ob#vchNd z!|7&mUlf-|aYCBk*H`8|6tzq(cls8ofnkhZwv{}haHHY~6J{1Q$3&T2%vE{uHAwuZ zEmb+>GdVUik#y5%nk5MGX&y*63c!Q5n#aK7CC%WE;?jEmECSs&H-nS@IeGhMrQ~8A zjJt0)I(&mdu ztRI<(c_}cCtO?E6HgjC+kumd7Bbg^@ZpSpv(|KP|K*5kh(Ii+i1={x*4gASMS5h3Z0HEABRnO<@sZuE>T>|&O@VU2ksFR+FF)$O zv|lu2a)3iIp_WP~OLTkYdn|jU#kEEOUKya`)sqcDCmt**t#m?1CQWfBrkVv=MaFG7 zv%PlnUFv$p`prSv>a)a0OMNsFF+0lCy*Otq-Ymse)n@>@DNV?er2naz3N^EHQr(gH z+XR=Qmr921RQK8U0)lqWs!286e-!lRst8}lJWa0Ez@$-XRoqk=bVIU0{ns#x13+$0mUTJG-&>ytkcvI=Rc&9lIj0VcjC$tON6R z%F)sAUkI+M+slSs>$s0-oRJTGxO{SYGEn8rvpgzl$4?-)I=xA{@apMgpX<8Y#|(^^ zNvEcPW#uA7b5HYQ4R3F6u%9{-IRpew)DvE(wo0=P1+}Aw2E_#v{jiBYx#S1=0vO_t zU=g7^!D%_6juJ=my=;?)dUGfgb-*rv)43`#1(jm+chem%3=6$C>Q!SB8s*A{`yfsg zK=MXHeYpLigCBEEWmSY-iOlnH$GOL+lh7k!qOsb*O1CUeP6kaD9X$T{+!&=qf7^-u z;`+WEq2uLQ!sG09$*XHzI(9X4c!s1Obb8Z{ET%njEZvT!vFQo#Pd)K2Za(V?EOk8} zI-H>7iXW!G=#Ku=K3)U^8bo5rIRTLM>h z(;w0e(aEfR&4qG8I|H0}Y&)fTOT!s<;g;+8XWR});n@RONhKz|OPRvUx%v-C8dubf z9GU3kKYk?W)O6`;9RFk%yHuW=3VfhmpHE@ARhz3Hs;?pNpytMw&yLS}7VIu^WQ-{C zybt)DS@~zI`j0e=4nyt)uqK0Mc{P3CAKALB=#B}|U;(h*Gmahk-o-^1w=eP8Y7CV*K zofw2BWN9zwhglAlrVpMJaZA+t?8Gu_<%={pBW7YI4kWz4zGv@}X`?q^Dk1qNI}QIV z0eIi-3d(P7ngD)G&29E~J>FXt#cgo?xVPo%sYmumkzkCfVkR2mKEAc%Lc9G#<1_kQ zlHoRP%Dy`v7OD5qJzx8b%XSbf^W={-Y z;ly)vHJicih&y%<*Xoo?_t|mP5uhcT67i1c^Q^q(2CJA0AT1kRX|jaRNB?7vu;Cg| zJ@Z188=up`A2eGfr~lGHlZ7~OH9KQV#iSj5FpBEb$h!B0B)ND&R8Pd}2a}0BhR3Y* z@~n#QPTxDOJ~sWWI}r@0{UrA*owqZH%d;}`c*+(6g6ie-h)eUh!JeYImpO8kmODF? zJ~rSD%EfqypOTO2?Dfg--rgx<)T;Ve6Ev&f|13S6ocZ-{S52dUUtwC!o%uvRUB>;m zKuqx10hhglELhjuUE{3g#YtBmzr9PfoF5XW$OX9fPi(mhMX;%n0iTlrQqA-4zIZw3!m|&nzRF3`xB%CR1`E54NA}P6m8n5 znt;!|tUx_>yTf5WT@BR#(+7<5;a{}Gk2+{t`7}b>HeM#M$ZIk&`XK(VV{|f7=tJPS z^U|1%73ZQ}?BfU6e~L5UpM3!79y_iFBosx!CO*-=QgzXBs_pIn%4n5IZPmY-v_15P zD^*K7+~%y&Y;=rHCJSOSmjq2f%*jhjm#HGO9T(`g&V@7 zg~h-$@)Tg|!`=T4)r&;*scv><#O+Au27Ri}4e-~-kr(dyNuO(;&6|E*BQ4Wh4!>q{ zAzc@)`QLWYum>qx{gWHa-rx_oDBouEO%5G{5k!NVN z+WHspRJHH)ohVF3>hAq{*D?e*i{c9K?36vzZv5_pn^d!2jEFe|s&)P!80W++tV_nBRC6zfW*s zc#+%i?Q=0FL0)jZdBz*wbC_#k6gwNr>{Fd;<7q7ocUj zZwI&lYe}E{Qu6|UBya;X=y!5!?u|U->f?(dCWSAHl(1r_%g{ozXj^RFDRySd1})=1 z;gt@c;hKqRrit;OGdoesg%aLWF(u*6q#bXQY#LUy7@8?I*J=s*T42dnkzVE_o9*W6 zoG)`{tGQs^Vifw1g)Zxt;HRm`dVL_U&4`Qhtvm3HS060mURan=x0ve$Nvd_xq$%7iF5D}0dM3qKqmWFl$Q z)}5%yJ66Za)?nUKk;VIyjN>8kk#1;N)EgkU3krQ{^?mJ=zUT9RRRqaRm@Lb)x6R{B z+!F(%Zd0#(U!B2mzXo(CYs8(6Lr|oNUpsI}$P^yp^pSM+p=NV-S>kfjHo86c!kaAv zh79^eTUutah}GuyD>wpEGTzIa`3wD?qV@|jGKMk<3bQP{SYaJV9w#oPRrQmh#y2=L z2z~z$Ku|oHY8x{4zzc4#*Z%RWve&3J;c<%srKFghCaA*55TH~M=dw0;E>CrSCA32F zYhPzcG0~uMvgw+8LAD}eaU^jA(A7U#CK1kJZKf&IWLCU~)sZ_ztuxL|%R{eF$)_a2 z#RLorZwvd8y3ETKfZCUl-GIi?{>uq0mgI#RXV@NEr`-d;-l}gmustL5Wm)NS;l2%LUL2ron14b zjW{C;94+b50t6Ka_$>RcZv;s!B($je>|vQw4{Fu>Y>_%~pSR4SR4C{Uw7(~Om9K5~ zGe4CBaK+AHk?sNHY58)y!xMrpYP}|ejB~o&3jFT2W@r+jyPT>sKSpwso7$+X<#yex z$Tl)v3+OAKjRR?MTeVw%!1iJ@d858E%BPm4efs{+VNuhv3!@-Ns^L6znM&KUcvMof zy^+B_@cuuA*k?}eyhBe zkUz(zvuk)wqXW#Q&x?HZ`49FT75Cs|V4X?HOq0=JE4&4_ACnMFBy~l8nSae}VCDUX z>i4DzO(c)-xb6H{+$lf-rubWbrWKrL1^9)o3+AmlLIWS|nF@A|pP`VEb&PEJk3Kpg zxXA%dB%`p`y0`w_I(y+Et(@^(p^^%r#NJRxaN^4WhgNAh4jwwF^EBmMXt)woc z#RHuno)V`Jnmy^t@P>!fVAyQ#9ee`%-vh`EK7{IX%!cD{(Kv{mc-Hg9>Vn3d8l37y znb4E@=&A5J)P^-ewdWMLhV3Wkt*@eF1mMVd<~`FyyXF@Bv&p0fx>WTauJy&Aros>% z&q=(VGNOfvkVPV{xhYF7&_@OcvIha-oBJf$d~xQj(ChAF#eqTKZu`s}NO91h2d=aXfffY#}?i{E|6)AP49q4yJ7B#{liLYonl^CW0EBt5Dp}>Hw}538HtP0&0D~N)c};j;p9%~3l_u`A@IxeLFu(r? zgI_qUAuUzu(zua?GHnWo)d|B|Ijw7xo(f@Q zyAkBVXr-p3A|`!ledEG*B~It-#7Cpd4(5F$N?McUT6iy68kw>t-ItpbKjWk<4JNzh z3K?%MQHL+cKH8XHJV*aggSi^%+7m|~b-Gki z-kp?BI%Qe*smGkIx@G!ywy)WM8?C{n7x|JkkTfBXWkglUg$*o5>^y2%q!j?kh0t^@ zq!mc__{{V~z_>8&<bxtHE*abDQfnXaj8-M1CLvEvV?Br@ z@9X)o29{yF0dgOA`LauMMP%-Q+%%O(Hb3TS`AdD_1ZpGX_>}dO-L+#Yvn?l`#eM1P zhK`#o)%heR+g|K}_X;o-GRw+eSskApXzBA2<&o4|3=QO{gl~svF7;;=$8ebAq@Q#C zAo^&P@${`tbf((_X(d|4_b;qI|GH^rKl&FIzwI=*liPX$>+tw6 z$2yr@`Av@7$XgtX6ZaV=r7SIN{mI(}tn;1ETb*>4+bjE8C@Str%4RVvoTH{*K{adixf4m1d}myxZHXa#WV56YaMA|N!EM-+3qFbdews1!ols1#DSh^QNu5f4)3;Q zUiG}&ec-RZtGdQ}^t1Xk8VX7wq7aM@UoPV9K(4jM%&&#>uQ>Vx8;4DU8ndS1@?M@^ zcg4=VO3~Gu-eD~+TTz*UEbP(qnM_mJa=9mXc5_|wlisz8nS){tXA#se`N$A!jk3YO0I$j@#-rob~9vyKYmT-z0V= z@T5-epIe^tnyu}tm)Lu+5pW;x9n%n>?3raN6_>@ZKTn>z{rSkYcYd_ewK_xQK>O(< zwa=#W3!l!jzOX)3pXU6Tbyv#;TtKc^fI*T3a)3ishV|;(Z*sUi2KT@{wN7_PsvMdL7<5V%=cwC1U-hN6N@%{HpS7cC2$ceV&1b9GnroF5_rhH%F-*Pp4-6388|osk9=tB2Li3H& zzHE0W@90-5Q>p8*6&fn)K&msT(y`^LV)f%yYN7bOT{aBTgM7-)xFp+%)(HpVHbMrK zM8cyVyQjUg5++;YElxF)wGK|FMMs3}R+EBP{pvlMk9TQ@hLZU)O?E2eT=IX~;jDL^ zSqA#<-OirXh@{a7G#^~nQnw#C8d%o9BQ*3wtADvvd(id#Y`cK=W-c|qCqKhjiK1Gu z;roiYfx87J#~G{YpLX{++uN_7E`ob4cARIrzDk6!q`!@%%}yw&NjrHuQ@`GexpwM1 zn5UizyG=-Em>tgTzEzTqUtp%+MW058a2> zP35Xzhg0|uu4v|6XZ>+TM&hg;QXn42_}-Q`R0u=8UnPt~I@b>?nC@D>9wNMvY0q^XusQn2i=BaJ6;8moHz!=Qnwm`cqR) zc~z$C@`1W>BoO)&e&sZC_sqFw7afVNq~^$TP9W1FF!iW)-lN7Cgp!KbyO#=75V z&BtrBJ9yXz8$7H&nl)?a=q9kNnqd&}QIi+WeLU&dX(8sDV{kugp-^Jf5nlGx%8ZPU z$#&ZJSn5ml43C(ov&$*HA8FE8V$rI=F1h@zWqP#mS-{;+mt~@AX97#d9hZ&IH)4(_ z1ee+Eat%QVJx{g=6fK{WxUL?tD`lOA-|Y(1nRIhr=E|X|w;V|VXOvpCLG*^|fJAx1 zYf&c3TZWESu7{0vI6PGo6*fYRbbQHZhIC8YL6jnuGc$`}v>JIn_*E=FbB4o1NN)@s z6!5)&U~iOgFP3CpO4s!BI~YsXcj-#o-M6iZ4EZmE2umDeS!ahgQ4UtkbZ2#9`GqtH z6Luw>qRG@}QdPzrEV8s*9ZlztYMt!mvXr?DyCSC(K%HuRtg(u8h;ihWAypk?E%)=U za~Pv#d*#&Cd5uO4>&ngXU8bn{1B72^5Y)bY@9DDqpFYf#O{?>he zKA+zo-8tRPYdoLV^BRxqaa|Wty;_l~ltwCC(V)&t2btN0F3rVkEbrTIxFwHFTzez7 zcE*!1OC`9OoO^+Qb;Aryt1+J${`TdvrbS!$lys<`aLU-F>g-1Pa}yw?cQcy^jMiIy z;F~KIK*DVrs!zGj?U(JLxHuNOxZ|5=jG4j4Y2<721t;vk##YfgqqEE&5Z~5Of1I2w zgSE{JvR^GTGhh-}4t6uC_*y3Np6cr03=ixP}^ec{1+M+%SXXo8E~pilv(oK$*9 zU9vpPpVA3-=S|e@f~w$!X5J-XG+(n^uOWjo2?gU8$`PF8tW2V7pi0+lBHvxD_bq)qjSig6JvdjF=Purbnn8_3d~1BGiGq*m>NJ)b zP;8Dl`E`UCitf6g3hy;@-|$} zrio%7pcy$VYo5OF6-pG8+WPFZ*UzM2CdiFZe8R6|=mivqT#XS{d|3s|@)4+x+fGwn zYN7`9IeZ*MXM^GhpFLJz!z(3BEPlI@s*#t-M22Qfk+4w}g+{&}Y`$|G7VfMI~1?gca^>h1pF+FXSlZq1_*+e}4?ynCou+}~0- zGo%hCue(zw#JTonPi6A@c8V}!t4qyF!6|}=>@7|j=~mkMqgE=ort%yHH#Z%e+*MTM(3rr1lI+LcOkMs!z$X}nujyh89hMEf^l%old7lwB74 zu_16E${NBxsxx^p`CFa)ogwbkWh;I0Ni*7-8Gxch(ofFtW8&0(*u`F_!%_(H*zfJ9 z`zPe_OybFD*uiCxMdvw<46&`A+uw0o5STNA;=ZPUw^e5jfd4s{|Ng;W*{$$WR^4nl zsXW?VQW|e!m3s497R`^=^P@>Cl@3h%X7Fea>q%j&i5#`?DqpHYd5t7ign6*8)kfh~ z{+7ZV8!SXW_RwWuw!>V(+@{`M=;J_kzr}Ry^uoZ@CMn94{BwwrPw3t6eUt*0IGUnD zTYapxt0H3zzpzXe*s%_K=O1%d4_w!tm-fd3Qy5aD&+DWUUH}~ww-{sfF_^vg>k*Y# z!Q?53x|okfTDDr~4juaYu-+!KkUOzM`CUu8v$q^$w0>B3tR=5!u&b`6Fs@diL0`?j zUB$)xgwG_LMhs3%=|e+ZOE*Zz&?T<*Jws&)db~d0VVc@KC1ySW*U8DP4wy4cWmids zs-I35<3(0t^$+YAch|Bn?vS?rpBAVf8JVExnyrzbX?1X)wf0bHfY7TYgt9+I4VLoq zwLX~;&$o=H5$*G+a>Mt6<~%yaPrZ59nr^8xeSQKL6yB^im5br_XX=PHu3dc#;&_K( zU*8&`t%W=ePS>*GU}~Yg{U%Oc_<(ls-X@Qf*wem&u`nXtq>v*lfWtGPMh5DahibL=A8NPN}M8n;*>+G;$uvMugt zGoT#k4s(T=?8k`9K{tX-Gm+8vpC43jV#0RhOQ*X#(T*SA%iG+C73pv~y|j$;u+2B+ zI)5p+3RQh^H|CdiUCYWYrg^k!Mtg8IN}-EOpb4( z2-3h+?CVd3n|h`%84xu)A?* z@}>l;U6$;Ym(1(p$0}jx(-mU+rU4i}$SoWj>}_9@h%gX;6D4@r1w?SeB~}5&Pr9yU z_UP!(PS0)o2q%2m5Ma4=>nk34ET8VLCOP7-T6a=(ZNL`XLjt+itNO%6tokI7|=YDv7Wl|WPvw3f68V`cW|Dqz@#9572u== z2^aJKtz!m+Dgp0JDM2iqr8KD+zQQf6B*i)AQUB3}!WSLl;yIA)NpXPPx|wfO#Q6O) zf!YKmqSAYo|Dep#D4cWh)yvVIq4n8teiw39%FR`OUyYRSL=Yzv1k7S`TILuIq^H&o zstlkr&EACTRvO!eSD7nVqw|YHB6(Y^SHugIyLq!R>Np81Oa=0zSE!}u*fLDT=rQ)A z8HtyVRtx#_$Eh88Gu@9`t-fF%H7jrsCM<8;RxgyhDIvC~^6U~kBxB?- zQ<)hz^_CFxq9O3+>rb7%5Ir$mW4;ba3n)8>^E(SkzN&kqdW*HLV(R^XXEYwFIA;UU zQu4hWX|(9Ots<|hn7Vx{LRL01z|*r#)82XBmW23Nm&7|VebjIQOh<7t|CtL{It}xl zbdFF0dtl@va*rl-TiZzCNS`=IvtqUIJGoG`-V3H0(~xTC>&PZdmBwPp28IzWA9Yy$ zgsR9AZe)!vu#^N+*`6R!F1G#480zTOv8MS&%C;fjtP=#Bk&oFu9G@vE8VWvJNrFjh9Tp zNof&5zN+0?hN|UtV=K{G$I28jx0O7^fAG18NM*M@o)HO1e5p0&Wts@J3EM5 z!oMq5T3X-;&}M)E%LkMFTN`WJgd4qIl~EtLQWEddEqK0Tznn)xNtvfh zkgF%n96Lp)*wb;HNJtpaM9}O98iK{**Hp@FuwiZM7Sx^b+!&8e5n+xaXENOF^K+U0 z;?g@$D=)H7`}|Ph%fT?1=ob+rpsXGlJQipw@fu$Uw8q$K=b{thav%9Im$+@dxpjH= zNYLJYp@S=O=5G7{6UK^|-S;%hA<;s!5$c^5AS&dU1{ghh(M(P(`?iq+(l7|*dw}?N zG`+0JE7ZEwVl5OR!uR;o8)c0UZkHBH=FlXoW%AiuAyW@hCj{Pef{BP_P6vjf?+#Bd z=C2>ct3?bGJFoTmUX{*!SeMbf9+7XV)p>VSv!f^xpQO9L4Oe`zS3mTjdfd?zq0lzw z-s0UyPEYc9-Uuh5t_e9czv+FI043GkU2aeuC)Hc1Z`7yl2W&IK`HM2D@r;IsA5SS`<}G*+&dje4UR@eSS$mY}+luOZ zlVznPt(Cl-K+LJ8AAzs+KB+!woP0gQO4MjEq-Q9+J9F;EH=2bOtT?C#&?7v%xiXx~ z!CqzcY0GFKn?+d%Avi-^D^4VrYgk=1?q#3V;il;LvMU8cpl~${ZZNWtu4VYG; zAcpLSEm;{@2w96Un0)%9&9U3DWrGQj%0E5!nW3WEOi7t2&a*doMrx+#2B4vz6C3+}+P;B#|STtU=El0oJ$G{~H)wlMc1*;lm z*cLVGxOkzxyKevUu%Z>Z+=(7XWCnYVeNnryke_{+)pnsIw%)B^b7?G}aQuKl?rsOD zLO9sZuL9ttW>v|29z7$bz$n#`#w&X^u@Z}Gp{DRGTe`l0MWd!fsKnf;;pk>YFLw5;qeT(HsFgblduZ)SBH$8UsQxjqZ z>_9b$s3~?&W-}gr`3bX9!lP78m;A9Mg$BeUzfV<;^xARdw#DcS?Qh>>MP2Gj6GMJs zCVX>r$KIeRhxzU8YrTGL$VS}K<)*7Bd-5feTX+PdrF5wD>OVpW7LaJM^*_w$+HM{u zL-eVY-!~8GTa2LAt$311{LYI_iy8_dPz6I=T`D1zqIp7!R)E$UzA#psMD268n%{OP zi<2o>ZOTKD?^iyT%F5cy{r@EZb_1!tfO#kE!z6)?E@}JRd+WmGCLwhaz}fmTGuRa& zUNF#};4y(U)Gl@`aw$o^{r&-rDOx>Mk^p6?F75tn7WJ;~K|D|ZlvqLdFJ{df)+31W z2e31q1Oxjq_;kBm!U4;JPZu97f`}`7>PXl}dTyzIORQhZw7xHtf@J>N65#|__t#`3 z09AACXMMoQu0^jH=AQCB0w#|jhi|~I_PogkH%W+b9KEw!5}g?yz;(+z z)-v7)0Su_f^Sr3enk=KrHP-7E@GCr+(frSh&Ts@acJDx+0D!}@N1Ucc=__CLNF|K!}>nVou)HavvXMYUaI(!*b^%2q0*)x5We

VB5K+@99D0yh|GS2WF+8?8eo1iivq` zCLO5mZUmH0X+3f%obeJi+F2(KwD9dm8(}x+k~MF2baxvK6`QN|zhWP#G|Fi}yw@M{_%_?u!Zsd^WO0MCoqlT4|U3sUF{w6}T-Vl*9NA!hm0qg}yl6y>u!rh|P z#o7`R6u1A&*tvkbJA*wKJ5d;aBL|O?)5d&uKXd+-gp0TMv--d4K4`fNe?M#e+;oPV zNLN0ACF1FxKVKD#$3Mt7v@plL8Bn)brps?h zr80pRT`MS|=W3(k;PB3+JG$rNMVf~k0f$0ay)>ac&59J)z362GoqnhS?l~%3arQ?2 zPwENZ=f|u89WSldiy~4WH=mhzed?rc`PQ+&hf15O>L2p+K5rIsnO9o24tuDl^2+7g z1U@;JTbkkAP%9oy%=b4vI-zBp^8mwK41Ql;zhkn?Ei8|7iV;ko(aSv*SJ* z?HJ4JQ@l$!j{rfbliXZK$w=Mf^SMVY_%r=gNj|R!=R3H3iI%ueBfh44F0KrhE`w1e zNMvTWZgqU=QqO(wi8+d?VrjwzgL=3D)5i!7Zz2CzFCSh^SRSj@QncdN=+^Sgv1p}J z8IBWos?*%BPz6zOF2IbXmO!-8@PQuu_nq+%rKxK|)ff-K`}$mC0U=^3tIqsZUvDjH zYasg#Hm(>b^sEsiERPneO;r_oj(7*ZS_Fs1YXA ziPXArc&81k%^}|k2;#n7N4YFgxmjwVAy@qpzqUUPL5lpEy$XOjb5P0qzdGUP&i=G^FNJ8L+gaiPHD@Xb03evQv&j)2n*)-ZVQ>ua3j1C50 z(A`}O3!IWnov;JY-1~`8Y9R_Px0mKVJo5ER1~A-qx~RX9kgL`Hf^Z?E+T4=iqS+^B zU#eaCblW4oif=-~r7ulukWi-F6*LgPYqE@RIF9YF<1 zQki`%6s^@Uw%eSLgMZ_hZQ&0dxSlGw1|S9&one>EXD1%lY+Ij}31D~1Uvk+!kx&na zE%R1+&SooQOtX;b&YefWdIFle=ld)>-;@p)KMpDtj=K0#5Ww%~VpI9)E+^JNl1dTG zPeJPdj+QPRY^)f9`Hkq+DeuQ2>+#rSwqSB0U7o0J^<+BS)hyV!uTz6wEVq3z@u{G? z{+P;!B?o@fHigCEzw>%Y7&aqQ+-3zb(G5{EUxqkcxRvFBO|yF1=lq0El;861tzHg~ ziMkECQ5jk%2sG%+-~IHgXrH}0HIw5Qwjh)6#-$$k!htP-&%&bYR7PCajF;y z(sZWFI@Q64lweG52AbB~NLwtdR-KB^-Hwh{C&_+lvum9F;bdurc{4L#v2D%Izf zBe>1*_$>QBSB1WXbo41Q*LR3T#DJD-Dma0oPBl4to1~q*BeYN*3Fu2qF9I? zBg&IP`VS_eM1w0XL{-zuzm&|Q)!J7ejC(?V64r{Wy9N>GO|tr#kNt8C5T`RRAcy9? z3KCYM(cL9xO_~P4)eD{WRtHQW#4v%Cw2m6E({}jFcX4`wfMN)WtXh;kid*)fzs!HZ^u(_C)yDtlBtFtiHwRu}6 z0N%&=MvG~gXBN)^a60j#f%m}>1J$VOBann*`6+oCWvefZjYX+RNIV0+P5ScOw^a0H zoe+!(xq{6D7#WY*BgAFS#e~rD$csx~)W@lKKMeK6_aFkK#B-*WFBjY@PqgIvuejIquY1S@j%V(k!r{1bvIrd7&asjW=HOYEN@>A0 zA0uLT$p87I4SUA~&{ZPX!wYwn8;${TLHjX_)2$HmTMFcU+IT0>r#1&3N(5?<+rmM0=D6OX z5DD2tpZ~IE;pR_lF3?_4hPcxf(<}23r+af=1?hkUWW@?Q6MuH zCFI`rqz4p_oWFS1fB>B{M8WAwff5N8ex*3qLDjbLJ{r8&HMOL=V>48v*|3s~M8WDX z4+zcF3f|(@!U>{p;MB1>Y>yfyhjWI~FrUXFIDf*HI?l)bM-C77`{uw~JmoyB+r2=CVeJC&8c2c7JF5 zDs`bk%Xp-1jI=wU>P~%oV214&isxVYZT+-5tqht`;@)XQ_TQ5ZXSU`tlZ{gIJDpwQ zVGvD;GtT00&`g}LyBc^oVKlp=)#=(@H{pp??IqQP@|K3k77K>N&t#zX)5Ff&<-|8J3jlCcx?Budw17LqoKlYIM( z9=x#knk%5^qbCHQED`C4jFUde?Vmm#ud|3j!-xB@M7z#yNK}=fQ4tq&Ki~Kl_v!fd zvw(r?l*q_F1Vk)G6yvXQl3J($lxspGiC0i5%3Y{J=EFV9|EU3QAvC@rj`K>Bd?8>A zpC#%$KFOzWT!EIIDmeDo0zv7=+yA+sgB>Wby3+BwyL#a7iiHknhzG!Az>(8eQaBH^ z#4~B|nCn^7CWZf08OL{%cn*nZ^t*HasWv%T4Ct+31r(`J<1KxtUJhc_{`Gu+UTW~~ zB@hIiQ)1THEH54xHuzltPd9q$__yDKyEuyfZVdi=nL6kO<>(PonEYG^saAsE@p-Ax z2UlxWxXG;QTKU-qw$GJh@MvrY&y^zyrL+z|R13@T~sa4{VKH+z-~ zmCMOR!vCi&{f~9~dv8xH*cD*d-o_o<2U<|P#Emew0+&mv+hEE^1?!A2VDx9E}EKCSZstTsx>T^s+eLgBqN;*Oa z+@(3?7JJ|p zi^lNFSHL)IimbQ)6qZ55hO=GNa_bJYPu&+XN)L?5XmKuBOeOo1b{h(PLr;={ z4u2x{pb%nanYCm8c$=?*h*>A4u>UrA8DnTPPMHDuxsxd;zg_>cP6K6j44uxxd^gFm z#3WmnhyF8(?-$vI_~yTtPPVg;x(om`^Ru3{2OR3jv~~BS_tvve=y(+2!m5CLG(dHg zjzRw-q~r8=p2{MK{hida-m{wCTaCHSbFbn2*~>{Ixnt74Iy=M2qygs^=YO|3;0D9# zW+vbU5;fokUxI>z{zZcI@Gcn*9H{1}EUTVBmsUKz4VBA$W`i^``xxK!ua81geHBfC z|7upC)i=;(f|lhoX#T5HGgxuqpU0#yy`j+Gz>c3~tUc1y^w9-c2YWw3J+a<*RYp~e zgfo#!+74&0serH3eedTxwwGJb;TbPAGl!nt3wn0xVC#Q*_WzulvnGIm&c-h{aE}%a zbdbrc$=*1a+#{LjC_R?6-;JB*C7) z4phc~M*t2l=%L-=iHVGX4(1xDvLT`2EBKeHjsI3>1cJ$^$iZ7G=lur3P6s6rm7Y9* z;0N&UcO6xZryhBLdl=S#Rydx=`WwLQB?F#=key!*D+K*cd78qltB}5=6Eiq5=?Jj) zs|I@J$7>Jj(RI8ADw?Hnx#e?iWxq??5BnwSA))Fao86?yAzwv1ZzSt0Gt4>fD!a&# zu%;rAam?Ze?{fThphw5_xw$Rbptax6SLTy zHOBPlp(?&CA0u&iI76c7#3jO{{CB*HeQ39`rjs$3e_bBB(J0W>WCAiKc;TFn?xnX! zp{0q$6*?Zf*-U_H3i$ku3Ia%fI;h+LHGe>5&Vs7l^?kl4=b#Tf;C~5%N{AXs+WfSF zFringz!9@t{;*M+#>rstRO)=mAI7-NgEZGnUm!*mNlTlxg|(WQ-u;VvTU!4&_txk) z?k#4((iBvN-H`+Ip7klKvvlC0r+iMV1SpOH#_*XO)Uf&4dFX8>znIQ-k$k0{HPisIWL%G0 zK)mq%EBdZ%UpWU_76Fp2I>J&kHz`-E!0IURKzE~w&a5?73g0J@lStA@3M6en&JqQ< ziVLDWBAf3*XhaKO?I?6-VH~-L$sG`DPqrXIeJ0d%<*W(tLYi%%k;UNY@xckKJQZ== zBcBi&x6&BY(v!ew9MWM!Z}~PYARc8wIl}b~S^nva#bd{s$OZ7F|A-d!lOzZus=avt z;Q$P7ezMFlb4!cENCjnr3Kv$kgGdfc!Et$9P0e#idohiO%v{OJIE67eWp&kF)h`>^ zB?R5LUbRU+lh1AhF)gTS&8fltmEGQ+piwluoX`pQR}a}KtOn0FrIZNUb=>vlH;-@j z6;O)E(JFp!3{bI$2LT&e0V~V&3qppgJXz(2b34zmyGz+fzLKLjU62dN@ZyqcC*{y` z_(?!~TV)XM{j?WvrbhQwAy%#Ic;aF`z)1^ZQe^4h0(8w%?{zqVhk(_b%~}m(tcYFM z<%6}%{rv;=ESY;QizA9=tdYUohwmtEdK@ipm0EPsvC3!_THGY?nssrpLrbM6vJg+Z zb%F*h?N;M&-GxBD83I%?b3_<C+~q-406;6I2ulCkPvs6$*EI@bSd(|JPGd2HOSq#DdxYe0+ShbY>P-twjCU zs!2TvF@z|z!7%H&7Z+Ehbq;AVx=|F~<2{~J(z);#!)Q-H^%|B()%O&4x(^h5iSDk6Qelc0qf|r2|kBmE_=n{eI_18VLDNp2X z`-k@#TlGn_X`8RC`&N6FcRM;{)Nbi|`cBNwS1uvZ!d~Okzlts@#m`Lbq>gMD3U3i5PyFd8+6_A>Tbp z&^pV@{#Dm4w^wX7W!SC!*p1OAwFkQ+9?ov!e3hlItCO3Ssj$6ap&N%$tE{ex`i)9< z_Raxl-)cj7G@B-4FC|djb&x=D(!=W1uCszet33kYs?#;a~YhQ)t*W00;?-8F7I(NNro0Q z_jwy|;z_FmJJkJv5-*-^{-W%br`IxnOF`IOyZ$MPFB`uvJSVuup1lBAkk5Oj(n4j+ zgJ_L;yb}L)l7&Nb!p2;nH0noW+-OUj@2(U^PouDm9c5}vxHS}&Td%$@#6IBkh;XcL zGm^;88yJc06onX``5Y^)`S&dzkjz%nWTy4$fQa;QaZYK$MYyo)XPp?{XE(@?T{e zXj5d>|JillEjVY)t)p~rb6LyZi8V{JRu?Q?n&St3DZV(h*W8TP9`R;9ees5bGiR+o zalMZwIjhURM@M~!Or#m|wFX}mQyyy&d!V-0o5k+ngHH{tKAG-BUyIKyWHetW>a9VAARuQUgm~Yu% z`x?ua+orG0H0*05!UK4t-8Q&HuTKN-k*n}E+wlQw@Ps6#oVf!E1p=Ysb&CZa_*vW~ znNBT+G0H}+ey1$UBZOPCO5A+5oY8N-g2W}Th-{aczkuQuIqhdk zPct_pOU$CtlP@qjlk*%XJlUUB4QsK4Sl_Q2ocOlFWve}h-sko2wCjHC)3KPdX}8zY z*lMe)noPmxbw{U7F4rIYinB7%)JyOb{U|Iv?%v^+oOGTgHa)E`#=mQGc`Wl_Z;REw zt_HBo9e@x4#g`>D7U@yA^}=eTPVu>mXwT;9+M{vR{K4()C5s*xBSe2NA2|)^fYn7M z>|z#^t6uH1Yz(UN@zr=MFs2^!oumo3mp_B$aJzp+MjR~CJWN*kwI^-|7*mdpZx9s7jlpAZgx)$ZfXHSyG3Kn!?bsiLy{OI zWn7Wmu-2uJ%y==&s&ONvq@dIEB}0=I2XsYAMi&RX3_m#G=^O8EMIpDJ9~U$WGW9E+ zs;2JdGZG6SyIU@M%5}eWW4f1KC|bRhWzs5V)m!CH?VhLQP&4~57?aiVknuulI=?eX zRo7=wS+SPl-zB8hKU<%3iHy6V-F0<%Duk*wug{Eps|~q=1Ve|jp3bwnSbmY`^BHz( zw1d@&sCid!%7dq$-%C>8YV*kPRTC{Aml!FxuRn*qkrk&qp7tv$if}y%@5mVpIT82# zqEHJ>vfuOkeCZf5@q&gN1jIFmgHL{Uz-r;sa~OC^eT+%ds^yO1?V5@_(z1~^6&U@4 zOm`(0EdAlgP}+UiX20wdQ)@`y(r{+3Zh19*W9l937s~>2UBBnJ>N~M=4#;{9@LIsXcm$Yy_sR}&FwXVa_gyE>lwTDd+ec#(f$ zTJVF*y-NJ&B&SE3+3nO(!>E#PBiLAhMJk=F?)y*trudd$-4i{(7;zEtwIE*uQMS1> zoG;t0h~A>8!{n|i^j9)=1*616ZX1#&Bd>pOJcH8$shp-0hh5?Z_A7WfTEB zEpP~6r~Nj-G_FXW$c?|eY%t!5jPQ5>kwg}7xDx|zkQA=7N6PN5+S=Q&q0!EzX{kj; zl$s~&{GS--9h5`qQ~OYNB`^=@yRRNRx;9|hgO(4>PA1Z+0DOUj(d`w~f?ot0=a@>- zRMPigl0&vTU0RxYDK$9lHFZ3x+KIRFA0!|UYFTy5{!|nFyK_K$ST;;)p1lT~lBxG6 zF(&OLaNkeQNK1pC*Z-o8$r)rXIPHF$H0ab>m`8$K97Ep_!$IV`MW> z(+f!m5pf}^Mzd8S*F!X!=X^x1JVLdey{@)DcDV$zN zq}bh?rD&HS;j@z=yl@sA-8Ht89k~Jt%wvgkd9aKPE#No2YTOk>Z~K9E>sMgBO^ieD zQ~uE_ToU-mr%oRM1-rgF&gHZUByD{>@ecj5{kZ`U0g^LuU#~&N$Qf#g6B6w_jq8W_ z{6+y6Qby-_Ju;Ivgjz|MwC|T*G-WQ!?Ux@TGjVEmDwK z3?NwafXH-&7B;FW$<#W?bdok1UfaZBzn1a#8-VoBiVO}Q-J}`sY14IQRPO|%|EtOgz4vY&E5p7D?CE?i&A}qDUYcTKr-q4 zXv)0vIeiZu8k<}mVnSYCPe#hz;(5pm-d9R3sp$ABCg7cQI_%i-p>(h+NI9@+*o^*A z^z#YZ^>DI!oTNb`d*+iE-kCqolA&?KlIMbXcbK(RLXh6<+WwOmTAT}Kac8`_95Lf( zJasqh?%3HeXoFkbkKsxI4LaCjci$dEdsmRqYr?H{Za}Ze0#+c~WQxfiPa$GpG)@hF zFE2x;if<|P&VN+c$<{sNJWCyiaqJ_j?6%UblsxksRyWASM7D}UV;^0+7&=zpwV(o1 z$d%Cn$}OCCN)iHnOMZ|YPkN)x0Pp-|W3%`!kQdr7ILsFl3|Qx>W#P^=1g8=BdEw46 z7-q7Jo&0ysQqj8^dcU9V(=>S6KiSrA>yRfJRhT5+cMoFGn~4|G$5nes3&-80+SjXJ z-B+2||J7RXLi(~KuY-9Gc)_h96EjF&{~n6`he8YiImE&kDmAy)Y2u6t%TtWp*zK#^ z_f&hgb?lx;_;AkG+%*txKOXV&U*&i=leg}gHSnW?!a)@IAbp-9x*t%#=MM8Rs;hM~K5TSIo z$+oduMx~*{49{OaO>;q8;ukMX2M?v%DAW8~2WN$o4qkuD_g}kG1Rx-`&CPIPMsVDk ziT+iC?u$FaQ`79ia2_KY-uQ$&OQ%dzt$KfcJ+79v)!kPuuJ^rlSD(Q$DYRUOI-|}= zHPTJn;+l0yDJ-bJ6lwFv9vmO^>tH?QZ{CR7gP`!$vbPtH0q1Qe_)JqAeG|59wXO)hEjIE;JaH`nb2F-y^?wQ+z};`Ib>SbGdbplrkCxesUBc?D67YwewefY9 z501Zah2`Db9x~$#+fpA9pk-2wjZinTJk4)@lzHr5R~k4>$QxtYk;IU&Hl65`fA>T` z<0vw82C7BIG1O9LTEm9^?bUBX7UupPj;#bB0TZ@le+^;+{pNYZm##TM7K08t9#7G4 zufzRt!hE8x+pl(n$Q75`<5%DLQyo~_obSBx^-#YqR^)>eZ8I)+ ze3(o3?U-UtaS!7bqV(0iQ5jBwal?;N!%=G~AP!;M^=!Cwyx%6kJ=D2m$0858X??(h zWFv4JU6AtQWHgxj^4i}~DM`MH;qAdm66?Pb{)`Z}E-uj!HvE>D0Blh2BUpzskwwo( zKkt$F8G64VBy7DtUu>8&BlbUD3sAZwkOuw^pv%~Yato9&oF)dBP$VBx|Mz3=M|44Z zl1=(ho}4864mTl4$W40tb+XcoV!M-a>B&W=jNW=4RT{stgnVOu@s*GhFI0l%6|-|B z9&z~qd#FBOVBcI+>l*A5k6=KCO!RJIHx@k5-}mAzY@oK zwyYnYzVP`&Lst^aa(OBdC!>!AYCI*od(e_ZMsY3=)}6?rTVnCN zD1d+>gMflR&0Wmd;VIY+W`XZ-1|iplV(%*pjP?fwtu*M@WlTI1EiS3m_4|e2!tqapZtRz*c|2K{=*u&q?|@0Be4KoC^dA z8d;C-p>j0(hhRzhAo8Bun()PZ^2f)vGAA+I$dn2qVNuU|R}AZ>zLez7&OtPW()amf4qAOT9G4lzEx$$MYVSt3vXxDKWbcttH7dv=XvN^U%>eP@L~2!Z~2XZhlty zB=EW}%qHOff-9=8t zL=hc;OK2g@JDnSGNh?liP1Jdpnzcus6=ep(&#X*MYR;-v5Wj?}hA;QEMX(wK+8!Mq zT-;?+5^^2p*VHEf%e(TV&#|TV^vq z6UJw)iAlm*=R17+w9ua!x`zeHhX{5(em<*#uNuDX;kQ5N#o=OcI>pK#8O`^lk5$1} z$Mfy$cA5>=XOn!-A>>!8fO(xfJ*#>=jU2nlvPY7FeouD0;Zm zdMuXh8TMxr;Uc&*yv4?Dw1TTqSD8czv_ntw*j&o4abK^x5;tbQH8@N1z4%=e?r`38 zcal-4$geKD^!CGDVS$eFLpx+nPY0&{MPX_5*!^P zjU08ysdLSQ1PKW)XdREamVv2_GJ8akd(e0*!a{ z-t^aPaO@*-*f^j-{yPYrbtr9~?sKdu$xfL%@8mPq-bl4J)%km^{xSiU(09&>*h$g0 zLHecU^d%ZK@Pmn!@RU6liIDX~U2QHNe6HuF3;1*6tZ+wTE*aEZ#7H^c^6IY#w9 z!_}?`{9+vxFMdkx&rkTf8~w^-cQo^thOH4UHxZ}LoSRGXJ?ynDADh83&?M;iWbJ2u zy0r1d`RWN>i%yp4+WlYc1#)_uOG5^@yn6C;Yq9*A-{oNNVBAKWp+R_&^__Wg?iA9t=z zaihng&N=a2Dy;Dm12_jW=wN11?j#@e}~SkvbhY?Yoi^i0?A`xEHb)LRU?&u;xlN-lJ8zd)@cK? zN77#1K1>H16SMVwe;ZYRlbpDZ? zF4BJI(C@ZQgdeW=O4GQ|bVqYNz$an5VAxmXVhs*VYkn*G|9ZVN2_D%aZ@rceY6_ca zx^lbaX*_@Ag--b~Kq_RhXdB){D0CFd)F^A#878&ov;9@?!`n|bb-VD?HdKX<={Xmz z0QBa(`8R`(kM{TUU{37;ix;5VfmXxhWj!_BV7hu&xvpt@u zPHz|Q|ENN=(YkVDw90)UBJ{s&}sHtm)A~w;{V>Ss$Q7e9HAWn(7uI6Y|_C zt*pv7r6J}}mk`g7pHhl1Hecs->n&Xouh$V$Gn2b6PYMW~vOL#>z}0qdn0!!0Er#i96=UX?;=v;T6V{@8Oh~=4=HP9;!)B7afKRZ`o zcgE%CJ>l>1=_W%g>_9!FzXm&kgDvGD?M1W^m9T%vuEN1g2~vB1re(JQxeIh{9RSFPy2 zKI8JOj8J^P$D1F%q)qx1c`63CfNjpaMN{_+ueCvyb8n)k=P2R>MHe1Hg3g_#MMS-r zxqM!q_T*rfL^^Ta@z@E?IYN1}7~ld!(0hL^EfyjuOmbF!G>6wFmv15uW1m!?8!uQ~ zO@lbF`>=b-Q*+g~M(${7EOY%03EH51G%Li`?y}~g(9<7*UAY5~s^LfZh{&28BwpgT z6;ZG4z=biitmbLk{$J(lSrUh)%_2H;9lJMv4Fq|tp#*mw*X`Rr2xsE^ilUJ(x^C;= zy60=;RjX7RAhO7kzr3?YL(HiuNjQp9wT+#4H(8}OES{oaUDq4ms+^;?`c1dWtMuuU z?u>J#2sBYBTxCUHa1`q&2P-Y8yAS&zu7MB{{pxL4+bU|e93-ais4!syq8`omh`iR@Sn;B`#;Z7xQN53GD^F}QU{E#qyD+JW4dt0$3$t=AS;i?!XJ zb%2N1X7~)-w#26Oy6yN+UF@QVvLwr()Lu95Uzj%Vlc}#3_QWWrTcL8ShKkL?kRYOY zZ|IFhnfjO~X9FK$5%{6~hX;FOS7YIlv!j(x1}GkUq>j`b{E(sd5#k3MAF9!ZL$#je zxglj{?Iaj`+IX`qgh4eL7pa-A3thL;A(E=svc;|dcv)Z!*OVjYu}1*H=X8gcU0p(p zY@!=I4+_4=QBhR^&sayh`;ai$|7Sn~jm=L(@NpeN5ngcA8tt5U#dHSId{cngTdJI;(Wf z>`rwr57$^Fa+~jORmfOV_zvb>)8g+NE9Xa7B#Vy0NK~s+>{zvGm;9=AvnI)Qu;YEx z`Rdp<~)_!VMt2-;NLYYHfZ$0 zye@xb*)Gbzp8u!}GGP=ioKJSxDARpz>jt z@5R)_cs63(@MrQH5<#`Gk#f~9@*D%gLE>m{Fn)vf9qEOHV6p*&vGZ^HR*gC^n+es< zc3&tC^T*NlPe5*(hqF_?nmRPsag3Z}uI#Acbg0c`gq5?u%{K11I47PZlMTF4EE0!e)yU6+KSRPr z-!)O7fL1bh8LsvtAQm&_gJ4ao%hUDR0Si9{t)g;)$u!y!C6!9isb*Fb3!2Mffk2UX zu}b7xfxdGhp){(aZ{%Mc5!R;x6+wxU7D#O2el&i=@5$Y}3NJ%PwJZ z%3@61vQR8cL?$4hq|~MNTPi8_P+O%Bnq@7~;c**(!SH77?ce?d4(BEw=Zwg9e`MoGcl@xRN|-66^Qc@?%hCdE&W~4R)uCNn%t_>ReS9 za%43fqQf1>&zLL>+_5{E03#Xpb#nqY=wSzPFs;qun&(JU9v5s)BL|_*=4^0E!}$se zhl@@jvCaEripnIJayqv@Wvp|AE{+KTbbZ~MJt=h66YZ^#&Bg_gGLQAQ^x*!ED_T{C^qF0LO-BhRJ zUbfD*q}}{{*y3FSl7S)jLGL*YmAI>qTvL*eiPLqT3lyrt%?mC0OqIySNR2?w27mzT zAqKE2*SYyLX4x7&>*Y+yMZe!gngi=Wqiv{cwX+}OdF&)hD`GHv2h`I?*TEANqhOz&Oh>8SC+#l zT~?QgldLuf9c7jj>8e(ii*sES0K1!`Qv>B$c0&Mi?y{#Dz)-vYA=c;)l%;F7<%SMg zWf+4T%wpJ0hI|S#?HrQ~i<8{RVj-?K)&*fR2aC^)te5Ek1-l;31o!*HzA{<2rf9IW z;FBKFa;PQVzjLQC3%!dtbYd0zji!CzM3;4olN@NipjAkeRGxHO4od2=&c*iXRiRY7 z$Zh+>EbgbA^QpPHoP3!d^=^GXD!#00V;D1TQ~q2MtwHZ1$yjwuh!l;?nQ>S&{65oP z&v6bV?Pj`cfy?l@T$lUJr*FI~7~ zonyUVh_tU^4PKcVJ!vTqwRA`lErO+_-MJTfL6t!^w^Wn!O z)GyZ-I&Jb}YzdU$2)5J$M1;%2gvGwjT+{Pdb2@@o1Co7`(`Y>-2SsvWD)f18!J(%7 zj|`rG>P=+(^J5U7ru;y#NXvxo%|0KAoigO??)$z}PtYE3$cq6ntG<=(bjf!d`RKOd zdq1ztPl9r}Fqn7lW&5dDBL0mO_xjkwjwM^t_B$A@-b2DtWTKadIp=L!;;h_mxlEr@ zzD4jRWcm9xbUZOIOPqMT!uRF5n4!z`J{HIQca8`XJJ)0&{a(a#A5RtbdM(fur$zlt3hp2EIzSfkVyDhn$N zyK_PuZ49F^)Y)?B1<&@MQhH4o8~F;CHE8u@L`14{@Flo-0oBZHuK~b%!3fT_ki*jF z@NV^eYx-5GqMYr1OjanDh1#7Oinu(IamS5;XX3v7oj^}oM`53dbVtDnN5qF%MDBtf zYEP7H))?Qm?V!`HrOAAyoNtjV9TaZ z`7%{l{cA%9bA(H*?CfO2D`}GQoNdaXnpt3r5GP=#tG!2SLWSO3FX65YIwz(%J)7sL z+vW}S^;4<>Rxam?1)i=2(%Tt4srzcthJ=p&e)XjEuE>GVA-2d1E9o0p01Sxts<`hs zPQe4kJcn`vVNeo|1qwQ!<>d6H#&r9VUN@^Y!tSg7P?b46LHOir`^;c(J`|+-wbG$0 z4=IfO-mnh-uGc{XWtZ4&xj3wS#@Ri##a$2Y9$#6$R3w-bp_)UCy~Z1kn8mW5!&g$= zndHz&^*UYOcx+*9iBr{c$p#3!zJ zA+?n=DC*vDm{m=aopKu{__CGh)D1!doc*fOSW;zvti>rLO|C>&fmw<0%*l5-94AJr zsp#^2xKcYLrM>At2Y71k(?m;qXm%AAapt9GiG_gP!(oX+noW;TQ5+T{HAw`T;wE9p4_l=n)@e9(4=XDdUY(9>w;PY47GF`P^*zxYUF2w;rOdIG0~zVcz4pvkM#kL} zak^!N!_qTKU9|fix2ZNvjs~DcUhnG6A2Z141|gRpq)dKDrlI1Edk+U+%Yn01bQuG$ zw*%Y4JuGlL#7-?pGZ9Zk)5DJjLXRwohxECNQ$XHTXN+3-*K&7 z82f!;F66;n68^e~rDa_V^I_vzU;^YZ3hua{HB0E-y)%}AE){q+*j^hHrm1DNSPe1t za@i66UE0yM(a14jWx}yAfadyIF63_lH%S>R?iR@9S&koS35A{3|0Ip|O z=zqhr9OsL~)`<-F>73=_(o%xe&kNMFX0*wBg$Zf^|0S~0#z=pdB|ixMPn9O`N4DBn!9MXMvw(u`;2@Xzm*TQ$=8-IC2lc?Zq}mEgVAnx`FG!921poL;bAm&Q zUVCZ(+gXTaGk+Rmw5qjI(;MpVt83;yEmJ+amN>Dn#uH>~JR~gBC!3jsI(=i2F~13I z{rk!QZ?He$0Xip7q`;CjgTrw45}q}(aZieV!=#OC#>Nf1AMSI~$wYVs+$pw-)*AJ@n<);37*$Kj$mMK7}WqxczpQ-Pd+ z!3#7WRy~U6aeiL9KjJ`_TmM5b=V_RqNXgZ9Ni_d4>=^&}sLY~c&s?=H)0@;}^NgL= zCH3wVl3jD+D@kP0({@pp;pKcu3b%Z$4Y82_^U;+$X}X8waB|ArEA&idArs^$3FG=l z4ed1$z=zDeT^qtYw6+`chFai2VKyRD4@O<&-_t-ChTrY}G|>_a4!GVWIN|B1f)6)sbnT@~a*~ z_q1R2-^}TKfYOmFy&A1h>01ma)kRj<;@8id{8QacC4sFwjkI@Kvi}<(_O|H=pF%0j%MiTuaY*^wEh;yzFp5yvmg!{fnSKc4Oy5o!w@C+sxik3a@~QQQ zMu9ij({KE2OYLIXp-{Mp(jryO5Y~*(ef9~8 zxE+Mtcniy&e`!C6h>cY7ONrmL>Cbi82nFgm9J`?~=?9RY!?kxQDE+5ce22usbuQd* z2|yBq*5+Q(Y?8qP#mD1v11caYSU}X=|G`DmUn03RA7HlGrY7J>JGwL;Hs!eFcqdzL zaCjS~H;rJHTL?d=AwK?Q*GeAamp5k)J?7rZB}*7XIf#@MT|U4W301&>Sj4NPzaogx z^iS?ic4Fysf>m25`^}9%?S(3Kw_)B;jW0X+=eUZXt|WHZHH(c_jGAu;4w6I+R9mq= zUktrax}(b*rwKmk{{{9xg`pU>f1)q0B$u-(XLi8ul-Ru8)g9>bcShKY zBgB<957>;61FddqBuZo`P(4FoAz9y|3z}-kmkCn6!o&pOKY>9d+GO1&6g4 zcH7G`yk|kqh5E8A{fORWd--4@BcIfE;F*qDXkXkA`iJ6RDi(Ai0+}FRl?A-ywJ+*t zNzC8x0jur=SW<-<)HP5bcb%J?J_BTbl|x{#@eg~~7tufdu?OP`iqCocX>+btLFi)0 z$K`=PBxx~#l54WT7Jm(I^UvQ)bk^Bistm|+&epgI^()w20A?cnFz@f0bz_jwXZ_IF z!aMh$-<-&K5XlV^CqGB7!@MAfDT_hnU+(y($P@yYYt4zJQua-9HcTTVUj)_!|cv#zPSSLy^F}8``Fy8j!Qv&WwVpd9Okf9TRixA7@qmYnhx(MdE9)Vzmx`yamj0+=i0m&ewzv|I0nu9$%)s+`^e zX})>@Xka-%02O<0V5%K0Eog-cM&5Zg7rQJSt~2}i>P%;r!5ii_^Fo;g8;!YcD<96H znR_;)jn_bcTnOa=_JG-=7a=vgwfU}J^~V6pZp(gvZE5A_kUe*Eov2@>Xju}DPwOt~ zeq>l01~4RMjY^jI(66a7KjByu#JQ2r(WKMjPwOlPtC`^Qdev_M##NR-+~_~Kv{`;+ zvq1`jDj?t;Q#~FK@K6A}+QCZefrHX>DfB>hbU}}e?y)X+K)xyx|YkVAJvfy{i_)-^l0Z*OI%&Jtx<@o%9qCm zC{VPiN%vx3Ttw9*ynjYru(lWEgxklWp3z&DU4r9RzE_>*3`O1N0w`vXpcb(mH*aD= zX2#^(PK>!0>3=@kl5qF^ig1J3y(rw_6vEI&<92Sk7@T%{jLe%ygkpd`vKbDu%kQH; z$}JHhV5U^;ywHq8-x;h8Q3hbUHUPOn06^eeo_i1bTeM$ma>r$pV%l(#rE#2weOi_DXj9l9MB= z*&qn%2tI!p(3c2S?Dwsx*uPgS9x#qh)Ba1KEE##7hcVDU@5+;%GP*G$fB9m0$|0dc|*r1 zI&jiG`8IGRn}XqRC+pGJfH4S5S0-Te3mw*@zBEgWFLIj8FAYYp;uwOxW=G>A@{J09 z0+RByLf*J{vWKFkb7#3!(j|CNHM<=Fjz3uK-MNOzVuU>rq2``qF;EF} zYtAxI0BBXhO0Rdj^U_4FkLT=1Mjt$tR_nOOE$kD2e8)lmJ7Nnl@Bj{VynIvq9cs-( zyG=}b@>^gH$;fn*=7hVXHd=EWBfFH81ttWXWNGv1!G}$2-02vZBSn+*pZD*YJ|2OP4t!$pD17i!BnSeyB?|uwK#yCdJyl$2l3Sfku>ivbYSrh-Np&*hKAu?~~n(}0BWU!#`#{O+0tpQRDmw2alu zDHhpcgI%Rp9qnPW@@#Ve&S6^^x@SYFO1y+H`k%e@AS|E+E95R7^6t9F@hZ3h`R4pB z#R6Ls0n{9+C);YcZou1&%XI=a<*2wCKc0ai>GGi2Yd>|DBS4o*q{>&zvmNE6$UE3 zdU}*-0QPty^=v+@9_W`h?=(SA3=cLE7dRVc&S%@ENAPd2T7mVIpf#$mTmztR_Y~}T zQn&x4V5Ijck?^TbiIH(I&B7$lfk!ZSlH1y9Y6Jwny6X?XL`CFIqhN72S6?fDmS#e0 zcpc}v7ba}eO)$mE+O}!fB}%$eQSEy=`00)G`=|S?20D16`rOu5cy!cS_^{j190xd; z06%6w9KJ)DCaO6yo`g-k2Qt!+<^ULK^l^NJ~>JrWMBI6#=Z7XE_jlL zk0@Eim!{+m?uRE=vC2eeb`!vu9nWq+0#@j`p>wNIWLP=?$DT)z$!JQAu(w!SI50-x z@ZGkwo9&oBqyk;u-lL|p9^ASPEEB_KJTnJ{!JaUXv@L!8wkkx5!8*rsP}b|TxY#Gc z_`Ix0W@E8Qk^T1v0I11fuK_T!h)i9X6)={uwzP<)%UO*b;0%E*>(Rz@OScS0#%p-% z_j>c#Pic$J_dh0GxD%3F+ZT+uiW?9fpFWI0!f##xrKTQZC_EEXK}xwyAbK6f3#<(-*D z7p!DaqxrVeb4;MmxydU6Xd}y3J(sz$7P;Y2D{rSWhEaS@4o1=*J6lcLD3j7U+^9z=(oFHA_&~dER`^?hCNxMiz!6s5w6;JyFY^Dp_5WgK)TaM{0^M+syUY zVF9|mOuPN*z7vmJ)C38ut|5&mt#i1N0<{uQk!O1*1z2adAj9xAqqI7Aby9>HjtWhC zF*7m{fNwnRz@1^ih&|$(eA5H9Y?rK2I-riD$3204UU#DDj<`)(iiA;TRw6vCqkDYi znFjg`FI-`EqD#QuI`NbVWED-cXS{dE8W-m<+m0vlIZ5B2WKH(t($WN!MJ#2feDape z*7g%>cZ&nctlbEkX=;U&2tefFM1==l@^%*j6`tx2r^~n4F`XUx4p>8uP$7YhH_+R# zie%*OI&VZaUl%w!qj$VlFVuzH!Fd&Zrn1!P{ue%{I^%sPqk4@}Leht>lRKgWc=2<+ zPCa-s=X+8{QO1IbKG&t1)_2$7K#pr`s}{4+@F33mJ3yPMmf+Xk2Ax z+L2jd^SZGiXx6|eJD`;8+g+Sz%#|~7qSn^=1s_)lgV)S7!TvWn276=j9&2Ljg#K_{ zSWhN^CC2~@85VH#c60|J9RIUQbI2$L+u3;?iG=A*nh=SoAs!=W#V4 zBaQ0AMM3RG5cq%8HQXQI&TrzX4V3t5gI#z?KL}iQlbp#v3J`c4Lny4&*i{KLQ8d?U z)u!s6dBUvlb5ZmNRIrf@Y7;WiRqDbvW8ZoORB+WgCB_)`ZZr$yFcv7 zG1bz#N=INeJ=XFs0N7haU>+;?)Uf(>)Yq1WV|>I{+ZT|yBztnGN<$6nd`C9fh&QW0 zgwHAML0PVO@-Imsm%#AU8`gC(gQ&$w9=k#$?H)Q0a~tmcKVG^OY~P$Xes4gPR#4%qg|xR`u4PLTu>T2 zM$?(>tJ3eONp{c&nu8s!6^uhkOWTgOe_nCy##^MaI_TqUklU(*-K)km9+Ef(M+(-F-v_%Bl7qwDJ0;l)cZE`5B$t9x%6gqt zPSdK0XyVe5k*uMJ7rAyPX&G<~L3~a=4~)`Lh*6Gjs9JC4Y@MqqFiG?m6-dd0j3`N` zf_lpe_Xg#SFVRq9%k5byY}>YDN-|fkC`vH=>|YfFW4ERqLZRt;B{;{=V!hS$ zrpkRN0X$dW4A^Q_Qf1BT4$C&}QT1a*$STG1!q-%;ks44}l1{rV^UUAvKMu0D0u2;p z7nX`(aqR6!^grzj)3B=L%OCVtJM?l5cqoSB?HOhDl2YjC>t2@9a;mtoQ3!Zlk`paO z$E7*$su3j#n{yYyzSG;D*gz%~OpeXAY1y52rzf_jf}SBa^+tv<+X7u!IOJh9q--&Y zTFJ)-qMA+R56IU9ta8T2Gzx4Hpx8wZlL~x-tB23ul-Gw94y^3SEua>l8#pO%M39q?r`r+wnXaVigMAVo!`Sf z0md-zKtwi(!Jj1l_#r|giLP>TT-eNhN%Z4^Gh;8f&UHyB4s!V_$Yvp9Dw@Q?1GHYn zx!BBXg^r-B54jQnoEqLc%LQz+zV15he1I}zn?Ecg8HyfoN*qbBCRekijjYV|*@?qb ze)tKVqfG^xLKpW65vgI*f&g$?zoiuSOvxRxUjW4Vt{1IGrfn+{ofmy61r(okz><G*O^)n!{XA+M@GyhzzKWGe%X(>{MlVNxM4?d4Ws5f|%W=X>~tYLe8fF z*^j?{;(a+9xQilSUs_aWSI2XI5|;o5EET=G0kH&N$Q40Vh~2q3#9Me)!+_8PFV*GfyjJo@F) zUE6apr}i1tQlM=2egk5g3hYGC@b8DmMG(eGUIayOW_js8*#Pg31<-a<8!&g2&JbAj zATzg2R@>mc`m-{{g-?pwF1- z(~IBl#(m;pS4oc?Z(fWtD8&849aY*r{Vj& zV64Gm$&EohZNGv}B6cL}vI4*gD0)}6LS;8n<4u)q!Lbc(ls*+EDxxG>(~2TyB{}2_ z1M^)e+pq;Hp6qxXVjGq%A`C-V@ zp<~aY6|8I$!@Y3fXU4jsz6cp99Wxzih$2}zrE*N6t1LhfWDnvUj#f~UcS8#pESQ}o zZAOB=0-cHsHNCvv3c?$-5`HPo*a#HES&ne>cMv1FG=Yu&RUrRMKZ9%~@c)#qRkMn? z(>ooN?W1+@?| zwX6+Dru?^;;IEOe%x{XqI9E_G_l-3V*_CgD#j@K08$SPqgY7qzwwWjJYQj0X1e`RJ z4Z|l8{hh#3Pyp_e)e5C|d6stYMAWPUh=EowrgQg#&~UcviX)iVTErLJa7$`Nv?8eH znJ70T8+Wddor`7~Im@p3X&AdwpPU&EEKt8MqKDDOr_mzDwojz?$ zrn!GDR9)N3mR9(6$VggD^&`RiOV+?eg+s!);uNZ|*$_5mPP)aA%MO_#0mq*0?DHiC zLq@U_2*KpLWV71QI^wi@z+MvRBer;CPt?ioC580!rzCz&mH$x(NY6JOY6__qfa3um<+T zg~_`hS6U*fQ~5jNA4*ul5^jX6v!r@5ZHM0i^{ZtZiJ(@MlakK+I@l(XX12m>2WT*H zx8l*su60pTvz^Ooi^0EU5wzIaFi?L>R4}-Lw^mH{RuQVzvJD5lN3s}2;%^3h^>+a# zae=If(w-DxdZton2_BEanI|-^9|rW(%W0+z9~GXJ4--j3eR~^|V6uG&lyM0^n69vY zxM+U$%hJ=_kKcl1cn*)o*Xol&nXkA!s&{f<0P@*?1|zj=|7cO-=@qNVh7c=9 zebt+=e~nZU(lV5_+;?g4L%~M6Yez1~m%7&h=P(%tr_~1$)cawe!&~}~MyLSerzIj0 z0}FSuU-ZYGKwNmmXh*(5UHj9gqCY&3p3`)h8mdmQ6Youqtct6&-ZCe*uFgVuXNr$| z59WfGf3+nd1vj33AcUfRE;xgn89c}-n4;a=uFim64-MbQDJ6rp*_LGiT75!zgAU!k z5AGZE{J9sM^iPebw5}Rs*WKw>~`C1PGEbTt0puPH*dTzYWZa#BAV@R6Z|0Tt8{dv#g%u3?E z4=!X5SJS4jaIg2wl6VUvlRDz(wAQSLMWsyZ=mrzH*E_mzaP@a~OF&I2uN?@9+MGC* zLxJr}vvzVCwx$zjnc&~oSab|@kZ_2_6qs6~Taz8O*e$L0VMyw&G81)ZN`HUe=AVGW ztFWkgfmfrO`OnXX?31S7=D62=TC;aI;t~^8wbEYiQ-T?xO13wvjZkx4#7Zx{=BSjm zJOA>p#*SNacR&Wr-Rox5=E*D!Pbn*{BOH~6q8Fp;PPJUDYRFWfg2j+@#Uy& zLR*TVNTiJWg}wE!{>=nH^zW#{bsjHsa+9JA=DvxF)|Xb>aDDN(RbqC28UkkByO8co z8g?`8%O7~{^eo$+(>>R6O9yOn_9rJE)M!awu4*8WwFPLsmPn->0SAPZmO^iowK3Q0wGMMm0IVjssS&EJe)kkzXX;`?z} z`zrJVjK}Wr9^4(zI5+lFVycBbZ*q-ae2m-+VdXX%`ukPC5D@C{u0!WH0g&?w+7BYy zs)mF_m7A#e2sBf}RDtV9Wt4uRRN`E=B&Leb)#$J25A0_y@Q>JBWWPTY;_e^Wh4oio zRg5(2D~>-RBu@_TOcN@RFSEMsGt$0yU0EJ*#c+t5G|`=QUg`>a9CD;Cavqr>QV`bmq6!)qF@eQRINO*6e2Um%8W+fG5b`v8Ny z4W?&~EZW=o**UhPBUw1*A^21fO|ffrAvaijL1l86V;%C~p~DOk4}bmQw+o4$-73P^ zkh>S2{Q554oU(YfgL%!mtfEJQPSe?ySUxJt44!x+t~6q8s&SOD{*&$~CUTxR?ytS2galvx$5R<3B70%%VJ%Bfnx%g|IxwE14{uf9l4#v+SJ6V`^%Pbe zGN7wIF9Df?x2b)0mMnfLyT{~_)-lsR+jl4RN!^}*KDgg_yBwNC`IDdE$F-EUJzaKA zim8{)E0)^$1akRW*nLXZnXQ4zc>P>^&1e5h_xt$4A(In!iURri&{zLSFn1rIw{~t% zQpCno4O0~4kWHSm`8jcx7;4B79(bZ{#5e~JGDt8S73HH}UaYEr8OQr&hXC0We|pab zJ%3Hx-|V%*NavDW9Fs2D^yy6&oGXdJrVK5dgXqBo?Fqf?Dm-7SP!h45H?h9&hr3Zu zJ^KrVf76@Z0O;kI*+cZ%pqH7#ryDoNIQU>8L#{VFKg;-*%}kC8urE?=#I>nCW6`b#Ku7zfI5ASs)!80dH=oYf3J>UsL)H>nL_{c9HE4yRl5 zhrI%gM}NK1@N7EKYAMJ6yj&4mZ@#m2ODsXn$oHx|v=ZzQ7`liR;>RzKrD^&2^_SrW^sYi!@p4p)s%1uc)D2b;_yrn;Ncf?|bcuV1g3osH2>8i`DKM&<$&B z=F72B^9@Za@n0|47YmA65KX9OPd>Q%Ur6uuco>TlcsGdLAOI7*d%S(Q$1AV$>8|P8 zJbwg{a|9f6TXBeKTLtncM$<11}xmjg<)V zCU271)2#@-YK^1)y!$$y=D@jxOAI=yQ`H0aV?(bA0y54?GkAaPANf*3$>0ks#=Nl1mmZJ4J`kboo30>MkI$~#kq~C3G^#{Z|6FkWUN3+{rat0M5Lfg+COF7 zaB`fqyS#x&Ox8YiUV`Bu1&|*R3v0onBjWtl&e{naA@wA#n@4i{idUq>Z%{rwze)EW zi#KwJ!ZjN!lmS}T{+e@Mns$e(+`f~SP-#XVW6Unxe%qSMVRB5>QPauQV)$KLD|v_^ zpuX->mKFGk3O7ZpB#WTvW!g|-v5U43`gOn8G_?B~i%s7=QgP=kGc(!w2llj!L)j(l z!HtRebKD7VuvBb#c3#^Mx!pIJ(}|?X>?7~K&*|cV*xqx`l7A@b=^gkGR2f$(SYC;#ch^W^1ie}P64Y65(!k$TSl&-QaMPRS$CU$bn}VLM zDju2SqOHD@oula5+SFx*qPI=Z{Wm><%oMI(A;0U}d<-E+?Y)43eU$CqUO=gscvaX&O~LQgt}-g7D$k z@-k~yS0O~|^59{ur75=IeEx-hPX_~%!oSX!&#dRr#xmJt%Reu)mB9U|iec^zVmDO7 zzh#)xmq~k+9XZ{~@jtvD1@1Ria^C;%?esrh_WwY>+pfLiZS=J@Y~|a)e=^r@Urm+N He)N9;L!7IC literal 0 HcmV?d00001 diff --git a/examples/rvc-app/RVC_app_state_diagram_drawio.xml b/examples/rvc-app/RVC_app_state_diagram_drawio.xml index 590f1db1d542bd..69b82a62543f48 100644 --- a/examples/rvc-app/RVC_app_state_diagram_drawio.xml +++ b/examples/rvc-app/RVC_app_state_diagram_drawio.xml @@ -1,2 +1,2 @@ - \ No newline at end of file +7V3bd6K6Gv9rutbZD7qAcH1Uazud6W3ZzpnT87IXQlRaFAdotfPX7wQTrkFRA7qrMw+VJISQ7/b7vnwJF6A3XV775nxy59nQvZAEe3kBLi8kSdIEEf3BJZ+rEqCQgrHv2KuiVMGT8weSQoGUvjs2DDINQ89zQ2eeLbS82QxaYabM9H1vkW028tzsU+fmmDxRSAqeLNOFhWa/HDucrEp1SUvKv0FnPKFPFlVjVTM1aWPScTAxbW+RKgL9C9DzPS9c/Zoue9DFk0fnZXXfVUltPDAfzsIqN3xqi97rpDd9g0u51x28/OyYf7fIYD9M9528MBls+ElnwPfeZzbEnQgXoLuYOCF8mpsWrl0gmqOySTh10ZWIfhYHRcb5Af0QLlNFZJDX0JvC0P9ETWitYZAZIywjaoLcVlZFi4QGik6aTVLzLxkKbWoSyo/jJySTg36Q+WHP1b3Rf13a7qM7Feeh1fVvtZHckuRtJkvcPFkjbxYSjgeAXF+ZU8fFL97z3n0H+qj7e7jAlY7r9jzX86MHASjaCtRQeRD63htM1RiqBkyVDy0kUc/RAlB2TlECGAxKAEGoiQ7yVkxbgQ4cJkqT9c3zJMuMeVJ1DvP0S79u3cCePrS/T18+/viju6fnlsSYJtVFj+0OM5Ol/n7HOqhrrXiogyr98fA/iIIX+CXQw4Xc77/wBZ43AbNsa0R4thO1Uc3pPKoEQI56pXw8Q3ycr812FETCgLsR9fkyrhua1ts4omgrN0ZNi4eV+flX8lbo1xj/vfSsN8QQZAbQhA5pTYF5oI1MALn0/HDijb2Z6faT0m5WJyZtbj1vTpjqFYbhJ5Fu8z30siyHOM3//B++H6krcvmSrrtcks5XV5/kKghNP+xgu4YKZt4M0rIrBzMHucOmLSzXDALHWhWSJms5PkDUssg0uK+/H7t3xt/g5fXGHj6//b5Uei3C5uiRYxiuEVJAuBrPZRUBEtoC0Inm9qFrhs5H1gKzxIP09ug56DWSJt5oFKDB5eUnfmglkVr39idkATQtp9hi6LPJAIhKbQZAPazIpgU2Jb8lIltJ1pjvSfHuRlkzKspaZcHaizyUx4p2B7M30/TktD+armVRgz9hPZdS4KveSnQ4Qttz/NOZRgA/TUjM/A5C+B3XGc9QWYgZIC69NYfQffQCJ3Q8XDv0wtCbogYurujGpiglb6PoH2oSPawTzFeOCCa+SS9GzhIzX5eM53IShtiD6eCplq4seya0HeTDjBzEpH7bQk+UrmwzNNEfXB6gv54V0p+igMHo1dx3pg4maMv2wpYo6e35bMwDgkt5BC7rba0IwdETGXJPC/kD8LoY6/nh8bF/WZW10CSGWY7KamBiltPqmhSZhOMsRBqk2IusOHVsO9JWLLuR1WAcyGyIEnWWYu0OitpdpD1nHK26lLu0P5VX4DFP5cGH9TBHOiSEqMmj+R7AqgRvFg9KGUCY2BO2dYFLJ0zfhy5jHIl+J3fhCw4mSahok0RtW/wn6Yp2RPiPbWmVzQCwCW4hRBdTFE8xwMGIDqSjAiJKORI5RQ/41lv0JpiElZ3gCAtlWa+6CfMhehlzGPWHX2OOpTQisdK9UC6ZHLle6PKGLY76kqdcpAOrLCXTQl6mCvSj1zKH8W+YSkVbr1TKnCKtRq+oqjZSjksbUWR11kaRwukgb+bDCT973nTuwvBfp5RUjkpJNKipIjic+tC76igavlfaMsjexEVrLSavHTB4GP+wBettEnZ/g5/LNW5/MDdnVTicsAv981cJS0+g+wExecs5NVWxeiiumXn+1HRTdQviz+BKWSDMjXgR8VALjdlykDNduBN7fy3CcLgu5jlahz34GelVoGOJakLfnAUj1BftNXIKsbPl+Xb2ifGN5bImKQpRAKkfZM5sJ5i7JpkvZ+Y69Ekj1zPD3OMZjtLgHRMMoYXZGD57eFUXXd5gEUqkdEXVA7pMTHu1m7mSzuaqbNwnFOsW5Z1XOyWjrniIuINerRT1Gvy8v7+5v64q0V8m6iWqopwPewFQpHOzYS+RFfY6lLghYdNtmSVuujQEKi9xU0Be3FQGGTTW2lJtyQVihQjPl6eDrB2cDhIoVXscw8ADGLxPjzQOrG2VGJDEgbV0HDhGQLxDglpFVENhRNU4cItHIJgytqaBLGNreTO9elFyX8KyTUZ7RFZc4NSAlgZYKX5sqKXWl+InshI8eICtx87Pp8wK46lgLaGAtTSZReqG0RYrhZCHdend9jsrVH1113l8zOLrtcbly4GKQg6BxqK7JDBEXK4NVbCc2iryXVtItZyBTk1VKEbeKWOgUFYGbW1aoi4lURZg67nQnOEQIF0W8GOyK+Qm0jJ6pnBzedvHQeti8yMCtM0uVdPc8M24tGq0LclPFWjnn1m+2xelivn9DmI+JXwjSo3Nbd6TU/KqdDUxha46vm9+ppqRdZHyQceueuwzGsL6sRXvAJk70I/VKBpH4NKuIbbGrEIRS5yqUYg9h0MZBancKpziMu4qo8S/wt0czeaKOBZSPRRStiFjU/7d7qaKbifbaKqkqql0zSwMSawIae3aMs93nDJ/+/0fkV4Vet86g+v+oBQ5nZjixVtc21KVVRI9jsY0o35PL1pW2IID5CId2KGy+sLzuwbKjlAJRKK/LlJzYrKv60JR9JXDiz7VPqcs+qpYMUouqrWR4SDeUj2if/nQ+7Fm489Z8EUVMGL1TQu+VMpx52g9J7hXSMVgBF+bjdXL5fnS+1H9BQZHGCDdxlktpfhGp7PyVuEk7CnSVIw945wyyNsyJXExNoQnm4wGyuXQdj++u/eOkO2OPHsWMOL5605mqM7XyIuS9uPrBjYC1bUCdYM0oDD4L47q2atzUcBVZdM38abD92Cz2eNgl4CS0xkaALHOSCMSlQWBFaMm00RTtfnTBa/onSHIqrnMTMplEbo2DKKe92wVg/320cT5m7dHCijaIy55j2jUqipnBIAP7BJlIQ/t88vLvNaEJS27i02UxQ1rwoU7gAFyQnugNWGlrvzjs89Jow2qWAwzGof2OhW1JrofF/o/gOZUKmrObU+OwxnjQDh6LK+cwxnb+pVHwIwq2NaMA03akxdJV2o+Xyo+E/mIgiVKeTIANw+1mN8Y4dBor/S/w2uVDY15fFqzXqtaDmmqbm6o5LWuXSz5aiBGk2PKxtSW2dTWVdaqSW2nZKrlSObsux7ed03s5BYHt+2apYY7eYS+gzgLrzPuaT3Vqk7wDocACzSz5HiRHD3h/xgC9huOZyqlMb9cwh3Tx6mViw+elIU2WXkpzyDP36RIUu6msoBBnGuv548zBkbbyB1YWjndvrBxOjWgTSiNFzfSdVruVr1sl8qdOZ+nNqkUDH4C1nZ9Mp/xV9ozU+Ucm+M4cIpqnf0PnEJaVtLUDOPue95U3I3aNmQj9U/NdsFFKTM/ZMJKSvra0LO4YKIxkvQAa8GES/iMSQZpR2XU2E6abXyVL5PYJYHCQQiMk1bq2kbDZJTajveIQgbRTkpsqyLVf2Th9dEIqpbFUg+2ZgwFbhn8sl443VtmbMBWWEEIUBfdWd9Q4rSnlhI9i1eOJzK661GpsauYQf48ttCuk8y0c7euHWdPoniGJYuPNW03xM7qzKB5QJyXQ5GzIeSHvd7BKd5hyGuWQ3lBp/KFiXNYcEflq+cJqaqNBgSZdN7/bJsznfN0zudW6Drj+xkN05l5cieP3RKp8PGq4HkCqUstCXG8YJq1u8P87Zts8deB3UKePTTGeaJMAMYDd78s/e9QHrwsvv/oux/et6fBj/9z+DhTXgkII9PK3pAVTfYJfNA38QeWTJccxVcHRj/IFzNBTvUnWDpNc5avxcMpZ9K83CkvyOZ+CuIWjmHmGICS7VTlKy9fR/YLfCAwcpvYm3ZrYgP+Lvcuoh8HZOuX+IbicEWJZ5xR0qzE8/eydyF15JA3ReyGoioFYksHV++8cH0mjFr4bAKtXvN9BNqk5BMJmer8VxIylawPJdAG7G8l0FrWhw/iF8t9+4BrekFOvqpLi2DFnJoUAqji/xUgOJYxv+/7qIttIPfRfMWhVCbTcSom2xOXaos0UVkV90wuoAleBbdPzH1mhVMMKf8gvIsy3V/1kVVcH8++BZflunXEO4rluqaOcsguwTDxYJ0HHjPpUJ4jtt95x/3B4GFwcutsuqHlosvJCflNnHXMJHFdeeesjSxX6Vjg9ueRfrXooJgTeWYogBX+qQ0rUvR6oKWv+IJjgj/zPRnbxvcCEdyP1ls36nPG7sqGYFTb/4CzkA1tc3x8/uL7PgetFoMYNNmyke+9/9KvWzewpw/t79OXjz/+6O7peU2s+hTFId70cnQZ7NpOCeyqoGWtgSBs/MgNvsrnscOZjVwab5GgQlRy5WBWi+oDZARC2sJyzSBwLFpMmlV2RJtOh1c0MZuvTOwV/+T4gito6FJbVaUkmzPrVypCssll2ywMQ89lo6kVjwHawfvsXg370LodDR7DV+v+LhAW4e/DLoLtHPBhjIqLYnl4D1veqDU08dKNMIVBgAxWwFYzp7aCWzCLgOHP8cqcRJe+h0mT8Dp6rwmOoOMW/wA= \ No newline at end of file diff --git a/examples/rvc-app/linux/BUILD.gn b/examples/rvc-app/linux/BUILD.gn index 7c865a380c9a9c..2db48c20b27357 100644 --- a/examples/rvc-app/linux/BUILD.gn +++ b/examples/rvc-app/linux/BUILD.gn @@ -27,6 +27,7 @@ executable("chip-rvc-app") { "${chip_root}/examples/rvc-app/rvc-common/src/rvc-device.cpp", "${chip_root}/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp", "${chip_root}/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp", + "RvcAppCommandDelegate.cpp", "include/CHIPProjectAppConfig.h", "main.cpp", ] @@ -35,6 +36,7 @@ executable("chip-rvc-app") { "${chip_root}/examples/platform/linux:app-main", "${chip_root}/examples/rvc-app/rvc-common", "${chip_root}/src/lib", + "${chip_root}/third_party/jsoncpp", ] include_dirs = [ diff --git a/examples/rvc-app/linux/RvcAppCommandDelegate.cpp b/examples/rvc-app/linux/RvcAppCommandDelegate.cpp new file mode 100644 index 00000000000000..da2908cf65e6ec --- /dev/null +++ b/examples/rvc-app/linux/RvcAppCommandDelegate.cpp @@ -0,0 +1,164 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "RvcAppCommandDelegate.h" +#include + +#include "rvc-device.h" +#include + +using namespace chip; +using namespace chip::app::Clusters; + +RvcAppCommandHandler * RvcAppCommandHandler::FromJSON(const char * json) +{ + Json::Reader reader; + Json::Value value; + + if (!reader.parse(json, value)) + { + ChipLogError(NotSpecified, "RVC App: Error parsing JSON with error %s:", reader.getFormattedErrorMessages().c_str()); + return nullptr; + } + + if (value.empty() || !value.isObject()) + { + ChipLogError(NotSpecified, "RVC App: Invalid JSON command received"); + return nullptr; + } + + if (!value.isMember("Name") || !value["Name"].isString()) + { + ChipLogError(NotSpecified, "RVC App: Invalid JSON command received: command name is missing"); + return nullptr; + } + + return Platform::New(std::move(value)); +} + +void RvcAppCommandHandler::HandleCommand(intptr_t context) +{ + auto * self = reinterpret_cast(context); + std::string name = self->mJsonValue["Name"].asString(); + + VerifyOrExit(!self->mJsonValue.empty(), ChipLogError(NotSpecified, "Invalid JSON event command received")); + + if (name == "Charged") + { + self->OnChargedHandler(); + } + else if (name == "Charging") + { + self->OnChargingHandler(); + } + else if (name == "Docked") + { + self->OnDockedHandler(); + } + else if (name == "ChargerFound") + { + self->OnChargerFoundHandler(); + } + else if (name == "LowCharge") + { + self->OnLowChargeHandler(); + } + else if (name == "ActivityComplete") + { + self->OnActivityCompleteHandler(); + } + else if (name == "ErrorEvent") + { + std::string error = self->mJsonValue["Error"].asString(); + self->OnErrorEventHandler(error); + } + else if (name == "ClearError") + { + self->OnClearErrorHandler(); + } + else + { + ChipLogError(NotSpecified, "Unhandled command: Should never happens"); + } + +exit: + Platform::Delete(self); +} + +void RvcAppCommandHandler::SetRvcDevice(chip::app::Clusters::RvcDevice * aRvcDevice) +{ + mRvcDevice = aRvcDevice; +} + +void RvcAppCommandHandler::OnChargedHandler() +{ + mRvcDevice->HandleChargedMessage(); +} + +void RvcAppCommandHandler::OnChargingHandler() +{ + mRvcDevice->HandleChargingMessage(); +} + +void RvcAppCommandHandler::OnDockedHandler() +{ + mRvcDevice->HandleDockedMessage(); +} + +void RvcAppCommandHandler::OnChargerFoundHandler() +{ + mRvcDevice->HandleChargerFoundMessage(); +} + +void RvcAppCommandHandler::OnLowChargeHandler() +{ + mRvcDevice->HandleLowChargeMessage(); +} + +void RvcAppCommandHandler::OnActivityCompleteHandler() +{ + mRvcDevice->HandleActivityCompleteEvent(); +} + +void RvcAppCommandHandler::OnErrorEventHandler(const std::string & error) +{ + mRvcDevice->HandleErrorEvent(error); +} + +void RvcAppCommandHandler::OnClearErrorHandler() +{ + mRvcDevice->HandleClearErrorMessage(); +} + +void RvcAppCommandDelegate::SetRvcDevice(chip::app::Clusters::RvcDevice * aRvcDevice) +{ + mRvcDevice = aRvcDevice; +} + +void RvcAppCommandDelegate::OnEventCommandReceived(const char * json) +{ + auto handler = RvcAppCommandHandler::FromJSON(json); + if (nullptr == handler) + { + ChipLogError(NotSpecified, "RVC App: Unable to instantiate a command handler"); + return; + } + + handler->SetRvcDevice(mRvcDevice); + chip::DeviceLayer::PlatformMgr().ScheduleWork(RvcAppCommandHandler::HandleCommand, reinterpret_cast(handler)); +} diff --git a/examples/rvc-app/linux/RvcAppCommandDelegate.h b/examples/rvc-app/linux/RvcAppCommandDelegate.h new file mode 100644 index 00000000000000..8be8943172b37a --- /dev/null +++ b/examples/rvc-app/linux/RvcAppCommandDelegate.h @@ -0,0 +1,69 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "NamedPipeCommands.h" +#include "rvc-device.h" +#include +#include + +class RvcAppCommandHandler +{ +public: + static RvcAppCommandHandler * FromJSON(const char * json); + + static void HandleCommand(intptr_t context); + + RvcAppCommandHandler(Json::Value && jasonValue) : mJsonValue(std::move(jasonValue)) {} + + void SetRvcDevice(chip::app::Clusters::RvcDevice * aRvcDevice); + +private: + Json::Value mJsonValue; + chip::app::Clusters::RvcDevice * mRvcDevice; + + /** + * Should be called to notify that the device has finished charging. + */ + void OnChargedHandler(); + + void OnChargingHandler(); + + void OnDockedHandler(); + + void OnChargerFoundHandler(); + + void OnLowChargeHandler(); + + void OnActivityCompleteHandler(); + + void OnErrorEventHandler(const std::string & error); + + void OnClearErrorHandler(); +}; + +class RvcAppCommandDelegate : public NamedPipeCommandDelegate +{ +private: + chip::app::Clusters::RvcDevice * mRvcDevice; + +public: + void SetRvcDevice(chip::app::Clusters::RvcDevice * aRvcDevice); + void OnEventCommandReceived(const char * json) override; +}; diff --git a/examples/rvc-app/linux/main.cpp b/examples/rvc-app/linux/main.cpp index 462bc6febfec29..3800e8e501d168 100644 --- a/examples/rvc-app/linux/main.cpp +++ b/examples/rvc-app/linux/main.cpp @@ -15,25 +15,46 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "RvcAppCommandDelegate.h" #include "rvc-device.h" #include +#define RVC_ENDPOINT 1 + using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; -RvcDevice * rvcDevice = nullptr; +namespace { +constexpr const char kChipEventFifoPathPrefix[] = "/tmp/chip_rvc_fifo_"; +NamedPipeCommands sChipNamedPipeCommands; +RvcAppCommandDelegate sRvcAppCommandDelegate; +} // namespace + +RvcDevice * gRvcDevice = nullptr; void ApplicationInit() { - rvcDevice = new RvcDevice(1); - rvcDevice->Init(); + std::string path = kChipEventFifoPathPrefix + std::to_string(getpid()); + + if (sChipNamedPipeCommands.Start(path, &sRvcAppCommandDelegate) != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to start CHIP NamedPipeCommands"); + sChipNamedPipeCommands.Stop(); + } + + gRvcDevice = new RvcDevice(RVC_ENDPOINT); + gRvcDevice->Init(); + + sRvcAppCommandDelegate.SetRvcDevice(gRvcDevice); } void ApplicationShutdown() { - delete rvcDevice; - rvcDevice = nullptr; + delete gRvcDevice; + gRvcDevice = nullptr; + + sChipNamedPipeCommands.Stop(); } int main(int argc, char * argv[]) diff --git a/examples/rvc-app/run_all_yaml_tests.sh b/examples/rvc-app/run_all_yaml_tests.sh new file mode 100755 index 00000000000000..a599a6139cdf95 --- /dev/null +++ b/examples/rvc-app/run_all_yaml_tests.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +## --- +# This is a helper script that runs all the yaml tests for all the application clusters enabled in the RVC App. +# Run the script from the root dir. +# The script takes the node ID that the device was commissioned with. +## --- + +NODEID=$1 +RVC_DEVICE_ENDPOINT=1 + +PICS_RUN="examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt" +PICS_CLEAN="examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt" +PICS_OP_STATE="examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt" + +if [ -z "$NODEID" ]; then + echo "Usage: run_all_yaml_tests [Node ID]" + exit +fi + +# RVC Clean Mode cluster +./scripts/tests/yaml/chiptool.py tests Test_TC_RVCCLEANM_1_1 --PICS "$PICS_CLEAN" --nodeId "$NODEID" --endpoint "$RVC_DEVICE_ENDPOINT" && + + # RVC Operational State cluster + ./scripts/tests/yaml/chiptool.py tests Test_TC_RVCOPSTATE_1_1 --PICS "$PICS_OP_STATE" --nodeId "$NODEID" --endpoint "$RVC_DEVICE_ENDPOINT" && + ./scripts/tests/yaml/chiptool.py tests Test_TC_RVCOPSTATE_2_2 --PICS "$PICS_OP_STATE" --nodeId "$NODEID" --endpoint "$RVC_DEVICE_ENDPOINT" && + + # RVC Run Mode cluster + ./scripts/tests/yaml/chiptool.py tests Test_TC_RVCRUNM_1_1 --PICS "$PICS_RUN" --nodeId "$NODEID" --endpoint "$RVC_DEVICE_ENDPOINT" && + echo done diff --git a/examples/rvc-app/rvc-common/include/rvc-device.h b/examples/rvc-app/rvc-common/include/rvc-device.h index 9ded6e76b8fbee..6064bcea3e9f73 100644 --- a/examples/rvc-app/rvc-common/include/rvc-device.h +++ b/examples/rvc-app/rvc-common/include/rvc-device.h @@ -21,6 +21,9 @@ class RvcDevice RvcOperationalState::RvcOperationalStateDelegate mOperationalStateDelegate; OperationalState::Instance mOperationalStateInstance; + bool mDocked = false; + bool mCharging = false; + public: /** * This class is responsible for initialising all the RVC clusters and manging the interactions between them as required by @@ -34,8 +37,9 @@ class RvcDevice { // set the current-mode at start-up mRunModeInstance.UpdateCurrentMode(RvcRunMode::ModeIdle); - // Assume that the device is not docked. - mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + + // Hypothetically, the device checks if it is physically docked or charging + SetDeviceToIdleState(); // set callback functions mRunModeDelegate.SetHandleChangeToMode(&RvcDevice::HandleRvcRunChangeToMode, this); @@ -49,6 +53,12 @@ class RvcDevice */ void Init(); + /** + * Sets the device to an idle state, that is either the STOPPED, DOCKED or CHARGING state, depending on physical information. + * Note: in this example this is based on the mDocked and mChanging boolean variables. + */ + void SetDeviceToIdleState(); + /** * Handles the RvcRunMode command requesting a mode change. */ @@ -68,6 +78,31 @@ class RvcDevice * Handles the RvcOperationalState resume command. */ void HandleOpStateResumeCallback(Clusters::OperationalState::GenericOperationalError & err); + + /** + * Updates the state machine when the device becomes fully-charged. + */ + void HandleChargedMessage(); + + void HandleChargingMessage(); + + void HandleDockedMessage(); + + void HandleChargerFoundMessage(); + + void HandleLowChargeMessage(); + + void HandleActivityCompleteEvent(); + + /** + * Sets the device to an error state with the error state ID matching the error name given. + * @param error The error name. Could be one of UnableToStartOrResume, UnableToCompleteOperation, CommandInvalidInState, + * FailedToFindChargingDock, Stuck, DustBinMissing, DustBinFull, WaterTankEmpty, WaterTankMissing, WaterTankLidOpen or + * MopCleaningPadMissing. + */ + void HandleErrorEvent(const std::string & error); + + void HandleClearErrorMessage(); }; } // namespace Clusters diff --git a/examples/rvc-app/rvc-common/pics/RVC Clean Mode Cluster Test Plan.xml b/examples/rvc-app/rvc-common/pics/RVC Clean Mode Cluster Test Plan.xml new file mode 100644 index 00000000000000..ce0ddaa38b5307 --- /dev/null +++ b/examples/rvc-app/rvc-common/pics/RVC Clean Mode Cluster Test Plan.xml @@ -0,0 +1,132 @@ + + + RVC Clean Mode Cluster Test Plan + + + + + + RVCCLEANM.S + Does the device implement the RVCCLEANM cluster as a server? + 89.1. Role - allclusters.html[pdf] + O + true + + + + + + PIXIT.RVCCLEANM.MODE_CHANGE_FAIL + Id of mode the device will fail to transition to, given its current state + 90. PIXIT Definition - allclusters.html[pdf] + O + 0x01 + + + PIXIT.RVCCLEANM.MODE_CHANGE_OK + Id of mode the device will successfully transition to, given its current state + 90. PIXIT Definition - allclusters.html[pdf] + O + 0x01 + + + + + + + + RVCCLEANM.S.A0000 + Does the device implement the SupportedModes attribute? + 89.2.2. Attributes - allclusters.html[pdf] + M + true + + + RVCCLEANM.S.A0001 + Does the device implement the CurrentMode attribute? + 89.2.2. Attributes - allclusters.html[pdf] + M + true + + + RVCCLEANM.S.A0002 + Does the device implement the StartUpMode attribute? + 89.2.2. Attributes - allclusters.html[pdf] + O + false + + + RVCCLEANM.S.A0003 + Does the device implement the OnMode attribute? + 89.2.2. Attributes - allclusters.html[pdf] + M + false + + + + + + + + RVCCLEANM.S.C01.Tx + Does the device implement sending the ChangeToModeResponse command? + 89.2.4. Commands generated - allclusters.html[pdf] + M + true + + + + + + RVCCLEANM.S.C00.Rsp + Does the device implement receiving the ChangeToMode command? + 89.2.3. Commands received - allclusters.html[pdf] + M + true + + + + + + RVCCLEANM.S.F00 + Does the device support depending on an On/Off cluster implemented on the same endpoint? + 89.2.1. Features - allclusters.html[pdf] + O + false + + + + + + RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE + Does the DUT support testing the failed ChangeToMode command? + 89.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/pics/RVC Operational State Cluster Test Plan.xml b/examples/rvc-app/rvc-common/pics/RVC Operational State Cluster Test Plan.xml new file mode 100644 index 00000000000000..c600445a35964a --- /dev/null +++ b/examples/rvc-app/rvc-common/pics/RVC Operational State Cluster Test Plan.xml @@ -0,0 +1,285 @@ + + + RVC Operational State Cluster Test Plan + + + + + + RVCOPSTATE.S + Does the device implement the RVC Operational State cluster as a server? + 223.1. Role - allclusters.html[pdf] + O + true + + + + + + + + + + RVCOPSTATE.S.A0000 + Does the device implement the PhaseList attribute? + 223.2.1. Attributes - allclusters.html[pdf] + M + true + + + RVCOPSTATE.S.A0001 + Does the device implement the CurrentPhase attribute? + 223.2.1. Attributes - allclusters.html[pdf] + M + true + + + RVCOPSTATE.S.A0002 + Does the device implement the CountdownTime attribute? + 223.2.1. Attributes - allclusters.html[pdf] + O + false + + + RVCOPSTATE.S.A0003 + Does the device implement the OperationalStateList attribute? + 223.2.1. Attributes - allclusters.html[pdf] + M + true + + + RVCOPSTATE.S.A0004 + Does the device implement the OperationalState attribute? + 223.2.1. Attributes - allclusters.html[pdf] + M + true + + + RVCOPSTATE.S.A0005 + Does the device implement the OperationalError attribute? + 223.2.1. Attributes - allclusters.html[pdf] + M + true + + + + + + RVCOPSTATE.S.E00 + Does the device implement the OperationalError Event ? + 223.2.4. Events - allclusters.html[pdf] + M + true + + + RVCOPSTATE.S.E01 + Does the device implement the OperationCompletion Event ? + 223.2.4. Events - allclusters.html[pdf] + O + true + + + + + + RVCOPSTATE.S.C04.Tx + Does the device implement generating the OperationalCommandResponse command? + 223.2.3. Commands generated - allclusters.html[pdf] + M + true + + + + + + RVCOPSTATE.S.C00.Rsp + Does the device implement receiving the Pause command? + 223.2.2. Commands received - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.C01.Rsp + Does the device implement receiving the Stop command? + 223.2.2. Commands received - allclusters.html[pdf] + O + false + + + RVCOPSTATE.S.C02.Rsp + Does the device implement receiving the Start command? + 223.2.2. Commands received - allclusters.html[pdf] + O + false + + + RVCOPSTATE.S.C03.Rsp + Does the device implement receiving the Resume command? + 223.2.2. Commands received - allclusters.html[pdf] + O + true + + + + + + + + RVCOPSTATE.S.M.ST_STOPPED + Does the DUT support testing the Stopped(0x00) operational state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ST_RUNNING + Does the DUT support testing the Running(0x01) operational state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ST_PAUSED + Does the DUT support testing the Paused(0x02) operational state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ST_ERROR + Does the DUT support testing the Error(0x03) operational state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ST_SEEKING_CHARGER + Does the DUT support testing the SeekingCharger(0x40) operational state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ST_CHARGING + Does the DUT support testing the Charging(0x41) operational state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ST_DOCKED + Does the DUT support testing the Docked(0x42) operational state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_NO_ERROR + Does the DUT support testing the NoError(0x00) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME + Does the DUT support testing the UnableToStartOrResume(0x01) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_UNABLE_TO_COMPLETE_OPERATION + Does the DUT support testing the UnableToCompleteOperation(0x02) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_COMMAND_INVALID_IN_STATE + Does the DUT support testing the CommandInvalidInState(0x03) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_FAILED_TO_FIND_CHARGING_DOCK + Does the DUT support testing the FailedToFindChargingDock(0x40) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_STUCK + Does the DUT support testing the Stuck(0x41) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_DUST_BIN_MISSING + Does the DUT support testing the DustBinMissing(0x42) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_DUST_BIN_FULL + Does the DUT support testing the DustBinFull(0x43) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_WATER_TANK_EMPTY + Does the DUT support testing the WaterTankEmpty(0x44) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_WATER_TANK_MISSING + Does the DUT support testing the WaterTankMissing(0x45) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_WATER_TANK_LID_OPEN + Does the DUT support testing the WaterTankLidOpen(0x46) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + RVCOPSTATE.S.M.ERR_MOP_CLEANING_PAD_MISSING + Does the DUT support testing the MopCleaningPadMissing(0x47) error state? + 223.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/pics/RVC Run Mode Cluster Test Plan.xml b/examples/rvc-app/rvc-common/pics/RVC Run Mode Cluster Test Plan.xml new file mode 100644 index 00000000000000..0bdd95322e213b --- /dev/null +++ b/examples/rvc-app/rvc-common/pics/RVC Run Mode Cluster Test Plan.xml @@ -0,0 +1,132 @@ + + + RVC Run Mode Cluster Test Plan + + + + + + RVCRUNM.S + Does the device implement the RVCRUNM cluster as a server? + 84.1. Role - allclusters.html[pdf] + O + true + + + + + + PIXIT.RVCRUNM.MODE_CHANGE_FAIL + Id of mode the device will fail to transition to, given its current state + 85. PIXIT Definition - allclusters.html[pdf] + O + 0x02 + + + PIXIT.RVCRUNM.MODE_CHANGE_OK + Id of mode the device will successfully transition to, given its current state + 85. PIXIT Definition - allclusters.html[pdf] + O + 0x00 + + + + + + + + RVCRUNM.S.A0000 + Does the device implement the SupportedModes attribute? + 84.2.2. Attributes - allclusters.html[pdf] + M + true + + + RVCRUNM.S.A0001 + Does the device implement the CurrentMode attribute? + 84.2.2. Attributes - allclusters.html[pdf] + M + true + + + RVCRUNM.S.A0002 + Does the device implement the StartUpMode attribute? + 84.2.2. Attributes - allclusters.html[pdf] + O + false + + + RVCRUNM.S.A0003 + Does the device implement the OnMode attribute? + 84.2.2. Attributes - allclusters.html[pdf] + M + false + + + + + + + + RVCRUNM.S.C01.Tx + Does the device implement sending the ChangeToModeResponse command? + 84.2.4. Commands generated - allclusters.html[pdf] + M + true + + + + + + RVCRUNM.S.C00.Rsp + Does the device implement receiving the ChangeToMode command? + 84.2.3. Commands received - allclusters.html[pdf] + M + true + + + + + + RVCRUNM.S.F00 + Does the device support depending on an On/Off cluster implemented on the same endpoint? + 84.2.1. Features - allclusters.html[pdf] + O + false + + + + + + RVCRUNM.S.M.CAN_TEST_MODE_FAILURE + Does the DUT support testing the failed ChangeToMode command? + 84.2.5. Manual controllable - allclusters.html[pdf] + O + true + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt b/examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt new file mode 100644 index 00000000000000..d0c8529a83d2e0 --- /dev/null +++ b/examples/rvc-app/rvc-common/pics/RVC_App_Test_Plan.txt @@ -0,0 +1,53 @@ +RVCCLEANM.S=1 +RVCCLEANM.S.A0000=1 +RVCCLEANM.S.A0001=1 +RVCCLEANM.S.A0002=0 +RVCCLEANM.S.A0003=0 +RVCCLEANM.S.C01.Tx=1 +RVCCLEANM.S.C00.Rsp=1 +RVCCLEANM.S.F00=0 +RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE=1 + +RVCOPSTATE.S=1 +RVCOPSTATE.S.A0000=1 +RVCOPSTATE.S.A0001=1 +RVCOPSTATE.S.A0002=0 +RVCOPSTATE.S.A0003=1 +RVCOPSTATE.S.A0004=1 +RVCOPSTATE.S.A0005=1 +RVCOPSTATE.S.E00=1 +RVCOPSTATE.S.E01=1 +RVCOPSTATE.S.C04.Tx=1 +RVCOPSTATE.S.C00.Rsp=1 +RVCOPSTATE.S.C01.Rsp=0 +RVCOPSTATE.S.C02.Rsp=0 +RVCOPSTATE.S.C03.Rsp=1 +RVCOPSTATE.S.M.ST_STOPPED=1 +RVCOPSTATE.S.M.ST_RUNNING=1 +RVCOPSTATE.S.M.ST_PAUSED=1 +RVCOPSTATE.S.M.ST_ERROR=1 +RVCOPSTATE.S.M.ST_SEEKING_CHARGER=1 +RVCOPSTATE.S.M.ST_CHARGING=1 +RVCOPSTATE.S.M.ST_DOCKED=1 +RVCOPSTATE.S.M.ERR_NO_ERROR=1 +RVCOPSTATE.S.M.ERR_UNABLE_TO_START_OR_RESUME=1 +RVCOPSTATE.S.M.ERR_UNABLE_TO_COMPLETE_OPERATION=1 +RVCOPSTATE.S.M.ERR_COMMAND_INVALID_IN_STATE=1 +RVCOPSTATE.S.M.ERR_FAILED_TO_FIND_CHARGING_DOCK=1 +RVCOPSTATE.S.M.ERR_STUCK=1 +RVCOPSTATE.S.M.ERR_DUST_BIN_MISSING=1 +RVCOPSTATE.S.M.ERR_DUST_BIN_FULL=1 +RVCOPSTATE.S.M.ERR_WATER_TANK_EMPTY=1 +RVCOPSTATE.S.M.ERR_WATER_TANK_MISSING=1 +RVCOPSTATE.S.M.ERR_WATER_TANK_LID_OPEN=1 +RVCOPSTATE.S.M.ERR_MOP_CLEANING_PAD_MISSING=1 + +RVCRUNM.S=1 +RVCRUNM.S.A0000=1 +RVCRUNM.S.A0001=1 +RVCRUNM.S.A0002=0 +RVCRUNM.S.A0003=0 +RVCRUNM.S.C01.Tx=1 +RVCRUNM.S.C00.Rsp=1 +RVCRUNM.S.F00=0 +RVCRUNM.S.M.CAN_TEST_MODE_FAILURE=1 \ No newline at end of file diff --git a/examples/rvc-app/rvc-common/src/rvc-device.cpp b/examples/rvc-app/rvc-common/src/rvc-device.cpp index f085e6dada9f1c..d450a635e2e978 100644 --- a/examples/rvc-app/rvc-common/src/rvc-device.cpp +++ b/examples/rvc-app/rvc-common/src/rvc-device.cpp @@ -9,37 +9,67 @@ void RvcDevice::Init() mOperationalStateInstance.Init(); } +void RvcDevice::SetDeviceToIdleState() +{ + if (mCharging) + { + mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kCharging)); + } + else if (mDocked) + { + mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kDocked)); + } + else + { + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + } +} + void RvcDevice::HandleRvcRunChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response) { - uint8_t currentMode = mRunModeInstance.GetCurrentMode(); + uint8_t currentState = mOperationalStateInstance.GetCurrentOperationalState(); + uint8_t currentMode = mRunModeInstance.GetCurrentMode(); - switch (newMode) + switch (currentState) { - case RvcRunMode::ModeMapping: { - // change to mapping only allowed from the Idle state. - if (currentMode != RvcRunMode::ModeIdle) + case to_underlying(OperationalState::OperationalStateEnum::kStopped): + case to_underlying(RvcOperationalState::OperationalStateEnum::kDocked): + case to_underlying(RvcOperationalState::OperationalStateEnum::kCharging): { + // We could be in the charging state with an RvcRun mode != idle. + if (currentMode != RvcRunMode::ModeIdle && newMode != RvcRunMode::ModeIdle) { response.status = to_underlying(ModeBase::StatusCode::kGenericFailure); - response.statusText.SetValue(chip::CharSpan::fromCharString("Change to the mapping mode is only allowed from idle")); + response.statusText.SetValue( + chip::CharSpan::fromCharString("Change to the mapping or cleaning mode is only allowed from idle")); return; } mRunModeInstance.UpdateCurrentMode(newMode); mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); - break; - } - case RvcRunMode::ModeCleaning: { - mRunModeInstance.UpdateCurrentMode(newMode); - mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); + response.status = to_underlying(ModeBase::StatusCode::kSuccess); + return; } break; - case RvcRunMode::ModeIdle: { + case to_underlying(OperationalState::OperationalStateEnum::kRunning): { + if (newMode != RvcRunMode::ModeIdle) + { + response.status = to_underlying(ModeBase::StatusCode::kGenericFailure); + response.statusText.SetValue( + chip::CharSpan::fromCharString("Change to the mapping or cleaning mode is only allowed from idle")); + return; + } + mRunModeInstance.UpdateCurrentMode(newMode); - mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kSeekingCharger)); + response.status = to_underlying(ModeBase::StatusCode::kSuccess); + return; } + break; } - response.status = to_underlying(ModeBase::StatusCode::kSuccess); + // If we fall through at any point, it's because the change is not supported in the current state. + response.status = to_underlying(ModeBase::StatusCode::kGenericFailure); + response.statusText.SetValue(chip::CharSpan::fromCharString("This change is not allowed at this time. ")); } void RvcDevice::HandleRvcCleanChangeToMode(uint8_t newMode, ModeBase::Commands::ChangeToModeResponse::Type & response) @@ -81,3 +111,171 @@ void RvcDevice::HandleOpStateResumeCallback(Clusters::OperationalState::GenericO err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation)); } } + +void RvcDevice::HandleChargedMessage() +{ + if (mOperationalStateInstance.GetCurrentOperationalState() != + to_underlying(RvcOperationalState::OperationalStateEnum::kCharging)) + { + ChipLogError(NotSpecified, "RVC App: The 'Charged' command is only accepted when the device is in the 'Charging' state."); + return; + } + + mCharging = false; + + if (mRunModeInstance.GetCurrentMode() == RvcRunMode::ModeIdle) + { + if (mDocked) // assuming that we can't be charging the device while it is not docked. + { + mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kDocked)); + } + else + { + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)); + } + } + else + { + mOperationalStateInstance.SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)); + } +} + +void RvcDevice::HandleChargingMessage() +{ + if (mOperationalStateInstance.GetCurrentOperationalState() != to_underlying(RvcOperationalState::OperationalStateEnum::kDocked)) + { + ChipLogError(NotSpecified, "RVC App: The 'Charging' command is only accepted when the device is in the 'Docked' state."); + return; + } + + mCharging = true; + + mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kCharging)); +} + +void RvcDevice::HandleDockedMessage() +{ + if (mOperationalStateInstance.GetCurrentOperationalState() != to_underlying(OperationalState::OperationalStateEnum::kStopped)) + { + ChipLogError(NotSpecified, "RVC App: The 'Docked' command is only accepted when the device is in the 'Stopped' state."); + return; + } + + mDocked = true; + + mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kDocked)); +} + +void RvcDevice::HandleChargerFoundMessage() +{ + if (mOperationalStateInstance.GetCurrentOperationalState() != + to_underlying(RvcOperationalState::OperationalStateEnum::kSeekingCharger)) + { + ChipLogError(NotSpecified, + "RVC App: The 'ChargerFound' command is only accepted when the device is in the 'SeekingCharger' state."); + return; + } + + mCharging = true; + mDocked = true; + + mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kCharging)); +} + +void RvcDevice::HandleLowChargeMessage() +{ + if (mOperationalStateInstance.GetCurrentOperationalState() != to_underlying(OperationalState::OperationalStateEnum::kRunning)) + { + ChipLogError(NotSpecified, "RVC App: The 'LowCharge' command is only accepted when the device is in the 'Running' state."); + return; + } + + mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kSeekingCharger)); +} + +void RvcDevice::HandleActivityCompleteEvent() +{ + if (mOperationalStateInstance.GetCurrentOperationalState() != to_underlying(OperationalState::OperationalStateEnum::kRunning)) + { + ChipLogError(NotSpecified, + "RVC App: The 'ActivityComplete' command is only accepted when the device is in the 'Running' state."); + return; + } + + mRunModeInstance.UpdateCurrentMode(RvcRunMode::ModeIdle); + + Optional> a(DataModel::Nullable(100)); + Optional> b(DataModel::Nullable(10)); + mOperationalStateInstance.OnOperationCompletionDetected(0, a, b); + + mOperationalStateInstance.SetOperationalState(to_underlying(RvcOperationalState::OperationalStateEnum::kSeekingCharger)); +} + +void RvcDevice::HandleErrorEvent(const std::string & error) +{ + detail::Structs::ErrorStateStruct::Type err; + + if (error == "UnableToStartOrResume") + { + err.errorStateID = to_underlying(OperationalState::ErrorStateEnum::kUnableToStartOrResume); + } + else if (error == "UnableToCompleteOperation") + { + err.errorStateID = to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation); + } + else if (error == "CommandInvalidInState") + { + err.errorStateID = to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState); + } + else if (error == "FailedToFindChargingDock") + { + err.errorStateID = to_underlying(RvcOperationalState::ErrorStateEnum::kFailedToFindChargingDock); + } + else if (error == "Stuck") + { + err.errorStateID = to_underlying(RvcOperationalState::ErrorStateEnum::kStuck); + } + else if (error == "DustBinMissing") + { + err.errorStateID = to_underlying(RvcOperationalState::ErrorStateEnum::kDustBinMissing); + } + else if (error == "DustBinFull") + { + err.errorStateID = to_underlying(RvcOperationalState::ErrorStateEnum::kDustBinFull); + } + else if (error == "WaterTankEmpty") + { + err.errorStateID = to_underlying(RvcOperationalState::ErrorStateEnum::kWaterTankEmpty); + } + else if (error == "WaterTankMissing") + { + err.errorStateID = to_underlying(RvcOperationalState::ErrorStateEnum::kWaterTankMissing); + } + else if (error == "WaterTankLidOpen") + { + err.errorStateID = to_underlying(RvcOperationalState::ErrorStateEnum::kWaterTankLidOpen); + } + else if (error == "MopCleaningPadMissing") + { + err.errorStateID = to_underlying(RvcOperationalState::ErrorStateEnum::kMopCleaningPadMissing); + } + else + { + ChipLogError(NotSpecified, "Unhandled command: The 'Error' key of the 'ErrorEvent' message is not valid."); + return; + } + + mOperationalStateInstance.OnOperationalErrorDetected(err); +} + +void RvcDevice::HandleClearErrorMessage() +{ + if (mOperationalStateInstance.GetCurrentOperationalState() != to_underlying(OperationalState::OperationalStateEnum::kError)) + { + ChipLogError(NotSpecified, "RVC App: The 'ClearError' command is only excepted when the device is in the 'Error' state."); + return; + } + + mRunModeInstance.UpdateCurrentMode(RvcRunMode::ModeIdle); + SetDeviceToIdleState(); +} diff --git a/src/app/clusters/operational-state-server/operational-state-server.h b/src/app/clusters/operational-state-server/operational-state-server.h index 4d093318ac4833..0978f613723533 100644 --- a/src/app/clusters/operational-state-server/operational-state-server.h +++ b/src/app/clusters/operational-state-server/operational-state-server.h @@ -79,7 +79,7 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface CHIP_ERROR SetCurrentPhase(const app::DataModel::Nullable & aPhase); /** - * Set current operational state. + * Set current operational state to aOpState and the operational error to kNoError. * NOTE: This method cannot be used to set the error state. The error state must be set via the * OnOperationalErrorDetected method. * @param aOpState The operational state that should now be the current one. From b02c9842e3dedc8f81f16760da5c322affdf27ee Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 13 Sep 2023 09:39:31 -0400 Subject: [PATCH 081/134] Bump cloudbuild for chef to double the time (10h now) since a lot of examples were added and 5h seems to timeout. This may be a temporary fix until we determine what we really want to build (#29207) --- integrations/cloudbuild/chef.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index eeb87bd3821b17..be2f9e2dd1daeb 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -72,7 +72,7 @@ steps: logsBucket: matter-build-automation-build-logs # Global timeout for all steps -timeout: 18000s +timeout: 36000s queueTtl: 21600s artifacts: From af635a62c9b62f5382abc77813081bc41d989418 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 13 Sep 2023 12:07:38 -0400 Subject: [PATCH 082/134] Don't mark session defunct on response timeout if the message was acked. (#29173) * Don't mark session defunct on response timeout if the message was acked. If we got an ack, the session is fine and there is no reason to mark it defunct. Fixes https://github.com/project-chip/connectedhomeip/issues/29165 * Address review comment. --- src/messaging/ExchangeContext.cpp | 13 ++++++++++--- src/messaging/ReliableMessageMgr.cpp | 16 +++++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index 9d1e7ca06fce23..8c085025456ba8 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -500,11 +500,18 @@ void ExchangeContext::NotifyResponseTimeout(bool aCloseIfNeeded) // evicted. if (mSession) { - if (mSession->IsSecureSession() && mSession->AsSecureSession()->IsCASESession()) + // If we timed out _after_ getting an ack for the message, that means + // the session is probably fine (since our message and the ack got + // through), so don't mark the session defunct unless we have an + // un-acked message here. + if (IsMessageNotAcked()) { - mSession->AsSecureSession()->MarkAsDefunct(); + if (mSession->IsSecureSession() && mSession->AsSecureSession()->IsCASESession()) + { + mSession->AsSecureSession()->MarkAsDefunct(); + } + mSession->DispatchSessionEvent(&SessionDelegate::OnSessionHang); } - mSession->DispatchSessionEvent(&SessionDelegate::OnSessionHang); } ExchangeDelegate * delegate = GetDelegate(); diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index 5dc397a39b9ad8..68818585df3075 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -131,19 +131,22 @@ void ReliableMessageMgr::ExecuteActions() if (sendCount == CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS) { + // Make sure our exchange stays alive until we are done working with it. + ExchangeHandle ec(entry->ec); + ChipLogError(ExchangeManager, "Failed to Send CHIP MessageCounter:" ChipLogFormatMessageCounter " on exchange " ChipLogFormatExchange " sendCount: %u max retries: %d", - messageCounter, ChipLogValueExchange(&entry->ec.Get()), sendCount, CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS); + messageCounter, ChipLogValueExchange(&ec.Get()), sendCount, CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS); // Don't check whether the session in the exchange is valid, because when the session is released, the retrans entry is // cleared inside ExchangeContext::OnSessionReleased, so the session must be valid if the entry exists. - SessionHandle session = entry->ec->GetSessionHandle(); + SessionHandle session = ec->GetSessionHandle(); // If the exchange is expecting a response, it will handle sending // this notification once it detects that it has not gotten a // response. Otherwise, we need to do it. - if (!entry->ec->IsResponseExpected()) + if (!ec->IsResponseExpected()) { if (session->IsSecureSession() && session->AsSecureSession()->IsCASESession()) { @@ -154,6 +157,13 @@ void ReliableMessageMgr::ExecuteActions() // Do not StartTimer, we will schedule the timer at the end of the timer handler. mRetransTable.ReleaseObject(entry); + + // Dropping our entry marked the exchange as not having an un-acked + // message... but of course it _does_ have an un-acked message and + // we have just given up on waiting for the ack. + + ec->GetReliableMessageContext()->SetMessageNotAcked(true); + return Loop::Continue; } From 1d6ba7fac1f041e785d1da84e72427e26d97bd5f Mon Sep 17 00:00:00 2001 From: Petru Lauric <81822411+plauric@users.noreply.github.com> Date: Wed, 13 Sep 2023 16:12:16 -0400 Subject: [PATCH 083/134] RVC app - add Python build wrapper support (#29210) * add Python build wrapper for RVC app * add rvc to list of all targets --- scripts/build/build/targets.py | 1 + scripts/build/builders/host.py | 6 ++++++ scripts/build/testdata/all_targets_linux_x64.txt | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 0414a7e820fce7..92d2eefd54f568 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -132,6 +132,7 @@ def BuildHostTarget(): TargetPart('contact-sensor', app=HostApp.CONTACT_SENSOR), TargetPart('dishwasher', app=HostApp.DISHWASHER), TargetPart('refrigerator', app=HostApp.REFRIGERATOR), + TargetPart('rvc', app=HostApp.RVC), ] if (HostBoard.NATIVE.PlatformName() == 'darwin'): diff --git a/scripts/build/builders/host.py b/scripts/build/builders/host.py index 4666e2d8e0b97a..01a9e771136032 100644 --- a/scripts/build/builders/host.py +++ b/scripts/build/builders/host.py @@ -70,6 +70,7 @@ class HostApp(Enum): CONTACT_SENSOR = auto() DISHWASHER = auto() REFRIGERATOR = auto() + RVC = auto() def ExamplePath(self): if self == HostApp.ALL_CLUSTERS: @@ -118,6 +119,8 @@ def ExamplePath(self): return 'dishwasher-app/linux' elif self == HostApp.REFRIGERATOR: return 'refrigerator-app/linux' + elif self == HostApp.RVC: + return 'rvc-app/linux' else: raise Exception('Unknown app type: %r' % self) @@ -203,6 +206,9 @@ def OutputNames(self): elif self == HostApp.REFRIGERATOR: yield 'refrigerator-app' yield 'refrigerator-app.map' + elif self == HostApp.RVC: + yield 'rvc-app' + yield 'rvc-app.map' else: raise Exception('Unknown app type: %r' % self) diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 7e945289bcb21c..27cf157e4d6050 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -10,7 +10,7 @@ efr32-{brd4161a,brd4187c,brd4186c,brd4163a,brd4164a,brd4166a,brd4170a,brd4186a,b esp32-{m5stack,c3devkit,devkitc,qemu}-{all-clusters,all-clusters-minimal,ota-provider,ota-requestor,shell,light,lock,bridge,temperature-measurement,ota-requestor,tests}[-rpc][-ipv6only] genio-lighting-app linux-fake-tests[-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang] -linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,refrigerator}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] +linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,thermostat,java-matter-controller,minmdns,light,lock,shell,ota-provider,ota-requestor,simulated-app1,simulated-app2,python-bindings,tv-app,tv-casting-app,bridge,tests,chip-cert,address-resolve-tool,contact-sensor,dishwasher,refrigerator,rvc}[-nodeps][-platform-mdns][-minmdns-verbose][-libnl][-same-event-loop][-no-interactive][-ipv6only][-no-ble][-no-wifi][-no-thread][-mbedtls][-boringssl][-asan][-tsan][-ubsan][-libfuzzer][-ossfuzz][-coverage][-dmalloc][-clang][-test][-rpc][-with-ui] linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage] From b06c94fd129093f07ebca173a517307013a9d6fd Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 13 Sep 2023 17:13:55 -0400 Subject: [PATCH 084/134] Fix MATTER_TRACING_ENABLED checks. (#29219) We were checking MATTTER_TRACING_ENABLED without including the config header that defines it. Fixes https://github.com/project-chip/connectedhomeip/issues/29214 --- src/tracing/registry.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tracing/registry.h b/src/tracing/registry.h index 57eb2a4e1feea1..853372585840fa 100644 --- a/src/tracing/registry.h +++ b/src/tracing/registry.h @@ -16,6 +16,7 @@ */ #pragma once +#include #include namespace chip { From 3e9de93daa094125c5ef0b3a44662cc5d73a4380 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 13 Sep 2023 17:14:34 -0400 Subject: [PATCH 085/134] Update ZAP to tip. (#29202) This lets us significantly simplify the EventList availability annotations. --- scripts/setup/zap.json | 4 +- scripts/setup/zap.version | 2 +- scripts/tools/zap/zap_execution.py | 2 +- .../CHIP/templates/availability.yaml | 144 ++---------------- 4 files changed, 14 insertions(+), 138 deletions(-) diff --git a/scripts/setup/zap.json b/scripts/setup/zap.json index 3b1253b9ee0045..fa023750befecb 100644 --- a/scripts/setup/zap.json +++ b/scripts/setup/zap.json @@ -8,13 +8,13 @@ "mac-amd64", "windows-amd64" ], - "tags": ["version:2@v2023.09.05-nightly.1"] + "tags": ["version:2@v2023.09.12-nightly.1"] }, { "_comment": "Always get the amd64 version on mac until usable arm64 zap build is available", "path": "fuchsia/third_party/zap/mac-amd64", "platforms": ["mac-arm64"], - "tags": ["version:2@v2023.09.05-nightly.1"] + "tags": ["version:2@v2023.09.12-nightly.1"] } ] } diff --git a/scripts/setup/zap.version b/scripts/setup/zap.version index f3a4acca4e93d2..e7a99e1e5fc86c 100644 --- a/scripts/setup/zap.version +++ b/scripts/setup/zap.version @@ -1 +1 @@ -v2023.09.05-nightly +v2023.09.12-nightly diff --git a/scripts/tools/zap/zap_execution.py b/scripts/tools/zap/zap_execution.py index bd5f609d4164d5..8e14d6fe932c7d 100644 --- a/scripts/tools/zap/zap_execution.py +++ b/scripts/tools/zap/zap_execution.py @@ -23,7 +23,7 @@ # Use scripts/tools/zap/version_update.py to manage ZAP versioning as many # files may need updating for versions # -MIN_ZAP_VERSION = '2023.9.5' +MIN_ZAP_VERSION = '2023.9.12' class ZapTool: diff --git a/src/darwin/Framework/CHIP/templates/availability.yaml b/src/darwin/Framework/CHIP/templates/availability.yaml index 6406a6a666a9e7..c8f0a6b4767829 100644 --- a/src/darwin/Framework/CHIP/templates/availability.yaml +++ b/src/darwin/Framework/CHIP/templates/availability.yaml @@ -7402,146 +7402,13 @@ - DishwasherAlarm - SampleMEI attributes: - # EventList generally not stable yet. Scenes: - - EventList # New scenes bits not stable yet. - SceneTableSize - RemainingCapacity - OnOff: - - EventList - OnOffSwitchConfiguration: - - EventList - LevelControl: - - EventList - BinaryInputBasic: - - EventList - PulseWidthModulation: - - EventList - Descriptor: - - EventList - Binding: - - EventList - Identify: - - EventList - AccessControl: - - EventList - Actions: - - EventList - OTASoftwareUpdateProvider: - - EventList - OTASoftwareUpdateRequestor: - - EventList - LocalizationConfiguration: - - EventList - TimeFormatLocalization: - - EventList - UnitLocalization: - - EventList - PowerSourceConfiguration: - - EventList - PowerSource: - - EventList - GeneralCommissioning: - - EventList - NetworkCommissioning: - - EventList - DiagnosticLogs: - - EventList - GeneralDiagnostics: - - EventList - SoftwareDiagnostics: - - EventList - ThreadNetworkDiagnostics: - - EventList - WiFiNetworkDiagnostics: - - EventList - EthernetNetworkDiagnostics: - - EventList - TimeSynchronization: - - EventList - Switch: - - EventList - AdministratorCommissioning: - - EventList - OperationalCredentials: - - EventList - GroupKeyManagement: - - EventList - FixedLabel: - - EventList - UserLabel: - - EventList - BooleanState: - - EventList - ModeSelect: - - EventList - DoorLock: - - EventList - WindowCovering: - - EventList - BarrierControl: - - EventList - PumpConfigurationAndControl: - - EventList FanControl: - - EventList # New Fan Control bits not stable yet. - AirflowDirection - ThermostatUserInterfaceConfiguration: - - EventList - ColorControl: - - EventList - BallastConfiguration: - - EventList - IlluminanceMeasurement: - - EventList - TemperatureMeasurement: - - EventList - PressureMeasurement: - - EventList - Thermostat: - - EventList - FlowMeasurement: - - EventList - RelativeHumidityMeasurement: - - EventList - OccupancySensing: - - EventList - WakeOnLAN: - - EventList - Channel: - - EventList - Groups: - - EventList - TargetNavigator: - - EventList - MediaPlayback: - - EventList - MediaInput: - - EventList - LowPower: - - EventList - KeypadInput: - - EventList - ContentLauncher: - - EventList - AudioOutput: - - EventList - ApplicationLauncher: - - EventList - ApplicationBasic: - - EventList - AccountLogin: - - EventList - ElectricalMeasurement: - - EventList - UnitTesting: - - EventList - BasicInformation: - - EventList - BridgedDeviceBasicInformation: - - EventList commands: FanControl: # Not stable yet @@ -7592,7 +7459,7 @@ - AirflowDirection global attributes: - EventList - # Once we actually unmark TimeSynchronization as provisional, all these bits should go away too, and we should instead + # Once we actually unmark TimeSynchronization as provisional, all these bits except EventList should go away too, and we should instead # mark things as introduced/deprecated as needed. The "ids" entries should go away, in particular. ids: attributes: @@ -7600,6 +7467,15 @@ - TimeZoneListMaxSize - DSTOffsetListMaxSize - SupportsDNSResolve + # Because we are special-casing ids for TimeSynchronization + # above, we need to explicitly mark the EventList id + # provisional. + - EventList + PulseWidthModulation: + # Because we are special-casing ids for PulseWidthModulation + # above, we need to explicitly mark the EventList id + # provisional. + - EventList commands: TimeSynchronization: - SetUTCTime From 9d2646ba16a10099d715944c52e973813beb466e Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Wed, 13 Sep 2023 23:15:15 +0100 Subject: [PATCH 086/134] IPAddress: Fix zero-initialization of ip6_addr_t (#29167) C-style zero init produces compiler warnings, use C++-style zero init. --- src/inet/IPAddress.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inet/IPAddress.cpp b/src/inet/IPAddress.cpp index 3546df5acb0657..66ff7486846a7d 100644 --- a/src/inet/IPAddress.cpp +++ b/src/inet/IPAddress.cpp @@ -194,7 +194,7 @@ lwip_ip_addr_type IPAddress::ToLwIPAddrType(IPAddressType typ) ip6_addr_t IPAddress::ToIPv6() const { - ip6_addr_t ipAddr = { 0 }; + ip6_addr_t ipAddr = {}; static_assert(sizeof(ipAddr.addr) == sizeof(Addr), "ip6_addr_t size mismatch"); memcpy(&ipAddr.addr, Addr, sizeof(ipAddr.addr)); return ipAddr; From 511aafbf54ee8ea7ad7701df1ef5192ce05a64cf Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 13 Sep 2023 18:38:46 -0400 Subject: [PATCH 087/134] Make sure CHIP_CONFIG_DARWIN_STORAGE_VERBOSE_LOGGING is always defined. (#29225) Possibly as 0. --- src/platform/Darwin/KeyValueStoreManagerImpl.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/platform/Darwin/KeyValueStoreManagerImpl.mm b/src/platform/Darwin/KeyValueStoreManagerImpl.mm index 402a81363f853f..f2c311c69f3493 100644 --- a/src/platform/Darwin/KeyValueStoreManagerImpl.mm +++ b/src/platform/Darwin/KeyValueStoreManagerImpl.mm @@ -34,6 +34,10 @@ #import #import +#ifndef CHIP_CONFIG_DARWIN_STORAGE_VERBOSE_LOGGING +#define CHIP_CONFIG_DARWIN_STORAGE_VERBOSE_LOGGING 0 +#endif // CHIP_CONFIG_DARWIN_STORAGE_VERBOSE_LOGGING + @interface KeyValueItem : NSManagedObject @property (nonatomic, retain) NSString * key; From 9ebd18a900bfdf78d07841cd6df40e926e1701da Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:58:20 +1200 Subject: [PATCH 088/134] Make test vectors ByteSpans (#29200) This gets rid off some boilerplate compared to separate array and length symbols. --- .../tests/CHIPCert_test_vectors.cpp | 634 ++++++------------ src/credentials/tests/CHIPCert_test_vectors.h | 343 ++++------ src/credentials/tests/TestChipCert.cpp | 12 +- src/credentials/tests/TestFabricTable.cpp | 67 +- src/crypto/tests/CHIPCryptoPALTest.cpp | 2 +- .../secure_channel/tests/TestCASESession.cpp | 30 +- 6 files changed, 388 insertions(+), 700 deletions(-) diff --git a/src/credentials/tests/CHIPCert_test_vectors.cpp b/src/credentials/tests/CHIPCert_test_vectors.cpp index 314c13e6f8063e..9a21d934f52ec5 100644 --- a/src/credentials/tests/CHIPCert_test_vectors.cpp +++ b/src/credentials/tests/CHIPCert_test_vectors.cpp @@ -65,14 +65,7 @@ CHIP_ERROR GetTestCert(uint8_t certType, BitFlags certLoadFla { \ if (certType == TestCert::k##NAME) \ { \ - if (derForm) \ - { \ - cert = ByteSpan(sTestCert_##NAME##_DER, sTestCert_##NAME##_DER_Len); \ - } \ - else \ - { \ - cert = ByteSpan(sTestCert_##NAME##_Chip, sTestCert_##NAME##_Chip_Len); \ - } \ + cert = (derForm) ? sTestCert_##NAME##_DER : sTestCert_##NAME##_Chip; \ ExitNow(err = CHIP_NO_ERROR); \ } \ } while (0) @@ -113,7 +106,6 @@ const char * GetTestCertName(uint8_t certType) return #NAME; \ } \ } while (0) - NAME_CERT(Root01); NAME_CERT(Root02); NAME_CERT(Root03); @@ -146,7 +138,7 @@ CHIP_ERROR GetTestCertPubkey(uint8_t certType, ByteSpan & pubkey) { \ if (certType == TestCert::k##NAME) \ { \ - pubkey = ByteSpan(sTestCert_##NAME##_PublicKey, sTestCert_##NAME##_PublicKey_Len); \ + pubkey = sTestCert_##NAME##_PublicKey; \ ExitNow(err = CHIP_NO_ERROR); \ } \ } while (0) @@ -186,7 +178,7 @@ CHIP_ERROR GetTestCertSKID(uint8_t certType, ByteSpan & skid) { \ if (certType == TestCert::k##NAME) \ { \ - skid = ByteSpan(sTestCert_##NAME##_SubjectKeyId, sTestCert_##NAME##_SubjectKeyId_Len); \ + skid = sTestCert_##NAME##_SubjectKeyId; \ ExitNow(err = CHIP_NO_ERROR); \ } \ } while (0) @@ -226,7 +218,7 @@ CHIP_ERROR GetTestCertAKID(uint8_t certType, ByteSpan & akid) { \ if (certType == TestCert::k##NAME) \ { \ - akid = ByteSpan(sTestCert_##NAME##_AuthorityKeyId, sTestCert_##NAME##_AuthorityKeyId_Len); \ + akid = sTestCert_##NAME##_AuthorityKeyId; \ ExitNow(err = CHIP_NO_ERROR); \ } \ } while (0) @@ -358,7 +350,7 @@ NH9fh9CMMhPlQK8RurkTfkk1TwxbY0PeYw== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Root01_Chip[] = { +extern constexpr ByteSpan sTestCert_Root01_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x53, 0x4c, 0x45, 0x82, 0x73, 0x62, 0x35, 0x14, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -371,11 +363,9 @@ extern const uint8_t sTestCert_Root01_Chip[] = { 0x09, 0x26, 0x90, 0x49, 0x4e, 0x46, 0xc8, 0xb1, 0xc5, 0xcb, 0xd1, 0xa5, 0x08, 0x5e, 0x1e, 0x65, 0xd4, 0x36, 0x0f, 0x98, 0xe9, 0x6c, 0x4e, 0x8e, 0x49, 0x5d, 0xc5, 0xe2, 0x16, 0xd0, 0xbf, 0xa2, 0x3d, 0x8f, 0x57, 0x47, 0x0d, 0x89, 0xfd, 0xda, 0xf0, 0x3f, 0x04, 0x64, 0xb0, 0xae, 0x8e, 0x1f, 0x95, 0x6d, 0x6f, 0x67, 0xa3, 0x11, 0x24, 0x38, 0x58, 0x24, 0x68, 0x97, 0x80, 0xa9, 0x18, -}; +}); -extern const size_t sTestCert_Root01_Chip_Len = sizeof(sTestCert_Root01_Chip); - -extern const uint8_t sTestCert_Root01_DER[] = { +extern constexpr ByteSpan sTestCert_Root01_DER((const uint8_t[]){ 0x30, 0x82, 0x01, 0x9e, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x53, 0x4c, 0x45, 0x82, 0x73, 0x62, 0x35, 0x14, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -396,37 +386,27 @@ extern const uint8_t sTestCert_Root01_DER[] = { 0x4e, 0x46, 0xc8, 0xb1, 0xc5, 0xcb, 0xd1, 0xa5, 0x08, 0x5e, 0x1e, 0x65, 0xd4, 0x36, 0x0f, 0x98, 0xe9, 0x6c, 0x4e, 0x8e, 0x49, 0x5d, 0xc5, 0xe2, 0x16, 0xd0, 0x02, 0x21, 0x00, 0xbf, 0xa2, 0x3d, 0x8f, 0x57, 0x47, 0x0d, 0x89, 0xfd, 0xda, 0xf0, 0x3f, 0x04, 0x64, 0xb0, 0xae, 0x8e, 0x1f, 0x95, 0x6d, 0x6f, 0x67, 0xa3, 0x11, 0x24, 0x38, 0x58, 0x24, 0x68, 0x97, 0x80, 0xa9, -}; +}); -extern const size_t sTestCert_Root01_DER_Len = sizeof(sTestCert_Root01_DER); - -extern const uint8_t sTestCert_Root01_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Root01_PublicKey((const uint8_t[]){ 0x04, 0x3b, 0x88, 0x46, 0x0e, 0xc9, 0x68, 0x7a, 0x5d, 0x0f, 0x3b, 0x4b, 0x3b, 0x13, 0xfc, 0xd2, 0x99, 0xc2, 0xf6, 0xd5, 0x05, 0x1d, 0x00, 0x3e, 0xe4, 0x9c, 0x99, 0x24, 0xcf, 0x98, 0xf4, 0xf7, 0x80, 0xeb, 0x20, 0xfd, 0x37, 0xc8, 0xd3, 0x58, 0x34, 0x7f, 0x5f, 0x87, 0xd0, 0x8c, 0x32, 0x13, 0xe5, 0x40, 0xaf, 0x11, 0xba, 0xb9, 0x13, 0x7e, 0x49, 0x35, 0x4f, 0x0c, 0x5b, 0x63, 0x43, 0xde, 0x63, -}; - -extern const size_t sTestCert_Root01_PublicKey_Len = sizeof(sTestCert_Root01_PublicKey); +}); -extern const uint8_t sTestCert_Root01_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Root01_PrivateKey((const uint8_t[]){ 0xfc, 0xdd, 0xfd, 0x91, 0x12, 0xb3, 0x0d, 0x24, 0x0f, 0x6a, 0xe6, 0xde, 0x27, 0xa2, 0x02, 0x9e, 0x7b, 0xb6, 0xe7, 0x43, 0x77, 0xe3, 0xb7, 0x97, 0x5d, 0x76, 0xd2, 0x3d, 0xe3, 0xc3, 0x68, 0x14, -}; - -extern const size_t sTestCert_Root01_PrivateKey_Len = sizeof(sTestCert_Root01_PrivateKey); +}); -extern const uint8_t sTestCert_Root01_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Root01_SubjectKeyId((const uint8_t[]){ 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, -}; +}); -extern const size_t sTestCert_Root01_SubjectKeyId_Len = sizeof(sTestCert_Root01_SubjectKeyId); - -extern const uint8_t sTestCert_Root01_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Root01_AuthorityKeyId((const uint8_t[]){ 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, -}; - -extern const size_t sTestCert_Root01_AuthorityKeyId_Len = sizeof(sTestCert_Root01_AuthorityKeyId); +}); /************** Test Root02 Certificate ************** Certificate: @@ -487,7 +467,7 @@ vKhW5Mx6jt6R4Kcz4WfAQWemwsn6SPFPCw== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Root02_Chip[] = { +extern constexpr ByteSpan sTestCert_Root02_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x60, 0x0d, 0x2d, 0x65, 0x4a, 0xc8, 0xa0, 0x98, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, @@ -502,11 +482,9 @@ extern const uint8_t sTestCert_Root02_Chip[] = { 0x10, 0xf7, 0x2a, 0x7a, 0xb1, 0x5a, 0x91, 0x60, 0xb7, 0xf0, 0x38, 0x6c, 0xe8, 0x19, 0x36, 0xd1, 0x5a, 0xcd, 0x19, 0xc8, 0xc0, 0x4a, 0xd1, 0x9d, 0x3e, 0xb5, 0xc7, 0xea, 0xf1, 0xa5, 0xcb, 0x06, 0x43, 0xbb, 0x67, 0x68, 0x54, 0x02, 0xe2, 0xff, 0x1e, 0x65, 0x80, 0xbc, 0xc5, 0x2c, 0x2b, 0x03, 0xa3, 0xb6, 0xa4, 0x92, 0x00, 0x5e, 0x18, -}; - -extern const size_t sTestCert_Root02_Chip_Len = sizeof(sTestCert_Root02_Chip); +}); -extern const uint8_t sTestCert_Root02_DER[] = { +extern constexpr ByteSpan sTestCert_Root02_DER((const uint8_t[]){ 0x30, 0x82, 0x01, 0xe5, 0x30, 0x82, 0x01, 0x8a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x60, 0x0d, 0x2d, 0x65, 0x4a, 0xc8, 0xa0, 0x98, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -531,37 +509,27 @@ extern const uint8_t sTestCert_Root02_DER[] = { 0xf0, 0x38, 0x6c, 0xe8, 0x19, 0x36, 0xd1, 0x5a, 0xcd, 0x19, 0xc8, 0xc0, 0x4a, 0x02, 0x21, 0x00, 0xd1, 0x9d, 0x3e, 0xb5, 0xc7, 0xea, 0xf1, 0xa5, 0xcb, 0x06, 0x43, 0xbb, 0x67, 0x68, 0x54, 0x02, 0xe2, 0xff, 0x1e, 0x65, 0x80, 0xbc, 0xc5, 0x2c, 0x2b, 0x03, 0xa3, 0xb6, 0xa4, 0x92, 0x00, 0x5e, -}; - -extern const size_t sTestCert_Root02_DER_Len = sizeof(sTestCert_Root02_DER); +}); -extern const uint8_t sTestCert_Root02_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Root02_PublicKey((const uint8_t[]){ 0x04, 0x27, 0x50, 0x0b, 0x20, 0x60, 0x52, 0xce, 0x33, 0x77, 0x6c, 0x63, 0x08, 0x3f, 0x1c, 0xf1, 0x03, 0x6e, 0xa4, 0xcc, 0x7f, 0xfd, 0x61, 0x7c, 0x17, 0x6d, 0x4c, 0xad, 0xf5, 0x51, 0xbb, 0xb4, 0xb0, 0xd9, 0x97, 0xca, 0xe5, 0x55, 0xdb, 0xf9, 0xbc, 0xa8, 0x56, 0xe4, 0xcc, 0x7a, 0x8e, 0xde, 0x91, 0xe0, 0xa7, 0x33, 0xe1, 0x67, 0xc0, 0x41, 0x67, 0xa6, 0xc2, 0xc9, 0xfa, 0x48, 0xf1, 0x4f, 0x0b, -}; - -extern const size_t sTestCert_Root02_PublicKey_Len = sizeof(sTestCert_Root02_PublicKey); +}); -extern const uint8_t sTestCert_Root02_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Root02_PrivateKey((const uint8_t[]){ 0xf9, 0xb7, 0x22, 0x87, 0xd6, 0xa4, 0x8d, 0xd5, 0x10, 0x93, 0xc4, 0x12, 0xe6, 0x1b, 0x43, 0xaf, 0xe1, 0x22, 0x15, 0x28, 0x96, 0x71, 0xbf, 0x33, 0x96, 0xff, 0x97, 0xf6, 0xb6, 0x21, 0xb2, 0xac, -}; +}); -extern const size_t sTestCert_Root02_PrivateKey_Len = sizeof(sTestCert_Root02_PrivateKey); - -extern const uint8_t sTestCert_Root02_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Root02_SubjectKeyId((const uint8_t[]){ 0x62, 0xBE, 0xB9, 0x67, 0x1C, 0x91, 0xC3, 0x55, 0xC8, 0x6F, 0x06, 0xFA, 0x6C, 0x08, 0x80, 0x14, 0x51, 0xE1, 0xA0, 0xEA, -}; - -extern const size_t sTestCert_Root02_SubjectKeyId_Len = sizeof(sTestCert_Root02_SubjectKeyId); +}); -extern const uint8_t sTestCert_Root02_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Root02_AuthorityKeyId((const uint8_t[]){ 0x62, 0xBE, 0xB9, 0x67, 0x1C, 0x91, 0xC3, 0x55, 0xC8, 0x6F, 0x06, 0xFA, 0x6C, 0x08, 0x80, 0x14, 0x51, 0xE1, 0xA0, 0xEA, -}; - -extern const size_t sTestCert_Root02_AuthorityKeyId_Len = sizeof(sTestCert_Root02_AuthorityKeyId); +}); /************** Test Root03 Certificate ************** Certificate: @@ -622,7 +590,7 @@ NhzYKeVf3WPM9XntROAiCLT4JfzW8GgsAg== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Root03_Chip[] = { +extern constexpr ByteSpan sTestCert_Root03_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x6b, 0x78, 0x7a, 0x6d, 0xfc, 0xd4, 0xbf, 0x81, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x24, 0x05, 0x00, 0x37, 0x06, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, @@ -636,11 +604,9 @@ extern const uint8_t sTestCert_Root03_Chip[] = { 0xeb, 0x35, 0x45, 0xb9, 0x97, 0x86, 0x46, 0x67, 0x99, 0xeb, 0xea, 0x40, 0x51, 0xa3, 0x41, 0xaf, 0x2a, 0x9b, 0x67, 0x7f, 0xd7, 0x1b, 0x4c, 0x3d, 0x4e, 0x68, 0x09, 0x3b, 0x66, 0x5f, 0x28, 0x42, 0xcb, 0x7e, 0xd3, 0x19, 0x9c, 0x9a, 0xd7, 0xc9, 0x62, 0x79, 0x47, 0xa1, 0x8a, 0x92, 0x16, 0x8a, 0xfc, 0xd6, 0x5f, 0x3e, 0x9c, 0xaf, 0x6e, 0xed, 0xfa, 0x9e, 0x60, 0xc5, 0x2f, 0x18, -}; +}); -extern const size_t sTestCert_Root03_Chip_Len = sizeof(sTestCert_Root03_Chip); - -extern const uint8_t sTestCert_Root03_DER[] = { +extern constexpr ByteSpan sTestCert_Root03_DER((const uint8_t[]){ 0x30, 0x82, 0x01, 0xe5, 0x30, 0x82, 0x01, 0x8c, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x6b, 0x78, 0x7a, 0x6d, 0xfc, 0xd4, 0xbf, 0x81, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -665,37 +631,27 @@ extern const uint8_t sTestCert_Root03_DER[] = { 0xaf, 0x2a, 0x9b, 0x67, 0x7f, 0xd7, 0x1b, 0x4c, 0x3d, 0x4e, 0x68, 0x09, 0x3b, 0x66, 0x02, 0x20, 0x5f, 0x28, 0x42, 0xcb, 0x7e, 0xd3, 0x19, 0x9c, 0x9a, 0xd7, 0xc9, 0x62, 0x79, 0x47, 0xa1, 0x8a, 0x92, 0x16, 0x8a, 0xfc, 0xd6, 0x5f, 0x3e, 0x9c, 0xaf, 0x6e, 0xed, 0xfa, 0x9e, 0x60, 0xc5, 0x2f, -}; +}); -extern const size_t sTestCert_Root03_DER_Len = sizeof(sTestCert_Root03_DER); - -extern const uint8_t sTestCert_Root03_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Root03_PublicKey((const uint8_t[]){ 0x04, 0x71, 0x05, 0x40, 0x8a, 0x85, 0xa9, 0xd9, 0xa0, 0x8a, 0xf8, 0xb7, 0x70, 0x77, 0xdb, 0x38, 0x8b, 0x7e, 0xa4, 0x38, 0x97, 0xdc, 0xdf, 0xd3, 0x16, 0xf2, 0x4f, 0x0a, 0x7e, 0x71, 0xde, 0x69, 0xa5, 0x0c, 0x44, 0x55, 0x0c, 0x0c, 0x9d, 0xa2, 0x36, 0x1c, 0xd8, 0x29, 0xe5, 0x5f, 0xdd, 0x63, 0xcc, 0xf5, 0x79, 0xed, 0x44, 0xe0, 0x22, 0x08, 0xb4, 0xf8, 0x25, 0xfc, 0xd6, 0xf0, 0x68, 0x2c, 0x02, -}; +}); -extern const size_t sTestCert_Root03_PublicKey_Len = sizeof(sTestCert_Root03_PublicKey); - -extern const uint8_t sTestCert_Root03_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Root03_PrivateKey((const uint8_t[]){ 0x70, 0xe7, 0x6d, 0x00, 0x29, 0x28, 0x81, 0xe4, 0xb5, 0xa5, 0xbc, 0xb4, 0xec, 0xd0, 0x2f, 0xf5, 0xe4, 0x75, 0xbc, 0x14, 0x89, 0xde, 0x6e, 0xc3, 0xe8, 0xd6, 0x3c, 0x5a, 0x3f, 0x2e, 0x5a, 0x87, -}; - -extern const size_t sTestCert_Root03_PrivateKey_Len = sizeof(sTestCert_Root03_PrivateKey); +}); -extern const uint8_t sTestCert_Root03_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Root03_SubjectKeyId((const uint8_t[]){ 0xFF, 0x87, 0xF3, 0xCD, 0xD2, 0x06, 0x9A, 0xEF, 0x8D, 0x5D, 0x32, 0xEB, 0xA3, 0x16, 0x3B, 0x9E, 0xB0, 0x0A, 0x00, 0x29, -}; - -extern const size_t sTestCert_Root03_SubjectKeyId_Len = sizeof(sTestCert_Root03_SubjectKeyId); +}); -extern const uint8_t sTestCert_Root03_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Root03_AuthorityKeyId((const uint8_t[]){ 0xFF, 0x87, 0xF3, 0xCD, 0xD2, 0x06, 0x9A, 0xEF, 0x8D, 0x5D, 0x32, 0xEB, 0xA3, 0x16, 0x3B, 0x9E, 0xB0, 0x0A, 0x00, 0x29, -}; - -extern const size_t sTestCert_Root03_AuthorityKeyId_Len = sizeof(sTestCert_Root03_AuthorityKeyId); +}); /************** Test ICA01 Certificate ************** Certificate: @@ -754,7 +710,7 @@ AwEHoUQDQgAEX5T1fgsTyc/Plt/h/OeIjVZMwgnFXEUI5E3PFrouCWYvnuzxn0Cw -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_ICA01_Chip[] = { +extern constexpr ByteSpan sTestCert_ICA01_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x69, 0xd8, 0x6a, 0x8d, 0x80, 0xfc, 0x8f, 0x5d, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -767,11 +723,9 @@ extern const uint8_t sTestCert_ICA01_Chip[] = { 0x5b, 0x5d, 0x68, 0xcb, 0xfd, 0x36, 0x14, 0x0d, 0x8c, 0x9d, 0x12, 0x90, 0x14, 0xc4, 0x5f, 0xa7, 0xca, 0x19, 0x1f, 0x34, 0xd9, 0xaf, 0x24, 0x1d, 0xb7, 0x17, 0x36, 0xe6, 0x0f, 0x44, 0x19, 0x9b, 0xc0, 0x7c, 0x7f, 0x79, 0x5b, 0xed, 0x81, 0xa2, 0xe7, 0x7d, 0xc5, 0x34, 0x25, 0x76, 0xf6, 0xa0, 0xd1, 0x41, 0x98, 0xf4, 0x6b, 0x91, 0x07, 0x49, 0x42, 0x7c, 0x2e, 0xed, 0x65, 0x9c, 0x18, -}; - -extern const size_t sTestCert_ICA01_Chip_Len = sizeof(sTestCert_ICA01_Chip); +}); -extern const uint8_t sTestCert_ICA01_DER[] = { +extern constexpr ByteSpan sTestCert_ICA01_DER((const uint8_t[]){ 0x30, 0x82, 0x01, 0x9d, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x69, 0xd8, 0x6a, 0x8d, 0x80, 0xfc, 0x8f, 0x5d, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -792,37 +746,27 @@ extern const uint8_t sTestCert_ICA01_DER[] = { 0xfd, 0x36, 0x14, 0x0d, 0x8c, 0x9d, 0x12, 0x90, 0x14, 0xc4, 0x5f, 0xa7, 0xca, 0x19, 0x1f, 0x34, 0xd9, 0xaf, 0x24, 0x1d, 0xb7, 0x17, 0x36, 0xe6, 0x0f, 0x44, 0x02, 0x20, 0x19, 0x9b, 0xc0, 0x7c, 0x7f, 0x79, 0x5b, 0xed, 0x81, 0xa2, 0xe7, 0x7d, 0xc5, 0x34, 0x25, 0x76, 0xf6, 0xa0, 0xd1, 0x41, 0x98, 0xf4, 0x6b, 0x91, 0x07, 0x49, 0x42, 0x7c, 0x2e, 0xed, 0x65, 0x9c, -}; - -extern const size_t sTestCert_ICA01_DER_Len = sizeof(sTestCert_ICA01_DER); +}); -extern const uint8_t sTestCert_ICA01_PublicKey[] = { +extern constexpr ByteSpan sTestCert_ICA01_PublicKey((const uint8_t[]){ 0x04, 0x5f, 0x94, 0xf5, 0x7e, 0x0b, 0x13, 0xc9, 0xcf, 0xcf, 0x96, 0xdf, 0xe1, 0xfc, 0xe7, 0x88, 0x8d, 0x56, 0x4c, 0xc2, 0x09, 0xc5, 0x5c, 0x45, 0x08, 0xe4, 0x4d, 0xcf, 0x16, 0xba, 0x2e, 0x09, 0x66, 0x2f, 0x9e, 0xec, 0xf1, 0x9f, 0x40, 0xb0, 0xe8, 0x8a, 0x0b, 0x28, 0x15, 0xda, 0x9e, 0xe1, 0x0a, 0x3a, 0x17, 0x7c, 0x25, 0x1f, 0x43, 0x4f, 0x5b, 0x0f, 0x26, 0x3c, 0xe7, 0xde, 0x62, 0x78, 0xc6, -}; - -extern const size_t sTestCert_ICA01_PublicKey_Len = sizeof(sTestCert_ICA01_PublicKey); +}); -extern const uint8_t sTestCert_ICA01_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_ICA01_PrivateKey((const uint8_t[]){ 0x9e, 0x16, 0xbd, 0x8a, 0x17, 0xb2, 0xf1, 0xc2, 0x14, 0x21, 0x0f, 0x51, 0x60, 0x7e, 0x97, 0x96, 0xcb, 0x59, 0x60, 0x41, 0x53, 0x57, 0xd3, 0x8a, 0xb8, 0x6c, 0xc4, 0xd5, 0x96, 0x21, 0x2e, 0x97, -}; - -extern const size_t sTestCert_ICA01_PrivateKey_Len = sizeof(sTestCert_ICA01_PrivateKey); +}); -extern const uint8_t sTestCert_ICA01_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_ICA01_SubjectKeyId((const uint8_t[]){ 0x44, 0x0C, 0xC6, 0x92, 0x31, 0xC4, 0xCB, 0x5B, 0x37, 0x94, 0x24, 0x26, 0xF8, 0x1B, 0xBE, 0x24, 0xB7, 0xEF, 0x34, 0x5C, -}; +}); -extern const size_t sTestCert_ICA01_SubjectKeyId_Len = sizeof(sTestCert_ICA01_SubjectKeyId); - -extern const uint8_t sTestCert_ICA01_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_ICA01_AuthorityKeyId((const uint8_t[]){ 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, -}; - -extern const size_t sTestCert_ICA01_AuthorityKeyId_Len = sizeof(sTestCert_ICA01_AuthorityKeyId); +}); /************** Test ICA02 Certificate ************** Certificate: @@ -883,7 +827,7 @@ dBd1fg57dnI02csD3HUompl0vj33YadWvg== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_ICA02_Chip[] = { +extern constexpr ByteSpan sTestCert_ICA02_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x1c, 0xc5, 0x8f, 0xbf, 0xee, 0x96, 0x45, 0x4a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x02, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, @@ -898,11 +842,9 @@ extern const uint8_t sTestCert_ICA02_Chip[] = { 0x20, 0x76, 0xeb, 0xe2, 0x4b, 0x5e, 0x79, 0xe2, 0xbb, 0x98, 0xf2, 0x14, 0xab, 0x6e, 0xe8, 0xf0, 0x43, 0x7c, 0x55, 0x7d, 0xe7, 0x43, 0xc7, 0x53, 0xda, 0xe7, 0xdd, 0xf3, 0xb0, 0x27, 0xc2, 0xf1, 0x3e, 0x23, 0xce, 0x3a, 0x3a, 0xb9, 0xd4, 0x34, 0xfc, 0x7e, 0xa1, 0x5b, 0xb9, 0xd6, 0x77, 0xc3, 0x6c, 0x9c, 0x8b, 0x55, 0x15, 0x42, 0x18, -}; - -extern const size_t sTestCert_ICA02_Chip_Len = sizeof(sTestCert_ICA02_Chip); +}); -extern const uint8_t sTestCert_ICA02_DER[] = { +extern constexpr ByteSpan sTestCert_ICA02_DER((const uint8_t[]){ 0x30, 0x82, 0x01, 0xe4, 0x30, 0x82, 0x01, 0x8a, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x1c, 0xc5, 0x8f, 0xbf, 0xee, 0x96, 0x45, 0x4a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -927,37 +869,27 @@ extern const uint8_t sTestCert_ICA02_DER[] = { 0xf2, 0x14, 0xab, 0x6e, 0xe8, 0xf0, 0x43, 0x7c, 0x55, 0x7d, 0xe7, 0x43, 0x02, 0x21, 0x00, 0xc7, 0x53, 0xda, 0xe7, 0xdd, 0xf3, 0xb0, 0x27, 0xc2, 0xf1, 0x3e, 0x23, 0xce, 0x3a, 0x3a, 0xb9, 0xd4, 0x34, 0xfc, 0x7e, 0xa1, 0x5b, 0xb9, 0xd6, 0x77, 0xc3, 0x6c, 0x9c, 0x8b, 0x55, 0x15, 0x42, -}; +}); -extern const size_t sTestCert_ICA02_DER_Len = sizeof(sTestCert_ICA02_DER); - -extern const uint8_t sTestCert_ICA02_PublicKey[] = { +extern constexpr ByteSpan sTestCert_ICA02_PublicKey((const uint8_t[]){ 0x04, 0xfa, 0x9f, 0xd2, 0x8c, 0xb7, 0x6a, 0x77, 0xef, 0x0e, 0x39, 0x30, 0xd5, 0x9e, 0x41, 0x2b, 0xd1, 0x8e, 0xb2, 0x0e, 0xff, 0xd5, 0x19, 0x7e, 0xf4, 0x71, 0x39, 0x37, 0x93, 0x90, 0x37, 0x8a, 0x48, 0x04, 0x32, 0x48, 0x18, 0x9c, 0xc4, 0xa9, 0x74, 0x17, 0x75, 0x7e, 0x0e, 0x7b, 0x76, 0x72, 0x34, 0xd9, 0xcb, 0x03, 0xdc, 0x75, 0x28, 0x9a, 0x99, 0x74, 0xbe, 0x3d, 0xf7, 0x61, 0xa7, 0x56, 0xbe, -}; +}); -extern const size_t sTestCert_ICA02_PublicKey_Len = sizeof(sTestCert_ICA02_PublicKey); - -extern const uint8_t sTestCert_ICA02_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_ICA02_PrivateKey((const uint8_t[]){ 0xba, 0x76, 0x7a, 0xd5, 0x59, 0xe3, 0x15, 0xfb, 0xa7, 0x01, 0x98, 0xdd, 0x8f, 0xc9, 0x76, 0x20, 0x83, 0x05, 0x94, 0xfa, 0x5e, 0xbb, 0x5a, 0xf0, 0x90, 0xf5, 0x8e, 0xff, 0x1b, 0x9d, 0x60, 0xa5, -}; +}); -extern const size_t sTestCert_ICA02_PrivateKey_Len = sizeof(sTestCert_ICA02_PrivateKey); - -extern const uint8_t sTestCert_ICA02_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_ICA02_SubjectKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, -}; - -extern const size_t sTestCert_ICA02_SubjectKeyId_Len = sizeof(sTestCert_ICA02_SubjectKeyId); +}); -extern const uint8_t sTestCert_ICA02_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_ICA02_AuthorityKeyId((const uint8_t[]){ 0x62, 0xBE, 0xB9, 0x67, 0x1C, 0x91, 0xC3, 0x55, 0xC8, 0x6F, 0x06, 0xFA, 0x6C, 0x08, 0x80, 0x14, 0x51, 0xE1, 0xA0, 0xEA, -}; - -extern const size_t sTestCert_ICA02_AuthorityKeyId_Len = sizeof(sTestCert_ICA02_AuthorityKeyId); +}); /************** Test ICA01_1 Certificate ************** Certificate: @@ -1016,7 +948,7 @@ fzs31dpp0M9gTEHElk+tLXBFaNa+jK/a7g== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_ICA01_1_Chip[] = { +extern constexpr ByteSpan sTestCert_ICA01_1_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x36, 0xed, 0x10, 0xc3, 0x95, 0x64, 0x59, 0x78, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x13, 0x05, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x24, 0x07, 0x01, 0x24, 0x08, 0x01, 0x30, 0x09, 0x41, 0x04, @@ -1029,11 +961,9 @@ extern const uint8_t sTestCert_ICA01_1_Chip[] = { 0x4d, 0x4b, 0x8e, 0xe1, 0x66, 0x9f, 0x49, 0x85, 0x97, 0x04, 0x83, 0xe4, 0x00, 0x00, 0x9e, 0xd0, 0x46, 0xb3, 0x4e, 0xdc, 0x11, 0x8a, 0xcd, 0xb4, 0xed, 0xea, 0xb6, 0x21, 0x71, 0xbe, 0x7e, 0x80, 0xd5, 0xc2, 0x98, 0x5d, 0x6c, 0x6a, 0xb2, 0x55, 0xc3, 0xc4, 0xad, 0x55, 0x4c, 0x72, 0x70, 0x04, 0x8c, 0x26, 0xd6, 0xe6, 0xd3, 0xe9, 0xc2, 0xe7, 0x1f, 0xb2, 0x0a, 0xf2, 0xf0, 0xfe, 0x18, -}; +}); -extern const size_t sTestCert_ICA01_1_Chip_Len = sizeof(sTestCert_ICA01_1_Chip); - -extern const uint8_t sTestCert_ICA01_1_DER[] = { +extern constexpr ByteSpan sTestCert_ICA01_1_DER((const uint8_t[]){ 0x30, 0x82, 0x01, 0x9d, 0x30, 0x82, 0x01, 0x43, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x36, 0xed, 0x10, 0xc3, 0x95, 0x64, 0x59, 0x78, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1054,37 +984,27 @@ extern const uint8_t sTestCert_ICA01_1_DER[] = { 0x66, 0x9f, 0x49, 0x85, 0x97, 0x04, 0x83, 0xe4, 0x00, 0x00, 0x9e, 0xd0, 0x46, 0xb3, 0x4e, 0xdc, 0x11, 0x8a, 0xcd, 0xb4, 0xed, 0xea, 0xb6, 0x21, 0x71, 0xbe, 0x02, 0x20, 0x7e, 0x80, 0xd5, 0xc2, 0x98, 0x5d, 0x6c, 0x6a, 0xb2, 0x55, 0xc3, 0xc4, 0xad, 0x55, 0x4c, 0x72, 0x70, 0x04, 0x8c, 0x26, 0xd6, 0xe6, 0xd3, 0xe9, 0xc2, 0xe7, 0x1f, 0xb2, 0x0a, 0xf2, 0xf0, 0xfe, -}; - -extern const size_t sTestCert_ICA01_1_DER_Len = sizeof(sTestCert_ICA01_1_DER); +}); -extern const uint8_t sTestCert_ICA01_1_PublicKey[] = { +extern constexpr ByteSpan sTestCert_ICA01_1_PublicKey((const uint8_t[]){ 0x04, 0xe1, 0xd5, 0x3a, 0x9c, 0x25, 0x7a, 0xe3, 0x2b, 0xab, 0x05, 0x77, 0x89, 0x06, 0x03, 0x13, 0x91, 0xb5, 0x8a, 0xdf, 0x9f, 0x8a, 0xb2, 0x69, 0x38, 0xad, 0xeb, 0xf1, 0x39, 0x6c, 0xf1, 0x2c, 0x4a, 0x41, 0x45, 0xba, 0xd8, 0x5e, 0x92, 0xeb, 0x7f, 0x3b, 0x37, 0xd5, 0xda, 0x69, 0xd0, 0xcf, 0x60, 0x4c, 0x41, 0xc4, 0x96, 0x4f, 0xad, 0x2d, 0x70, 0x45, 0x68, 0xd6, 0xbe, 0x8c, 0xaf, 0xda, 0xee, -}; - -extern const size_t sTestCert_ICA01_1_PublicKey_Len = sizeof(sTestCert_ICA01_1_PublicKey); +}); -extern const uint8_t sTestCert_ICA01_1_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_ICA01_1_PrivateKey((const uint8_t[]){ 0x93, 0xdb, 0xce, 0x6a, 0x6b, 0xf8, 0xdb, 0x3c, 0x4a, 0x96, 0xdd, 0x28, 0x2f, 0x4c, 0xb8, 0xf0, 0x6b, 0xca, 0x61, 0x6f, 0xb9, 0x00, 0x9e, 0xd6, 0x4a, 0x49, 0x0f, 0xb0, 0x65, 0x83, 0xaf, 0x8d, -}; - -extern const size_t sTestCert_ICA01_1_PrivateKey_Len = sizeof(sTestCert_ICA01_1_PrivateKey); +}); -extern const uint8_t sTestCert_ICA01_1_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_ICA01_1_SubjectKeyId((const uint8_t[]){ 0x50, 0x6F, 0xC3, 0xFC, 0xB7, 0x94, 0x15, 0x88, 0xEA, 0x73, 0x6C, 0x20, 0x65, 0x2E, 0x5F, 0x1B, 0x11, 0x70, 0x1C, 0x6A, -}; - -extern const size_t sTestCert_ICA01_1_SubjectKeyId_Len = sizeof(sTestCert_ICA01_1_SubjectKeyId); +}); -extern const uint8_t sTestCert_ICA01_1_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_ICA01_1_AuthorityKeyId((const uint8_t[]){ 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, -}; - -extern const size_t sTestCert_ICA01_1_AuthorityKeyId_Len = sizeof(sTestCert_ICA01_1_AuthorityKeyId); +}); /************** Test FWSign01 Certificate ************** Certificate: @@ -1146,7 +1066,7 @@ NKYNQg/SuZ6UK2r4pQ8SdlNcT/AyYXndeA== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_FWSign01_Chip[] = { +extern constexpr ByteSpan sTestCert_FWSign01_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x7a, 0x60, 0x2b, 0x09, 0x23, 0x72, 0xc1, 0xf8, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x05, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x12, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x2c, 0x01, 0x0f, 0x46, 0x57, 0x20, 0x53, 0x49, @@ -1161,11 +1081,9 @@ extern const uint8_t sTestCert_FWSign01_Chip[] = { 0x38, 0x66, 0x6d, 0x5a, 0x7b, 0xe6, 0xe6, 0x62, 0x09, 0xaf, 0x29, 0x4e, 0xa4, 0x63, 0xb4, 0x95, 0x1c, 0xad, 0xd7, 0xc4, 0x6f, 0x5a, 0xa7, 0x4a, 0x4d, 0x56, 0x0f, 0x89, 0x7d, 0x53, 0x65, 0xa8, 0x9f, 0xde, 0x38, 0xf3, 0xf9, 0x11, 0x72, 0x48, 0x39, 0x1c, 0xf5, 0xbc, 0x76, 0x16, 0xf6, 0x99, 0x08, 0x59, 0x33, 0xd5, 0x63, 0xc9, 0x18, -}; - -extern const size_t sTestCert_FWSign01_Chip_Len = sizeof(sTestCert_FWSign01_Chip); +}); -extern const uint8_t sTestCert_FWSign01_DER[] = { +extern constexpr ByteSpan sTestCert_FWSign01_DER((const uint8_t[]){ 0x30, 0x82, 0x01, 0xcd, 0x30, 0x82, 0x01, 0x72, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x7a, 0x60, 0x2b, 0x09, 0x23, 0x72, 0xc1, 0xf8, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1189,37 +1107,27 @@ extern const uint8_t sTestCert_FWSign01_DER[] = { 0xa4, 0x63, 0xb4, 0x95, 0x1c, 0xad, 0xd7, 0xc4, 0x6f, 0x5a, 0x02, 0x21, 0x00, 0xa7, 0x4a, 0x4d, 0x56, 0x0f, 0x89, 0x7d, 0x53, 0x65, 0xa8, 0x9f, 0xde, 0x38, 0xf3, 0xf9, 0x11, 0x72, 0x48, 0x39, 0x1c, 0xf5, 0xbc, 0x76, 0x16, 0xf6, 0x99, 0x08, 0x59, 0x33, 0xd5, 0x63, 0xc9, -}; - -extern const size_t sTestCert_FWSign01_DER_Len = sizeof(sTestCert_FWSign01_DER); +}); -extern const uint8_t sTestCert_FWSign01_PublicKey[] = { +extern constexpr ByteSpan sTestCert_FWSign01_PublicKey((const uint8_t[]){ 0x04, 0xfd, 0x2a, 0xe4, 0x0a, 0x74, 0x7c, 0x6d, 0x5a, 0xc6, 0xc8, 0xdc, 0x79, 0x61, 0x2b, 0x9a, 0x85, 0x3c, 0x3e, 0x0f, 0xb4, 0x1c, 0x94, 0xff, 0x08, 0x5b, 0x4e, 0x1d, 0x02, 0x24, 0x85, 0x98, 0x65, 0xea, 0x6c, 0x7d, 0x67, 0xbb, 0x88, 0x84, 0x34, 0xa6, 0x0d, 0x42, 0x0f, 0xd2, 0xb9, 0x9e, 0x94, 0x2b, 0x6a, 0xf8, 0xa5, 0x0f, 0x12, 0x76, 0x53, 0x5c, 0x4f, 0xf0, 0x32, 0x61, 0x79, 0xdd, 0x78, -}; +}); -extern const size_t sTestCert_FWSign01_PublicKey_Len = sizeof(sTestCert_FWSign01_PublicKey); - -extern const uint8_t sTestCert_FWSign01_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_FWSign01_PrivateKey((const uint8_t[]){ 0x61, 0xf3, 0xa0, 0x66, 0x9c, 0x21, 0x2d, 0x23, 0x9f, 0x71, 0x7b, 0xce, 0xae, 0x22, 0xa5, 0x73, 0x95, 0x4a, 0x6f, 0x92, 0x15, 0x37, 0xa3, 0x85, 0x42, 0x27, 0x6d, 0xbb, 0x30, 0x89, 0x2d, 0xe0, -}; +}); -extern const size_t sTestCert_FWSign01_PrivateKey_Len = sizeof(sTestCert_FWSign01_PrivateKey); - -extern const uint8_t sTestCert_FWSign01_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_FWSign01_SubjectKeyId((const uint8_t[]){ 0x52, 0x25, 0xD5, 0x83, 0xFB, 0x71, 0x8A, 0x7C, 0x64, 0x51, 0xFD, 0xAF, 0x92, 0x2A, 0xCD, 0x2D, 0x36, 0x10, 0x05, 0xC7, -}; +}); -extern const size_t sTestCert_FWSign01_SubjectKeyId_Len = sizeof(sTestCert_FWSign01_SubjectKeyId); - -extern const uint8_t sTestCert_FWSign01_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_FWSign01_AuthorityKeyId((const uint8_t[]){ 0x50, 0x6F, 0xC3, 0xFC, 0xB7, 0x94, 0x15, 0x88, 0xEA, 0x73, 0x6C, 0x20, 0x65, 0x2E, 0x5F, 0x1B, 0x11, 0x70, 0x1C, 0x6A, -}; - -extern const size_t sTestCert_FWSign01_AuthorityKeyId_Len = sizeof(sTestCert_FWSign01_AuthorityKeyId); +}); /************** Test Node01_01 Certificate ************** Certificate: @@ -1282,7 +1190,7 @@ rB5zy3KgVLag2wYiqoBwcQFjE7FZbIVSzw== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node01_01_Chip[] = { +extern constexpr ByteSpan sTestCert_Node01_01_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x18, 0xe9, 0x69, 0xba, 0x0e, 0x08, 0x9e, 0x23, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -1296,15 +1204,13 @@ extern const uint8_t sTestCert_Node01_01_Chip[] = { 0x94, 0xf8, 0x0e, 0xe2, 0x90, 0xcb, 0x3c, 0x3d, 0x37, 0x33, 0x35, 0xba, 0xb9, 0x59, 0x07, 0x73, 0x4d, 0x99, 0xd3, 0x84, 0xa6, 0x2a, 0x37, 0x3b, 0x84, 0x84, 0xe1, 0xd4, 0x1a, 0x04, 0xc3, 0x14, 0x0f, 0xaa, 0x19, 0xe8, 0xa2, 0xb9, 0x9b, 0x0c, 0x61, 0xe3, 0x3c, 0x27, 0xea, 0x91, 0x39, 0x73, 0xe4, 0x5b, 0x5b, 0xc6, 0xe3, 0x9c, 0x27, 0x0d, 0xac, 0x53, 0x18, -}; - -extern const size_t sTestCert_Node01_01_Chip_Len = sizeof(sTestCert_Node01_01_Chip); +}); // Error Testing 01: Manually updated Node01_01 CHIP TLV encoded certificate. // Updated Tag of the Subject Key Identifier Extension from ContextTag to CommonProfile_2Bytes: // 0x30, 0x04 --> 0x50, 0xee, 0x04 // The CHIP_ERROR_INVALID_TLV_TAG error is expected when this certificate is loaded/decoded -extern const uint8_t sTestCert_Node01_01_Err01_Chip[] = { +extern constexpr ByteSpan sTestCert_Node01_01_Err01_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x18, 0xe9, 0x69, 0xba, 0x0e, 0x08, 0x9e, 0x23, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x03, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -1318,11 +1224,9 @@ extern const uint8_t sTestCert_Node01_01_Err01_Chip[] = { 0xbc, 0x94, 0xf8, 0x0e, 0xe2, 0x90, 0xcb, 0x3c, 0x3d, 0x37, 0x33, 0x35, 0xba, 0xb9, 0x59, 0x07, 0x73, 0x4d, 0x99, 0xd3, 0x84, 0xa6, 0x2a, 0x37, 0x3b, 0x84, 0x84, 0xe1, 0xd4, 0x1a, 0x04, 0xc3, 0x14, 0x0f, 0xaa, 0x19, 0xe8, 0xa2, 0xb9, 0x9b, 0x0c, 0x61, 0xe3, 0x3c, 0x27, 0xea, 0x91, 0x39, 0x73, 0xe4, 0x5b, 0x5b, 0xc6, 0xe3, 0x9c, 0x27, 0x0d, 0xac, 0x53, 0x18, -}; +}); -extern const size_t sTestCert_Node01_01_Err01_Chip_Len = sizeof(sTestCert_Node01_01_Err01_Chip); - -extern const uint8_t sTestCert_Node01_01_DER[] = { +extern constexpr ByteSpan sTestCert_Node01_01_DER((const uint8_t[]){ 0x30, 0x82, 0x01, 0xe1, 0x30, 0x82, 0x01, 0x86, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x18, 0xe9, 0x69, 0xba, 0x0e, 0x08, 0x9e, 0x23, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1347,37 +1251,27 @@ extern const uint8_t sTestCert_Node01_01_DER[] = { 0x99, 0xd3, 0x84, 0xa6, 0x2a, 0x37, 0x3b, 0x84, 0x84, 0x02, 0x21, 0x00, 0xe1, 0xd4, 0x1a, 0x04, 0xc3, 0x14, 0x0f, 0xaa, 0x19, 0xe8, 0xa2, 0xb9, 0x9b, 0x0c, 0x61, 0xe3, 0x3c, 0x27, 0xea, 0x91, 0x39, 0x73, 0xe4, 0x5b, 0x5b, 0xc6, 0xe3, 0x9c, 0x27, 0x0d, 0xac, 0x53, -}; - -extern const size_t sTestCert_Node01_01_DER_Len = sizeof(sTestCert_Node01_01_DER); +}); -extern const uint8_t sTestCert_Node01_01_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node01_01_PublicKey((const uint8_t[]){ 0x04, 0xbc, 0xf6, 0x58, 0x0d, 0x2d, 0x71, 0xe1, 0x44, 0x16, 0x65, 0x1f, 0x7c, 0x31, 0x1b, 0x5e, 0xfc, 0xf9, 0xae, 0xc0, 0xa8, 0xc1, 0x0a, 0xf8, 0x09, 0x27, 0x84, 0x4c, 0x24, 0x0f, 0x51, 0xa8, 0xeb, 0x23, 0xfa, 0x07, 0x44, 0x13, 0x88, 0x87, 0xac, 0x1e, 0x73, 0xcb, 0x72, 0xa0, 0x54, 0xb6, 0xa0, 0xdb, 0x06, 0x22, 0xaa, 0x80, 0x70, 0x71, 0x01, 0x63, 0x13, 0xb1, 0x59, 0x6c, 0x85, 0x52, 0xcf, -}; - -extern const size_t sTestCert_Node01_01_PublicKey_Len = sizeof(sTestCert_Node01_01_PublicKey); +}); -extern const uint8_t sTestCert_Node01_01_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node01_01_PrivateKey((const uint8_t[]){ 0x49, 0x2e, 0x7f, 0x97, 0x83, 0xee, 0x15, 0xfd, 0xaa, 0x71, 0xa8, 0xa6, 0x7b, 0x1f, 0x31, 0xf3, 0xc8, 0xd5, 0x7b, 0x75, 0x09, 0x4a, 0x46, 0x13, 0xb9, 0xbb, 0x3e, 0xf4, 0x6f, 0xa6, 0x0d, 0x89, -}; - -extern const size_t sTestCert_Node01_01_PrivateKey_Len = sizeof(sTestCert_Node01_01_PrivateKey); +}); -extern const uint8_t sTestCert_Node01_01_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node01_01_SubjectKeyId((const uint8_t[]){ 0x69, 0x67, 0xC9, 0x12, 0xF8, 0xA3, 0xE6, 0x89, 0x55, 0x6F, 0x89, 0x9B, 0x65, 0xD7, 0x6F, 0x53, 0xFA, 0x65, 0xC7, 0xB6, -}; - -extern const size_t sTestCert_Node01_01_SubjectKeyId_Len = sizeof(sTestCert_Node01_01_SubjectKeyId); +}); -extern const uint8_t sTestCert_Node01_01_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node01_01_AuthorityKeyId((const uint8_t[]){ 0x44, 0x0C, 0xC6, 0x92, 0x31, 0xC4, 0xCB, 0x5B, 0x37, 0x94, 0x24, 0x26, 0xF8, 0x1B, 0xBE, 0x24, 0xB7, 0xEF, 0x34, 0x5C, -}; - -extern const size_t sTestCert_Node01_01_AuthorityKeyId_Len = sizeof(sTestCert_Node01_01_AuthorityKeyId); +}); /************** Test Node01_02 Certificate ************** Certificate: @@ -1440,7 +1334,7 @@ tRXZJkFZ94vQl44y10xtBVoUno6dukAZvw== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node01_02_Chip[] = { +extern constexpr ByteSpan sTestCert_Node01_02_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x0d, 0x90, 0x93, 0x53, 0x46, 0xb0, 0x5c, 0xbc, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x14, 0x01, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x02, 0x00, 0x01, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, @@ -1454,11 +1348,9 @@ extern const uint8_t sTestCert_Node01_02_Chip[] = { 0x82, 0xfc, 0xf6, 0x30, 0x1f, 0x7a, 0x08, 0x1b, 0xca, 0x5a, 0x84, 0x82, 0x02, 0x43, 0x1a, 0x52, 0xfd, 0xbf, 0xf4, 0x97, 0xd8, 0xdd, 0x6f, 0x9a, 0x59, 0x59, 0x7b, 0xad, 0xcc, 0xd6, 0xa5, 0x6d, 0x70, 0xef, 0xd8, 0xc9, 0x7c, 0x49, 0x6e, 0xba, 0x7e, 0x28, 0x01, 0xd7, 0x33, 0x7d, 0xcf, 0xf7, 0x4d, 0x78, 0xe4, 0x6e, 0xcd, 0x3a, 0x08, 0xcc, 0xba, 0xe3, 0x18, -}; - -extern const size_t sTestCert_Node01_02_Chip_Len = sizeof(sTestCert_Node01_02_Chip); +}); -extern const uint8_t sTestCert_Node01_02_DER[] = { +extern constexpr ByteSpan sTestCert_Node01_02_DER((const uint8_t[]){ 0x30, 0x82, 0x01, 0xdf, 0x30, 0x82, 0x01, 0x86, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x0d, 0x90, 0x93, 0x53, 0x46, 0xb0, 0x5c, 0xbc, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x22, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x04, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1482,37 +1374,27 @@ extern const uint8_t sTestCert_Node01_02_DER[] = { 0x4b, 0xa7, 0x21, 0x82, 0xfc, 0xf6, 0x30, 0x1f, 0x7a, 0x08, 0x1b, 0xca, 0x5a, 0x84, 0x82, 0x02, 0x43, 0x1a, 0x52, 0xfd, 0xbf, 0xf4, 0x97, 0xd8, 0xdd, 0x6f, 0x9a, 0x59, 0x59, 0x02, 0x20, 0x7b, 0xad, 0xcc, 0xd6, 0xa5, 0x6d, 0x70, 0xef, 0xd8, 0xc9, 0x7c, 0x49, 0x6e, 0xba, 0x7e, 0x28, 0x01, 0xd7, 0x33, 0x7d, 0xcf, 0xf7, 0x4d, 0x78, 0xe4, 0x6e, 0xcd, 0x3a, 0x08, 0xcc, 0xba, 0xe3, -}; - -extern const size_t sTestCert_Node01_02_DER_Len = sizeof(sTestCert_Node01_02_DER); +}); -extern const uint8_t sTestCert_Node01_02_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node01_02_PublicKey((const uint8_t[]){ 0x04, 0x96, 0x5f, 0x78, 0xc5, 0x37, 0xec, 0xe1, 0xb8, 0xc3, 0x4a, 0x7b, 0x98, 0xb9, 0xaa, 0x45, 0xf1, 0x35, 0x63, 0xa5, 0x02, 0xb1, 0x97, 0x9a, 0x60, 0x7b, 0xd0, 0xc4, 0x19, 0x88, 0xbd, 0xd0, 0xf0, 0xbb, 0xb8, 0x98, 0x16, 0xc2, 0x07, 0xe3, 0xb5, 0x15, 0xd9, 0x26, 0x41, 0x59, 0xf7, 0x8b, 0xd0, 0x97, 0x8e, 0x32, 0xd7, 0x4c, 0x6d, 0x05, 0x5a, 0x14, 0x9e, 0x8e, 0x9d, 0xba, 0x40, 0x19, 0xbf, -}; +}); -extern const size_t sTestCert_Node01_02_PublicKey_Len = sizeof(sTestCert_Node01_02_PublicKey); - -extern const uint8_t sTestCert_Node01_02_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node01_02_PrivateKey((const uint8_t[]){ 0x18, 0xb2, 0x98, 0x61, 0x51, 0x42, 0xe7, 0x7a, 0xdb, 0x0d, 0x1d, 0xc3, 0xc5, 0x17, 0x80, 0xd3, 0x78, 0xca, 0x3e, 0x63, 0xa9, 0x1f, 0xd8, 0xdc, 0xa6, 0x0b, 0xe7, 0x77, 0x9a, 0xb2, 0xf7, 0x0d, -}; +}); -extern const size_t sTestCert_Node01_02_PrivateKey_Len = sizeof(sTestCert_Node01_02_PrivateKey); - -extern const uint8_t sTestCert_Node01_02_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node01_02_SubjectKeyId((const uint8_t[]){ 0x56, 0x7B, 0x4F, 0x20, 0xE4, 0xB9, 0xC7, 0xBD, 0x27, 0xB2, 0x9B, 0x3D, 0xCE, 0x6A, 0x76, 0xF7, 0xCD, 0x8E, 0xCC, 0xB6, -}; +}); -extern const size_t sTestCert_Node01_02_SubjectKeyId_Len = sizeof(sTestCert_Node01_02_SubjectKeyId); - -extern const uint8_t sTestCert_Node01_02_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node01_02_AuthorityKeyId((const uint8_t[]){ 0xCC, 0x13, 0x08, 0xAF, 0x82, 0xCF, 0xEE, 0x50, 0x5E, 0xB2, 0x3B, 0x57, 0xBF, 0xE8, 0x6A, 0x31, 0x16, 0x65, 0x53, 0x5F, -}; - -extern const size_t sTestCert_Node01_02_AuthorityKeyId_Len = sizeof(sTestCert_Node01_02_AuthorityKeyId); +}); /************** Test Node02_01 Certificate ************** Certificate: @@ -1575,7 +1457,7 @@ nVEyh1OEMRr0B5TDVXU5tqDa3niLDB/2SQ== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node02_01_Chip[] = { +extern constexpr ByteSpan sTestCert_Node02_01_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x03, 0xe5, 0x45, 0x90, 0xde, 0x19, 0x04, 0x37, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x01, 0x00, 0x02, 0x00, 0xde, 0xde, @@ -1590,11 +1472,9 @@ extern const uint8_t sTestCert_Node02_01_Chip[] = { 0xcd, 0xc8, 0x37, 0xfb, 0xee, 0x58, 0x25, 0xbe, 0x2f, 0xf3, 0xb9, 0x6a, 0x10, 0xe9, 0xb0, 0x33, 0x73, 0x4a, 0xd5, 0xfd, 0x19, 0x98, 0x6d, 0x2c, 0x90, 0x9c, 0x81, 0x86, 0xfc, 0x9c, 0x5b, 0x3a, 0x47, 0xc3, 0x35, 0xca, 0x16, 0xd0, 0xae, 0xd1, 0xaa, 0xc8, 0x9a, 0x20, 0x37, 0x08, 0x50, 0xb4, 0x15, 0xeb, 0x62, 0x3a, 0x73, 0xc3, 0x38, 0x19, 0x33, 0x74, 0x18, -}; - -extern const size_t sTestCert_Node02_01_Chip_Len = sizeof(sTestCert_Node02_01_Chip); +}); -extern const uint8_t sTestCert_Node02_01_DER[] = { +extern constexpr ByteSpan sTestCert_Node02_01_DER((const uint8_t[]){ 0x30, 0x82, 0x02, 0x02, 0x30, 0x82, 0x01, 0xa8, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x03, 0xe5, 0x45, 0x90, 0xde, 0x19, 0x04, 0x37, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1620,37 +1500,27 @@ extern const uint8_t sTestCert_Node02_01_DER[] = { 0x58, 0x25, 0xbe, 0x2f, 0xf3, 0xb9, 0x6a, 0x10, 0xe9, 0xb0, 0x33, 0x73, 0x4a, 0xd5, 0xfd, 0x19, 0x98, 0x6d, 0x2c, 0x90, 0x9c, 0x02, 0x21, 0x00, 0x81, 0x86, 0xfc, 0x9c, 0x5b, 0x3a, 0x47, 0xc3, 0x35, 0xca, 0x16, 0xd0, 0xae, 0xd1, 0xaa, 0xc8, 0x9a, 0x20, 0x37, 0x08, 0x50, 0xb4, 0x15, 0xeb, 0x62, 0x3a, 0x73, 0xc3, 0x38, 0x19, 0x33, 0x74, -}; +}); -extern const size_t sTestCert_Node02_01_DER_Len = sizeof(sTestCert_Node02_01_DER); - -extern const uint8_t sTestCert_Node02_01_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node02_01_PublicKey((const uint8_t[]){ 0x04, 0xa5, 0x70, 0x10, 0x42, 0xaa, 0x69, 0x14, 0x20, 0xf5, 0xce, 0xf5, 0xbb, 0x65, 0x2e, 0xde, 0xd7, 0x43, 0xcc, 0x4d, 0x6f, 0x00, 0x0e, 0x11, 0x35, 0xf0, 0xef, 0x69, 0x98, 0x2e, 0x52, 0x8d, 0xbf, 0x9d, 0xb2, 0x2b, 0x90, 0x4d, 0x97, 0x05, 0x9d, 0x51, 0x32, 0x87, 0x53, 0x84, 0x31, 0x1a, 0xf4, 0x07, 0x94, 0xc3, 0x55, 0x75, 0x39, 0xb6, 0xa0, 0xda, 0xde, 0x78, 0x8b, 0x0c, 0x1f, 0xf6, 0x49, -}; - -extern const size_t sTestCert_Node02_01_PublicKey_Len = sizeof(sTestCert_Node02_01_PublicKey); +}); -extern const uint8_t sTestCert_Node02_01_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node02_01_PrivateKey((const uint8_t[]){ 0xb4, 0x9f, 0x0e, 0x37, 0x24, 0x9c, 0x48, 0xc2, 0x5b, 0xa3, 0x0c, 0x7a, 0xfc, 0x4c, 0x94, 0x4f, 0x88, 0xac, 0x3c, 0x03, 0xc5, 0xb2, 0xa1, 0x93, 0x6b, 0xd8, 0x67, 0x15, 0xad, 0x7b, 0xe9, 0x24, -}; - -extern const size_t sTestCert_Node02_01_PrivateKey_Len = sizeof(sTestCert_Node02_01_PrivateKey); +}); -extern const uint8_t sTestCert_Node02_01_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_01_SubjectKeyId((const uint8_t[]){ 0xB4, 0x67, 0x76, 0xE1, 0xCC, 0x0A, 0xF7, 0x81, 0x54, 0xC6, 0x2B, 0x5A, 0x17, 0x98, 0x42, 0x64, 0xBA, 0xF5, 0x50, 0x86, -}; - -extern const size_t sTestCert_Node02_01_SubjectKeyId_Len = sizeof(sTestCert_Node02_01_SubjectKeyId); +}); -extern const uint8_t sTestCert_Node02_01_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_01_AuthorityKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, -}; - -extern const size_t sTestCert_Node02_01_AuthorityKeyId_Len = sizeof(sTestCert_Node02_01_AuthorityKeyId); +}); /************** Test Node02_02 Certificate ************** Certificate: @@ -1711,7 +1581,7 @@ NSNN0iIb5AQvzsR0DhBeCLeJaKeUoYQW1w== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node02_02_Chip[] = { +extern constexpr ByteSpan sTestCert_Node02_02_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x0e, 0x99, 0xfe, 0xb4, 0xdb, 0x62, 0x01, 0x2a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x02, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, @@ -1728,11 +1598,9 @@ extern const uint8_t sTestCert_Node02_02_Chip[] = { 0xa8, 0xca, 0x9e, 0xc2, 0x10, 0xf6, 0xae, 0xdc, 0x0a, 0xe1, 0x03, 0x73, 0x77, 0xf6, 0xf8, 0x48, 0x86, 0xbb, 0x6a, 0x20, 0x27, 0x42, 0xda, 0x75, 0xc9, 0x2d, 0x43, 0x1d, 0xf8, 0xed, 0xba, 0xcb, 0x8c, 0x30, 0x73, 0xb8, 0x10, 0x0a, 0xa1, 0x9d, 0x46, 0x9e, 0xc8, 0xe4, 0x92, 0x1e, 0xb8, 0x13, 0x18, -}; +}); -extern const size_t sTestCert_Node02_02_Chip_Len = sizeof(sTestCert_Node02_02_Chip); - -extern const uint8_t sTestCert_Node02_02_DER[] = { +extern constexpr ByteSpan sTestCert_Node02_02_DER((const uint8_t[]){ 0x30, 0x82, 0x02, 0x35, 0x30, 0x82, 0x01, 0xdb, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x0e, 0x99, 0xfe, 0xb4, 0xdb, 0x62, 0x01, 0x2a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1761,37 +1629,27 @@ extern const uint8_t sTestCert_Node02_02_DER[] = { 0xdc, 0x0a, 0xe1, 0x03, 0x73, 0x77, 0xf6, 0xf8, 0x48, 0x02, 0x21, 0x00, 0x86, 0xbb, 0x6a, 0x20, 0x27, 0x42, 0xda, 0x75, 0xc9, 0x2d, 0x43, 0x1d, 0xf8, 0xed, 0xba, 0xcb, 0x8c, 0x30, 0x73, 0xb8, 0x10, 0x0a, 0xa1, 0x9d, 0x46, 0x9e, 0xc8, 0xe4, 0x92, 0x1e, 0xb8, 0x13, -}; - -extern const size_t sTestCert_Node02_02_DER_Len = sizeof(sTestCert_Node02_02_DER); +}); -extern const uint8_t sTestCert_Node02_02_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node02_02_PublicKey((const uint8_t[]){ 0x04, 0xf6, 0xa0, 0x95, 0x8f, 0xb8, 0xfc, 0x32, 0x53, 0x4a, 0x7a, 0x4d, 0x44, 0x87, 0x4b, 0x51, 0x0f, 0x30, 0x9a, 0xdf, 0xe6, 0x51, 0x42, 0x2b, 0x35, 0x70, 0x63, 0x05, 0x88, 0x11, 0xb7, 0xd5, 0xbc, 0x56, 0x36, 0x66, 0xd5, 0x48, 0xdb, 0x2f, 0x35, 0x23, 0x4d, 0xd2, 0x22, 0x1b, 0xe4, 0x04, 0x2f, 0xce, 0xc4, 0x74, 0x0e, 0x10, 0x5e, 0x08, 0xb7, 0x89, 0x68, 0xa7, 0x94, 0xa1, 0x84, 0x16, 0xd7, -}; - -extern const size_t sTestCert_Node02_02_PublicKey_Len = sizeof(sTestCert_Node02_02_PublicKey); +}); -extern const uint8_t sTestCert_Node02_02_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node02_02_PrivateKey((const uint8_t[]){ 0xe7, 0x75, 0xb1, 0x82, 0x35, 0xed, 0x35, 0x42, 0xf3, 0x06, 0x88, 0x64, 0xbe, 0x9d, 0xa6, 0x24, 0x88, 0x7a, 0xa8, 0xe8, 0x2c, 0x29, 0x8c, 0x4b, 0x5a, 0x20, 0x6d, 0x06, 0xb5, 0xb0, 0x85, 0x73, -}; +}); -extern const size_t sTestCert_Node02_02_PrivateKey_Len = sizeof(sTestCert_Node02_02_PrivateKey); - -extern const uint8_t sTestCert_Node02_02_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_02_SubjectKeyId((const uint8_t[]){ 0x21, 0xF4, 0x13, 0xAA, 0x28, 0xD3, 0x89, 0xAF, 0x4E, 0xEE, 0x25, 0x71, 0x1E, 0xDF, 0xA1, 0x98, 0xF7, 0x71, 0x88, 0x85, -}; +}); -extern const size_t sTestCert_Node02_02_SubjectKeyId_Len = sizeof(sTestCert_Node02_02_SubjectKeyId); - -extern const uint8_t sTestCert_Node02_02_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_02_AuthorityKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, -}; - -extern const size_t sTestCert_Node02_02_AuthorityKeyId_Len = sizeof(sTestCert_Node02_02_AuthorityKeyId); +}); /************** Test Node02_03 Certificate ************** Certificate: @@ -1853,7 +1711,7 @@ fSLWAYepIPugtFe5rIwp4Zo2fi/wG1x6WQ== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node02_03_Chip[] = { +extern constexpr ByteSpan sTestCert_Node02_03_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x0e, 0xd1, 0x90, 0x55, 0xe3, 0x1c, 0x56, 0x6b, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x03, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, @@ -1869,11 +1727,9 @@ extern const uint8_t sTestCert_Node02_03_Chip[] = { 0x86, 0x6e, 0x2e, 0xac, 0x3b, 0xec, 0x3d, 0x1f, 0x11, 0xd1, 0x74, 0x00, 0x97, 0xee, 0x5d, 0xea, 0xcc, 0x22, 0x75, 0xf7, 0x00, 0x0c, 0xa1, 0xe5, 0xe4, 0x9b, 0xab, 0x45, 0x19, 0xc6, 0x70, 0xf7, 0xc2, 0x50, 0x9c, 0xce, 0x18, 0x97, 0xce, 0x95, 0x8a, 0xe8, 0xf4, 0xa9, 0x49, 0x9f, 0x33, 0xea, 0x18, -}; - -extern const size_t sTestCert_Node02_03_Chip_Len = sizeof(sTestCert_Node02_03_Chip); +}); -extern const uint8_t sTestCert_Node02_03_DER[] = { +extern constexpr ByteSpan sTestCert_Node02_03_DER((const uint8_t[]){ 0x30, 0x82, 0x02, 0x35, 0x30, 0x82, 0x01, 0xda, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x0e, 0xd1, 0x90, 0x55, 0xe3, 0x1c, 0x56, 0x6b, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -1902,37 +1758,27 @@ extern const uint8_t sTestCert_Node02_03_DER[] = { 0x1f, 0x11, 0xd1, 0x74, 0x00, 0x97, 0xee, 0x5d, 0xea, 0x02, 0x21, 0x00, 0xcc, 0x22, 0x75, 0xf7, 0x00, 0x0c, 0xa1, 0xe5, 0xe4, 0x9b, 0xab, 0x45, 0x19, 0xc6, 0x70, 0xf7, 0xc2, 0x50, 0x9c, 0xce, 0x18, 0x97, 0xce, 0x95, 0x8a, 0xe8, 0xf4, 0xa9, 0x49, 0x9f, 0x33, 0xea, -}; - -extern const size_t sTestCert_Node02_03_DER_Len = sizeof(sTestCert_Node02_03_DER); +}); -extern const uint8_t sTestCert_Node02_03_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node02_03_PublicKey((const uint8_t[]){ 0x04, 0xab, 0x9b, 0x9c, 0xa9, 0xe1, 0x93, 0x76, 0xc4, 0xf5, 0x7d, 0xde, 0xc4, 0x38, 0x6a, 0x00, 0xfc, 0x3e, 0x8a, 0x4b, 0x38, 0x8c, 0xd1, 0x8a, 0xb4, 0xff, 0xcc, 0xda, 0x45, 0x62, 0x08, 0x0c, 0x08, 0xb5, 0xe7, 0x16, 0xe6, 0xb2, 0xce, 0xc5, 0x7d, 0x22, 0xd6, 0x01, 0x87, 0xa9, 0x20, 0xfb, 0xa0, 0xb4, 0x57, 0xb9, 0xac, 0x8c, 0x29, 0xe1, 0x9a, 0x36, 0x7e, 0x2f, 0xf0, 0x1b, 0x5c, 0x7a, 0x59, -}; +}); -extern const size_t sTestCert_Node02_03_PublicKey_Len = sizeof(sTestCert_Node02_03_PublicKey); - -extern const uint8_t sTestCert_Node02_03_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node02_03_PrivateKey((const uint8_t[]){ 0x0a, 0x12, 0xf6, 0x9c, 0x15, 0xf4, 0x2f, 0x11, 0x0e, 0xe3, 0xf4, 0xeb, 0x77, 0xf8, 0xaf, 0xef, 0x05, 0x0c, 0x09, 0x75, 0xf3, 0x06, 0x62, 0x14, 0xe5, 0x8a, 0x30, 0x43, 0xfb, 0x20, 0xde, 0xba, -}; - -extern const size_t sTestCert_Node02_03_PrivateKey_Len = sizeof(sTestCert_Node02_03_PrivateKey); +}); -extern const uint8_t sTestCert_Node02_03_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_03_SubjectKeyId((const uint8_t[]){ 0xE5, 0x7F, 0x7A, 0xB3, 0x74, 0xB0, 0x2F, 0x53, 0xEF, 0xA0, 0xA5, 0xB6, 0x52, 0xF2, 0x21, 0x1C, 0x1A, 0xAF, 0x05, 0xCF, -}; - -extern const size_t sTestCert_Node02_03_SubjectKeyId_Len = sizeof(sTestCert_Node02_03_SubjectKeyId); +}); -extern const uint8_t sTestCert_Node02_03_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_03_AuthorityKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, -}; - -extern const size_t sTestCert_Node02_03_AuthorityKeyId_Len = sizeof(sTestCert_Node02_03_AuthorityKeyId); +}); /************** Test Node02_04 Certificate ************** Certificate: @@ -1994,7 +1840,7 @@ kPgNiEs/n3k+W6hQDL6Fh6RBwiFbh9ceSg== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node02_04_Chip[] = { +extern constexpr ByteSpan sTestCert_Node02_04_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x78, 0x0b, 0x9a, 0x03, 0xbd, 0xc8, 0x02, 0x72, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x02, 0x10, 0xce, 0xab, 0x2c, 0x01, 0x0d, 0x54, 0x65, @@ -2010,11 +1856,9 @@ extern const uint8_t sTestCert_Node02_04_Chip[] = { 0xa6, 0x2d, 0x0d, 0xd1, 0xcf, 0xbc, 0xd1, 0xa0, 0xda, 0x20, 0xff, 0xe7, 0x61, 0x79, 0xe5, 0xf2, 0xf6, 0x83, 0x9a, 0x50, 0x90, 0x70, 0xc7, 0x5b, 0x07, 0x89, 0x74, 0x26, 0x73, 0xf7, 0xe5, 0x02, 0x64, 0xcc, 0x9c, 0xed, 0xc0, 0x01, 0xc9, 0x3c, 0x9e, 0x9c, 0x05, 0x02, 0x90, 0x3f, 0xd7, 0x3d, 0x25, 0xe3, 0x1e, 0x42, 0xad, 0x24, 0x18, -}; - -extern const size_t sTestCert_Node02_04_Chip_Len = sizeof(sTestCert_Node02_04_Chip); +}); -extern const uint8_t sTestCert_Node02_04_DER[] = { +extern constexpr ByteSpan sTestCert_Node02_04_DER((const uint8_t[]){ 0x30, 0x82, 0x02, 0x4f, 0x30, 0x82, 0x01, 0xf5, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x78, 0x0b, 0x9a, 0x03, 0xbd, 0xc8, 0x02, 0x72, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -2044,37 +1888,27 @@ extern const uint8_t sTestCert_Node02_04_DER[] = { 0xda, 0x20, 0xff, 0xe7, 0x61, 0x79, 0xe5, 0xf2, 0xf6, 0x83, 0x9a, 0x50, 0x90, 0x70, 0x02, 0x21, 0x00, 0xc7, 0x5b, 0x07, 0x89, 0x74, 0x26, 0x73, 0xf7, 0xe5, 0x02, 0x64, 0xcc, 0x9c, 0xed, 0xc0, 0x01, 0xc9, 0x3c, 0x9e, 0x9c, 0x05, 0x02, 0x90, 0x3f, 0xd7, 0x3d, 0x25, 0xe3, 0x1e, 0x42, 0xad, 0x24, -}; +}); -extern const size_t sTestCert_Node02_04_DER_Len = sizeof(sTestCert_Node02_04_DER); - -extern const uint8_t sTestCert_Node02_04_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node02_04_PublicKey((const uint8_t[]){ 0x04, 0xef, 0x70, 0x00, 0xd0, 0x0e, 0x73, 0x2e, 0x02, 0x9e, 0xe6, 0xc1, 0x15, 0x9a, 0xb6, 0x6c, 0xa0, 0xa2, 0xe6, 0x13, 0x74, 0xc9, 0x2b, 0x6f, 0x45, 0xb7, 0x99, 0x89, 0x66, 0x15, 0x49, 0x2b, 0x7d, 0xd5, 0xaa, 0x9d, 0x87, 0xfc, 0x56, 0xdf, 0x90, 0xf8, 0x0d, 0x88, 0x4b, 0x3f, 0x9f, 0x79, 0x3e, 0x5b, 0xa8, 0x50, 0x0c, 0xbe, 0x85, 0x87, 0xa4, 0x41, 0xc2, 0x21, 0x5b, 0x87, 0xd7, 0x1e, 0x4a, -}; - -extern const size_t sTestCert_Node02_04_PublicKey_Len = sizeof(sTestCert_Node02_04_PublicKey); +}); -extern const uint8_t sTestCert_Node02_04_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node02_04_PrivateKey((const uint8_t[]){ 0xe1, 0x95, 0x85, 0xb6, 0x38, 0x83, 0x23, 0x4b, 0xdc, 0x02, 0x7c, 0x54, 0x9c, 0xcd, 0x7a, 0x67, 0xc8, 0x34, 0x1c, 0x01, 0x72, 0xe0, 0x16, 0xec, 0xc2, 0x5d, 0xf6, 0xeb, 0x9c, 0x84, 0x5a, 0xb6, -}; - -extern const size_t sTestCert_Node02_04_PrivateKey_Len = sizeof(sTestCert_Node02_04_PrivateKey); +}); -extern const uint8_t sTestCert_Node02_04_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_04_SubjectKeyId((const uint8_t[]){ 0xB4, 0x49, 0x16, 0x80, 0x10, 0x4F, 0xC3, 0x8D, 0x9C, 0xFA, 0xDA, 0x69, 0xEA, 0x30, 0x85, 0x14, 0x4C, 0x92, 0x7D, 0x2A, -}; +}); -extern const size_t sTestCert_Node02_04_SubjectKeyId_Len = sizeof(sTestCert_Node02_04_SubjectKeyId); - -extern const uint8_t sTestCert_Node02_04_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_04_AuthorityKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, -}; - -extern const size_t sTestCert_Node02_04_AuthorityKeyId_Len = sizeof(sTestCert_Node02_04_AuthorityKeyId); +}); /************** Test Node02_05 Certificate ************** Certificate: @@ -2137,7 +1971,7 @@ UQPK95ZDHgpOnFrC1/DpHMcOffCdsyz4Yw== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node02_05_Chip[] = { +extern constexpr ByteSpan sTestCert_Node02_05_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x6d, 0x47, 0x5e, 0x82, 0x63, 0xe0, 0xf7, 0x3a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0x10, 0x00, 0xcd, 0xab, 0x27, 0x15, @@ -2154,11 +1988,9 @@ extern const uint8_t sTestCert_Node02_05_Chip[] = { 0x4a, 0x93, 0x0c, 0x3b, 0xa8, 0xef, 0x82, 0x8c, 0x5f, 0x93, 0xfe, 0x7e, 0xbb, 0xdd, 0x5b, 0xb4, 0xec, 0x54, 0x45, 0xbd, 0xd7, 0x78, 0x62, 0xd5, 0xa2, 0x1d, 0x43, 0x9e, 0x3c, 0x3b, 0xec, 0xbc, 0xb3, 0xf1, 0xaa, 0xbd, 0x97, 0x86, 0x10, 0x19, 0xa2, 0xe9, 0x45, 0xc9, 0x94, 0xd2, 0x73, 0x60, 0x4f, 0x60, 0xf0, 0x2d, 0xed, 0x3b, 0x6a, 0xc5, 0xbe, 0x07, 0x5d, 0x18, -}; +}); -extern const size_t sTestCert_Node02_05_Chip_Len = sizeof(sTestCert_Node02_05_Chip); - -extern const uint8_t sTestCert_Node02_05_DER[] = { +extern constexpr ByteSpan sTestCert_Node02_05_DER((const uint8_t[]){ 0x30, 0x82, 0x02, 0x51, 0x30, 0x82, 0x01, 0xf6, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x6d, 0x47, 0x5e, 0x82, 0x63, 0xe0, 0xf7, 0x3a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -2188,37 +2020,27 @@ extern const uint8_t sTestCert_Node02_05_DER[] = { 0x7e, 0xbb, 0xdd, 0x5b, 0xb4, 0xec, 0x54, 0x45, 0xbd, 0xd7, 0x78, 0x62, 0xd5, 0xa2, 0x1d, 0x43, 0x02, 0x21, 0x00, 0x9e, 0x3c, 0x3b, 0xec, 0xbc, 0xb3, 0xf1, 0xaa, 0xbd, 0x97, 0x86, 0x10, 0x19, 0xa2, 0xe9, 0x45, 0xc9, 0x94, 0xd2, 0x73, 0x60, 0x4f, 0x60, 0xf0, 0x2d, 0xed, 0x3b, 0x6a, 0xc5, 0xbe, 0x07, 0x5d, -}; - -extern const size_t sTestCert_Node02_05_DER_Len = sizeof(sTestCert_Node02_05_DER); +}); -extern const uint8_t sTestCert_Node02_05_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node02_05_PublicKey((const uint8_t[]){ 0x04, 0xfc, 0x8a, 0xff, 0x06, 0x3a, 0xd0, 0xe0, 0xbf, 0xdf, 0x24, 0xdd, 0x9d, 0x84, 0x13, 0x0f, 0x74, 0x49, 0x3c, 0x95, 0xa4, 0x0d, 0xb3, 0xf4, 0x0a, 0xaf, 0x42, 0xcf, 0x2c, 0xb1, 0x15, 0x8b, 0xa1, 0xaa, 0x1d, 0x61, 0xde, 0x38, 0x3c, 0x9b, 0x51, 0x03, 0xca, 0xf7, 0x96, 0x43, 0x1e, 0x0a, 0x4e, 0x9c, 0x5a, 0xc2, 0xd7, 0xf0, 0xe9, 0x1c, 0xc7, 0x0e, 0x7d, 0xf0, 0x9d, 0xb3, 0x2c, 0xf8, 0x63, -}; - -extern const size_t sTestCert_Node02_05_PublicKey_Len = sizeof(sTestCert_Node02_05_PublicKey); +}); -extern const uint8_t sTestCert_Node02_05_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node02_05_PrivateKey((const uint8_t[]){ 0x66, 0xd0, 0x40, 0x90, 0x71, 0x76, 0x60, 0xba, 0xaf, 0xcc, 0xdc, 0x46, 0x47, 0x6d, 0xa9, 0x1d, 0xad, 0x66, 0xe8, 0xad, 0x39, 0x28, 0x3d, 0xb1, 0x7d, 0x07, 0x79, 0xda, 0xd0, 0xcd, 0x65, 0xc2, -}; +}); -extern const size_t sTestCert_Node02_05_PrivateKey_Len = sizeof(sTestCert_Node02_05_PrivateKey); - -extern const uint8_t sTestCert_Node02_05_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_05_SubjectKeyId((const uint8_t[]){ 0x4B, 0x46, 0x42, 0x9C, 0x69, 0x3D, 0x0E, 0x28, 0x79, 0x8C, 0x8F, 0x76, 0x26, 0xA5, 0x01, 0x20, 0x05, 0x96, 0xAD, 0x2D, -}; - -extern const size_t sTestCert_Node02_05_SubjectKeyId_Len = sizeof(sTestCert_Node02_05_SubjectKeyId); +}); -extern const uint8_t sTestCert_Node02_05_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_05_AuthorityKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, -}; - -extern const size_t sTestCert_Node02_05_AuthorityKeyId_Len = sizeof(sTestCert_Node02_05_AuthorityKeyId); +}); /************** Test Node02_06 Certificate ************** Certificate: @@ -2288,7 +2110,7 @@ W5qMcXYk3zQtE4Zt3RdbQovDjSE9a/XH0w== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node02_06_Chip[] = { +extern constexpr ByteSpan sTestCert_Node02_06_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x10, 0x17, 0x8f, 0x6d, 0x21, 0x9e, 0x45, 0x4a, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x06, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, @@ -2306,11 +2128,9 @@ extern const uint8_t sTestCert_Node02_06_Chip[] = { 0xa3, 0x7a, 0x9e, 0x96, 0x01, 0xdf, 0x62, 0x63, 0xf2, 0x0a, 0x0a, 0x8c, 0xfe, 0xe3, 0x14, 0x04, 0xf6, 0x79, 0xd1, 0x85, 0xb0, 0x21, 0xdd, 0xf2, 0xb7, 0xa1, 0x6c, 0xd6, 0xaf, 0x6c, 0x38, 0xee, 0x92, 0x04, 0x03, 0xec, 0xb4, 0xd6, 0x16, 0x05, 0xf3, 0xc2, 0xf7, 0xf1, 0x7b, 0xd6, 0x16, 0x78, 0x42, 0x93, 0x18, -}; - -extern const size_t sTestCert_Node02_06_Chip_Len = sizeof(sTestCert_Node02_06_Chip); +}); -extern const uint8_t sTestCert_Node02_06_DER[] = { +extern constexpr ByteSpan sTestCert_Node02_06_DER((const uint8_t[]){ 0x30, 0x82, 0x02, 0x3e, 0x30, 0x82, 0x01, 0xe4, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x10, 0x17, 0x8f, 0x6d, 0x21, 0x9e, 0x45, 0x4a, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -2339,37 +2159,27 @@ extern const uint8_t sTestCert_Node02_06_DER[] = { 0xa3, 0x7a, 0x9e, 0x96, 0x01, 0xdf, 0x62, 0x63, 0xf2, 0x0a, 0x0a, 0x8c, 0xfe, 0xe3, 0x14, 0x04, 0xf6, 0x79, 0x02, 0x21, 0x00, 0xd1, 0x85, 0xb0, 0x21, 0xdd, 0xf2, 0xb7, 0xa1, 0x6c, 0xd6, 0xaf, 0x6c, 0x38, 0xee, 0x92, 0x04, 0x03, 0xec, 0xb4, 0xd6, 0x16, 0x05, 0xf3, 0xc2, 0xf7, 0xf1, 0x7b, 0xd6, 0x16, 0x78, 0x42, 0x93, -}; - -extern const size_t sTestCert_Node02_06_DER_Len = sizeof(sTestCert_Node02_06_DER); +}); -extern const uint8_t sTestCert_Node02_06_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node02_06_PublicKey((const uint8_t[]){ 0x04, 0xbb, 0xa4, 0x15, 0x69, 0x52, 0x63, 0xe1, 0xd9, 0xdc, 0x17, 0xcc, 0x32, 0x2d, 0x39, 0x5e, 0x32, 0x0d, 0xa6, 0xf1, 0x7d, 0x56, 0xf2, 0x02, 0x18, 0x16, 0x0c, 0x68, 0x53, 0xe6, 0x21, 0x0f, 0x41, 0xd0, 0x10, 0x19, 0x63, 0xfe, 0xe3, 0x91, 0x5b, 0x9a, 0x8c, 0x71, 0x76, 0x24, 0xdf, 0x34, 0x2d, 0x13, 0x86, 0x6d, 0xdd, 0x17, 0x5b, 0x42, 0x8b, 0xc3, 0x8d, 0x21, 0x3d, 0x6b, 0xf5, 0xc7, 0xd3, -}; +}); -extern const size_t sTestCert_Node02_06_PublicKey_Len = sizeof(sTestCert_Node02_06_PublicKey); - -extern const uint8_t sTestCert_Node02_06_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node02_06_PrivateKey((const uint8_t[]){ 0xc0, 0x97, 0xfd, 0xf9, 0x76, 0x3b, 0x72, 0x8e, 0x91, 0x8a, 0x54, 0x46, 0xc4, 0x93, 0xf3, 0x33, 0xbf, 0x1d, 0x6f, 0x33, 0xa6, 0xa8, 0x03, 0xaf, 0x11, 0xda, 0x81, 0xc5, 0xf5, 0xee, 0x55, 0x8e, -}; - -extern const size_t sTestCert_Node02_06_PrivateKey_Len = sizeof(sTestCert_Node02_06_PrivateKey); +}); -extern const uint8_t sTestCert_Node02_06_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_06_SubjectKeyId((const uint8_t[]){ 0x4B, 0x04, 0x1B, 0x79, 0x7E, 0xB8, 0x1B, 0x32, 0x61, 0x9A, 0xAD, 0x60, 0x0F, 0x6C, 0xFD, 0x78, 0xCE, 0x04, 0x74, 0x28, -}; - -extern const size_t sTestCert_Node02_06_SubjectKeyId_Len = sizeof(sTestCert_Node02_06_SubjectKeyId); +}); -extern const uint8_t sTestCert_Node02_06_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_06_AuthorityKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, -}; - -extern const size_t sTestCert_Node02_06_AuthorityKeyId_Len = sizeof(sTestCert_Node02_06_AuthorityKeyId); +}); /************** Test Node02_07 Certificate ************** Certificate: @@ -2439,7 +2249,7 @@ kOYmFuqhh39HFLlvyHhvkbMD5EapZQnTYQ== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node02_07_Chip[] = { +extern constexpr ByteSpan sTestCert_Node02_07_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x60, 0x78, 0x20, 0xc0, 0x15, 0xa0, 0xd1, 0x66, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x27, 0x11, 0x07, 0x00, 0x02, 0x00, 0xde, 0xde, 0xde, 0xde, 0x27, @@ -2457,11 +2267,9 @@ extern const uint8_t sTestCert_Node02_07_Chip[] = { 0x48, 0xbc, 0x40, 0xc2, 0xc3, 0xaf, 0xcd, 0x98, 0x19, 0x54, 0x8c, 0xf8, 0xe5, 0xc2, 0x49, 0xd2, 0x7d, 0xaa, 0x5e, 0xd8, 0x86, 0x19, 0x70, 0x46, 0x95, 0xb7, 0x10, 0x50, 0xfe, 0x70, 0x1a, 0x5a, 0x67, 0x5a, 0x49, 0x55, 0x98, 0x1c, 0x28, 0x7f, 0x25, 0xf6, 0x73, 0x93, 0x8b, 0x43, 0xe7, 0x71, 0x73, 0x54, 0xf6, 0xc8, 0x2e, 0x18, -}; +}); -extern const size_t sTestCert_Node02_07_Chip_Len = sizeof(sTestCert_Node02_07_Chip); - -extern const uint8_t sTestCert_Node02_07_DER[] = { +extern constexpr ByteSpan sTestCert_Node02_07_DER((const uint8_t[]){ 0x30, 0x82, 0x02, 0x41, 0x30, 0x82, 0x01, 0xe7, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x60, 0x78, 0x20, 0xc0, 0x15, 0xa0, 0xd1, 0x66, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -2490,37 +2298,27 @@ extern const uint8_t sTestCert_Node02_07_DER[] = { 0x85, 0x48, 0xbc, 0x40, 0xc2, 0xc3, 0xaf, 0xcd, 0x98, 0x19, 0x54, 0x8c, 0xf8, 0xe5, 0xc2, 0x49, 0xd2, 0x7d, 0xaa, 0x5e, 0xd8, 0x86, 0x02, 0x20, 0x19, 0x70, 0x46, 0x95, 0xb7, 0x10, 0x50, 0xfe, 0x70, 0x1a, 0x5a, 0x67, 0x5a, 0x49, 0x55, 0x98, 0x1c, 0x28, 0x7f, 0x25, 0xf6, 0x73, 0x93, 0x8b, 0x43, 0xe7, 0x71, 0x73, 0x54, 0xf6, 0xc8, 0x2e, -}; +}); -extern const size_t sTestCert_Node02_07_DER_Len = sizeof(sTestCert_Node02_07_DER); - -extern const uint8_t sTestCert_Node02_07_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node02_07_PublicKey((const uint8_t[]){ 0x04, 0xf7, 0x3c, 0x7f, 0xe5, 0x75, 0xd8, 0xb9, 0x06, 0xd4, 0x75, 0xff, 0xf7, 0x91, 0x2e, 0xe0, 0xe1, 0xb3, 0xcd, 0x23, 0x6c, 0x32, 0x46, 0xcf, 0x2d, 0x85, 0x3d, 0xe3, 0x39, 0x84, 0xc1, 0xf4, 0x18, 0x17, 0xb1, 0xc5, 0xb5, 0x28, 0x01, 0x8f, 0x90, 0xe6, 0x26, 0x16, 0xea, 0xa1, 0x87, 0x7f, 0x47, 0x14, 0xb9, 0x6f, 0xc8, 0x78, 0x6f, 0x91, 0xb3, 0x03, 0xe4, 0x46, 0xa9, 0x65, 0x09, 0xd3, 0x61, -}; - -extern const size_t sTestCert_Node02_07_PublicKey_Len = sizeof(sTestCert_Node02_07_PublicKey); +}); -extern const uint8_t sTestCert_Node02_07_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node02_07_PrivateKey((const uint8_t[]){ 0x95, 0xa8, 0x37, 0x7f, 0xdb, 0x52, 0x56, 0x38, 0x04, 0xc0, 0x10, 0x6d, 0x11, 0x4b, 0x52, 0x74, 0x05, 0x69, 0x37, 0x9c, 0xcd, 0xc8, 0xf5, 0x76, 0x83, 0x47, 0x3d, 0xbd, 0xbc, 0x45, 0x25, 0x40, -}; - -extern const size_t sTestCert_Node02_07_PrivateKey_Len = sizeof(sTestCert_Node02_07_PrivateKey); +}); -extern const uint8_t sTestCert_Node02_07_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_07_SubjectKeyId((const uint8_t[]){ 0x77, 0x7C, 0x77, 0xB6, 0x35, 0x65, 0xDC, 0x51, 0xF3, 0x02, 0x04, 0x59, 0x63, 0xC5, 0xCE, 0xFC, 0xE7, 0x09, 0x2A, 0x1E, -}; +}); -extern const size_t sTestCert_Node02_07_SubjectKeyId_Len = sizeof(sTestCert_Node02_07_SubjectKeyId); - -extern const uint8_t sTestCert_Node02_07_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_07_AuthorityKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, -}; - -extern const size_t sTestCert_Node02_07_AuthorityKeyId_Len = sizeof(sTestCert_Node02_07_AuthorityKeyId); +}); /************** Test Node02_08 Certificate ************** Certificate: @@ -2582,7 +2380,7 @@ NE2UVUa0FPIj0nIxyag9cbOXtDIGYsD1yw== -----END EC PRIVATE KEY----- */ -extern const uint8_t sTestCert_Node02_08_Chip[] = { +extern constexpr ByteSpan sTestCert_Node02_08_Chip((const uint8_t[]){ 0x15, 0x30, 0x01, 0x08, 0x3e, 0x67, 0x94, 0x70, 0x7a, 0xec, 0xb8, 0x15, 0x24, 0x02, 0x01, 0x37, 0x03, 0x27, 0x13, 0x04, 0x00, 0x00, 0x00, 0xca, 0xca, 0xca, 0xca, 0x27, 0x15, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xfa, 0x18, 0x26, 0x04, 0xef, 0x17, 0x1b, 0x27, 0x26, 0x05, 0x6e, 0xb5, 0xb9, 0x4c, 0x37, 0x06, 0x26, 0x16, 0xa0, 0x00, 0xcf, 0xab, 0x27, 0x11, @@ -2598,11 +2396,9 @@ extern const uint8_t sTestCert_Node02_08_Chip[] = { 0xd1, 0xd8, 0xf2, 0xc5, 0xe5, 0x26, 0x37, 0xa5, 0x3e, 0xf4, 0x05, 0x4a, 0x9f, 0x18, 0xef, 0x45, 0x94, 0x3d, 0x3d, 0x23, 0x58, 0xfd, 0x7e, 0xb9, 0xcb, 0x12, 0x15, 0x04, 0xa3, 0xdc, 0x1d, 0xe4, 0x2d, 0xc0, 0xae, 0xe4, 0xf5, 0x11, 0xc0, 0x05, 0x67, 0x7c, 0x11, 0x18, 0x8b, 0x44, 0x98, 0x78, 0xbd, 0x7d, 0x69, 0x3e, 0x37, 0x82, 0x2c, 0x47, 0x18, -}; - -extern const size_t sTestCert_Node02_08_Chip_Len = sizeof(sTestCert_Node02_08_Chip); +}); -extern const uint8_t sTestCert_Node02_08_DER[] = { +extern constexpr ByteSpan sTestCert_Node02_08_DER((const uint8_t[]){ 0x30, 0x82, 0x02, 0x52, 0x30, 0x82, 0x01, 0xf7, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x08, 0x3e, 0x67, 0x94, 0x70, 0x7a, 0xec, 0xb8, 0x15, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30, 0x44, 0x31, 0x20, 0x30, 0x1e, 0x06, 0x0a, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0xa2, 0x7c, 0x01, 0x03, 0x0c, 0x10, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, 0x43, 0x41, @@ -2632,37 +2428,27 @@ extern const uint8_t sTestCert_Node02_08_DER[] = { 0xa5, 0x3e, 0xf4, 0x05, 0x4a, 0x9f, 0x18, 0xef, 0x45, 0x94, 0x3d, 0x3d, 0x23, 0x58, 0xfd, 0x7e, 0xb9, 0x02, 0x21, 0x00, 0xcb, 0x12, 0x15, 0x04, 0xa3, 0xdc, 0x1d, 0xe4, 0x2d, 0xc0, 0xae, 0xe4, 0xf5, 0x11, 0xc0, 0x05, 0x67, 0x7c, 0x11, 0x18, 0x8b, 0x44, 0x98, 0x78, 0xbd, 0x7d, 0x69, 0x3e, 0x37, 0x82, 0x2c, 0x47, -}; +}); -extern const size_t sTestCert_Node02_08_DER_Len = sizeof(sTestCert_Node02_08_DER); - -extern const uint8_t sTestCert_Node02_08_PublicKey[] = { +extern constexpr ByteSpan sTestCert_Node02_08_PublicKey((const uint8_t[]){ 0x04, 0x98, 0xca, 0x97, 0x34, 0xda, 0xaf, 0xf7, 0x33, 0x98, 0x33, 0x6d, 0xc0, 0xa4, 0xde, 0x89, 0x2d, 0xe6, 0x2a, 0x1f, 0x96, 0x90, 0x23, 0xe0, 0x33, 0x70, 0x86, 0x00, 0x85, 0xdc, 0xdc, 0x07, 0x2b, 0x23, 0x72, 0x60, 0x79, 0x37, 0xba, 0x3a, 0x34, 0x4d, 0x94, 0x55, 0x46, 0xb4, 0x14, 0xf2, 0x23, 0xd2, 0x72, 0x31, 0xc9, 0xa8, 0x3d, 0x71, 0xb3, 0x97, 0xb4, 0x32, 0x06, 0x62, 0xc0, 0xf5, 0xcb, -}; - -extern const size_t sTestCert_Node02_08_PublicKey_Len = sizeof(sTestCert_Node02_08_PublicKey); +}); -extern const uint8_t sTestCert_Node02_08_PrivateKey[] = { +extern constexpr ByteSpan sTestCert_Node02_08_PrivateKey((const uint8_t[]){ 0xdf, 0x8b, 0x10, 0x34, 0x18, 0x5b, 0xb0, 0xed, 0x9b, 0xcc, 0x39, 0xb5, 0xaf, 0xc0, 0xec, 0x9b, 0xd5, 0x6f, 0x4a, 0x76, 0x5d, 0xe9, 0x9f, 0x69, 0x9b, 0xb0, 0x9a, 0xf6, 0xcf, 0x3a, 0xf7, 0x6f, -}; - -extern const size_t sTestCert_Node02_08_PrivateKey_Len = sizeof(sTestCert_Node02_08_PrivateKey); +}); -extern const uint8_t sTestCert_Node02_08_SubjectKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_08_SubjectKeyId((const uint8_t[]){ 0xA9, 0xC5, 0xFD, 0x6C, 0xBD, 0x38, 0xBB, 0x18, 0x37, 0x0F, 0x8E, 0x80, 0x64, 0x16, 0x6A, 0xFB, 0x1E, 0xC8, 0x39, 0x73, -}; +}); -extern const size_t sTestCert_Node02_08_SubjectKeyId_Len = sizeof(sTestCert_Node02_08_SubjectKeyId); - -extern const uint8_t sTestCert_Node02_08_AuthorityKeyId[] = { +extern constexpr ByteSpan sTestCert_Node02_08_AuthorityKeyId((const uint8_t[]){ 0xE1, 0xE7, 0x6E, 0x67, 0x77, 0x85, 0x1D, 0xD7, 0x74, 0x16, 0xBD, 0xDD, 0x35, 0xEC, 0x3C, 0x13, 0x7C, 0x47, 0x29, 0xDC, -}; - -extern const size_t sTestCert_Node02_08_AuthorityKeyId_Len = sizeof(sTestCert_Node02_08_AuthorityKeyId); +}); } // namespace TestCerts } // namespace chip diff --git a/src/credentials/tests/CHIPCert_test_vectors.h b/src/credentials/tests/CHIPCert_test_vectors.h index 2793fd8d5ef867..dc717f396eeccb 100644 --- a/src/credentials/tests/CHIPCert_test_vectors.h +++ b/src/credentials/tests/CHIPCert_test_vectors.h @@ -81,229 +81,126 @@ extern const size_t gNumTestCerts; // ------------------------------ DECLARATIONS ---------------------------------------- -extern const uint8_t sTestCert_Root01_Chip[]; -extern const size_t sTestCert_Root01_Chip_Len; -extern const uint8_t sTestCert_Root01_DER[]; -extern const size_t sTestCert_Root01_DER_Len; -extern const uint8_t sTestCert_Root01_PublicKey[]; -extern const size_t sTestCert_Root01_PublicKey_Len; -extern const uint8_t sTestCert_Root01_PrivateKey[]; -extern const size_t sTestCert_Root01_PrivateKey_Len; -extern const uint8_t sTestCert_Root01_SubjectKeyId[]; -extern const size_t sTestCert_Root01_SubjectKeyId_Len; -extern const uint8_t sTestCert_Root01_AuthorityKeyId[]; -extern const size_t sTestCert_Root01_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Root02_Chip[]; -extern const size_t sTestCert_Root02_Chip_Len; -extern const uint8_t sTestCert_Root02_DER[]; -extern const size_t sTestCert_Root02_DER_Len; -extern const uint8_t sTestCert_Root02_PublicKey[]; -extern const size_t sTestCert_Root02_PublicKey_Len; -extern const uint8_t sTestCert_Root02_PrivateKey[]; -extern const size_t sTestCert_Root02_PrivateKey_Len; -extern const uint8_t sTestCert_Root02_SubjectKeyId[]; -extern const size_t sTestCert_Root02_SubjectKeyId_Len; -extern const uint8_t sTestCert_Root02_AuthorityKeyId[]; -extern const size_t sTestCert_Root02_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Root03_Chip[]; -extern const size_t sTestCert_Root03_Chip_Len; -extern const uint8_t sTestCert_Root03_DER[]; -extern const size_t sTestCert_Root03_DER_Len; -extern const uint8_t sTestCert_Root03_PublicKey[]; -extern const size_t sTestCert_Root03_PublicKey_Len; -extern const uint8_t sTestCert_Root03_PrivateKey[]; -extern const size_t sTestCert_Root03_PrivateKey_Len; -extern const uint8_t sTestCert_Root03_SubjectKeyId[]; -extern const size_t sTestCert_Root03_SubjectKeyId_Len; -extern const uint8_t sTestCert_Root03_AuthorityKeyId[]; -extern const size_t sTestCert_Root03_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_ICA01_Chip[]; -extern const size_t sTestCert_ICA01_Chip_Len; -extern const uint8_t sTestCert_ICA01_DER[]; -extern const size_t sTestCert_ICA01_DER_Len; -extern const uint8_t sTestCert_ICA01_PublicKey[]; -extern const size_t sTestCert_ICA01_PublicKey_Len; -extern const uint8_t sTestCert_ICA01_PrivateKey[]; -extern const size_t sTestCert_ICA01_PrivateKey_Len; -extern const uint8_t sTestCert_ICA01_SubjectKeyId[]; -extern const size_t sTestCert_ICA01_SubjectKeyId_Len; -extern const uint8_t sTestCert_ICA01_AuthorityKeyId[]; -extern const size_t sTestCert_ICA01_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_ICA02_Chip[]; -extern const size_t sTestCert_ICA02_Chip_Len; -extern const uint8_t sTestCert_ICA02_DER[]; -extern const size_t sTestCert_ICA02_DER_Len; -extern const uint8_t sTestCert_ICA02_PublicKey[]; -extern const size_t sTestCert_ICA02_PublicKey_Len; -extern const uint8_t sTestCert_ICA02_PrivateKey[]; -extern const size_t sTestCert_ICA02_PrivateKey_Len; -extern const uint8_t sTestCert_ICA02_SubjectKeyId[]; -extern const size_t sTestCert_ICA02_SubjectKeyId_Len; -extern const uint8_t sTestCert_ICA02_AuthorityKeyId[]; -extern const size_t sTestCert_ICA02_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_ICA01_1_Chip[]; -extern const size_t sTestCert_ICA01_1_Chip_Len; -extern const uint8_t sTestCert_ICA01_1_DER[]; -extern const size_t sTestCert_ICA01_1_DER_Len; -extern const uint8_t sTestCert_ICA01_1_PublicKey[]; -extern const size_t sTestCert_ICA01_1_PublicKey_Len; -extern const uint8_t sTestCert_ICA01_1_PrivateKey[]; -extern const size_t sTestCert_ICA01_1_PrivateKey_Len; -extern const uint8_t sTestCert_ICA01_1_SubjectKeyId[]; -extern const size_t sTestCert_ICA01_1_SubjectKeyId_Len; -extern const uint8_t sTestCert_ICA01_1_AuthorityKeyId[]; -extern const size_t sTestCert_ICA01_1_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_FWSign01_Chip[]; -extern const size_t sTestCert_FWSign01_Chip_Len; -extern const uint8_t sTestCert_FWSign01_DER[]; -extern const size_t sTestCert_FWSign01_DER_Len; -extern const uint8_t sTestCert_FWSign01_PublicKey[]; -extern const size_t sTestCert_FWSign01_PublicKey_Len; -extern const uint8_t sTestCert_FWSign01_PrivateKey[]; -extern const size_t sTestCert_FWSign01_PrivateKey_Len; -extern const uint8_t sTestCert_FWSign01_SubjectKeyId[]; -extern const size_t sTestCert_FWSign01_SubjectKeyId_Len; -extern const uint8_t sTestCert_FWSign01_AuthorityKeyId[]; -extern const size_t sTestCert_FWSign01_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node01_01_Chip[]; -extern const size_t sTestCert_Node01_01_Chip_Len; -extern const uint8_t sTestCert_Node01_01_DER[]; -extern const size_t sTestCert_Node01_01_DER_Len; -extern const uint8_t sTestCert_Node01_01_PublicKey[]; -extern const size_t sTestCert_Node01_01_PublicKey_Len; -extern const uint8_t sTestCert_Node01_01_PrivateKey[]; -extern const size_t sTestCert_Node01_01_PrivateKey_Len; -extern const uint8_t sTestCert_Node01_01_SubjectKeyId[]; -extern const size_t sTestCert_Node01_01_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node01_01_AuthorityKeyId[]; -extern const size_t sTestCert_Node01_01_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node01_01_Err01_Chip[]; -extern const size_t sTestCert_Node01_01_Err01_Chip_Len; - -extern const uint8_t sTestCert_Node01_02_Chip[]; -extern const size_t sTestCert_Node01_02_Chip_Len; -extern const uint8_t sTestCert_Node01_02_DER[]; -extern const size_t sTestCert_Node01_02_DER_Len; -extern const uint8_t sTestCert_Node01_02_PublicKey[]; -extern const size_t sTestCert_Node01_02_PublicKey_Len; -extern const uint8_t sTestCert_Node01_02_PrivateKey[]; -extern const size_t sTestCert_Node01_02_PrivateKey_Len; -extern const uint8_t sTestCert_Node01_02_SubjectKeyId[]; -extern const size_t sTestCert_Node01_02_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node01_02_AuthorityKeyId[]; -extern const size_t sTestCert_Node01_02_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node02_01_Chip[]; -extern const size_t sTestCert_Node02_01_Chip_Len; -extern const uint8_t sTestCert_Node02_01_DER[]; -extern const size_t sTestCert_Node02_01_DER_Len; -extern const uint8_t sTestCert_Node02_01_PublicKey[]; -extern const size_t sTestCert_Node02_01_PublicKey_Len; -extern const uint8_t sTestCert_Node02_01_PrivateKey[]; -extern const size_t sTestCert_Node02_01_PrivateKey_Len; -extern const uint8_t sTestCert_Node02_01_SubjectKeyId[]; -extern const size_t sTestCert_Node02_01_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node02_01_AuthorityKeyId[]; -extern const size_t sTestCert_Node02_01_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node02_02_Chip[]; -extern const size_t sTestCert_Node02_02_Chip_Len; -extern const uint8_t sTestCert_Node02_02_DER[]; -extern const size_t sTestCert_Node02_02_DER_Len; -extern const uint8_t sTestCert_Node02_02_PublicKey[]; -extern const size_t sTestCert_Node02_02_PublicKey_Len; -extern const uint8_t sTestCert_Node02_02_PrivateKey[]; -extern const size_t sTestCert_Node02_02_PrivateKey_Len; -extern const uint8_t sTestCert_Node02_02_SubjectKeyId[]; -extern const size_t sTestCert_Node02_02_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node02_02_AuthorityKeyId[]; -extern const size_t sTestCert_Node02_02_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node02_03_Chip[]; -extern const size_t sTestCert_Node02_03_Chip_Len; -extern const uint8_t sTestCert_Node02_03_DER[]; -extern const size_t sTestCert_Node02_03_DER_Len; -extern const uint8_t sTestCert_Node02_03_PublicKey[]; -extern const size_t sTestCert_Node02_03_PublicKey_Len; -extern const uint8_t sTestCert_Node02_03_PrivateKey[]; -extern const size_t sTestCert_Node02_03_PrivateKey_Len; -extern const uint8_t sTestCert_Node02_03_SubjectKeyId[]; -extern const size_t sTestCert_Node02_03_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node02_03_AuthorityKeyId[]; -extern const size_t sTestCert_Node02_03_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node02_04_Chip[]; -extern const size_t sTestCert_Node02_04_Chip_Len; -extern const uint8_t sTestCert_Node02_04_DER[]; -extern const size_t sTestCert_Node02_04_DER_Len; -extern const uint8_t sTestCert_Node02_04_PublicKey[]; -extern const size_t sTestCert_Node02_04_PublicKey_Len; -extern const uint8_t sTestCert_Node02_04_PrivateKey[]; -extern const size_t sTestCert_Node02_04_PrivateKey_Len; -extern const uint8_t sTestCert_Node02_04_SubjectKeyId[]; -extern const size_t sTestCert_Node02_04_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node02_04_AuthorityKeyId[]; -extern const size_t sTestCert_Node02_04_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node02_05_Chip[]; -extern const size_t sTestCert_Node02_05_Chip_Len; -extern const uint8_t sTestCert_Node02_05_DER[]; -extern const size_t sTestCert_Node02_05_DER_Len; -extern const uint8_t sTestCert_Node02_05_PublicKey[]; -extern const size_t sTestCert_Node02_05_PublicKey_Len; -extern const uint8_t sTestCert_Node02_05_PrivateKey[]; -extern const size_t sTestCert_Node02_05_PrivateKey_Len; -extern const uint8_t sTestCert_Node02_05_SubjectKeyId[]; -extern const size_t sTestCert_Node02_05_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node02_05_AuthorityKeyId[]; -extern const size_t sTestCert_Node02_05_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node02_06_Chip[]; -extern const size_t sTestCert_Node02_06_Chip_Len; -extern const uint8_t sTestCert_Node02_06_DER[]; -extern const size_t sTestCert_Node02_06_DER_Len; -extern const uint8_t sTestCert_Node02_06_PublicKey[]; -extern const size_t sTestCert_Node02_06_PublicKey_Len; -extern const uint8_t sTestCert_Node02_06_PrivateKey[]; -extern const size_t sTestCert_Node02_06_PrivateKey_Len; -extern const uint8_t sTestCert_Node02_06_SubjectKeyId[]; -extern const size_t sTestCert_Node02_06_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node02_06_AuthorityKeyId[]; -extern const size_t sTestCert_Node02_06_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node02_07_Chip[]; -extern const size_t sTestCert_Node02_07_Chip_Len; -extern const uint8_t sTestCert_Node02_07_DER[]; -extern const size_t sTestCert_Node02_07_DER_Len; -extern const uint8_t sTestCert_Node02_07_PublicKey[]; -extern const size_t sTestCert_Node02_07_PublicKey_Len; -extern const uint8_t sTestCert_Node02_07_PrivateKey[]; -extern const size_t sTestCert_Node02_07_PrivateKey_Len; -extern const uint8_t sTestCert_Node02_07_SubjectKeyId[]; -extern const size_t sTestCert_Node02_07_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node02_07_AuthorityKeyId[]; -extern const size_t sTestCert_Node02_07_AuthorityKeyId_Len; - -extern const uint8_t sTestCert_Node02_08_Chip[]; -extern const size_t sTestCert_Node02_08_Chip_Len; -extern const uint8_t sTestCert_Node02_08_DER[]; -extern const size_t sTestCert_Node02_08_DER_Len; -extern const uint8_t sTestCert_Node02_08_PublicKey[]; -extern const size_t sTestCert_Node02_08_PublicKey_Len; -extern const uint8_t sTestCert_Node02_08_PrivateKey[]; -extern const size_t sTestCert_Node02_08_PrivateKey_Len; -extern const uint8_t sTestCert_Node02_08_SubjectKeyId[]; -extern const size_t sTestCert_Node02_08_SubjectKeyId_Len; -extern const uint8_t sTestCert_Node02_08_AuthorityKeyId[]; -extern const size_t sTestCert_Node02_08_AuthorityKeyId_Len; +extern const ByteSpan sTestCert_Root01_Chip; +extern const ByteSpan sTestCert_Root01_DER; +extern const ByteSpan sTestCert_Root01_PublicKey; +extern const ByteSpan sTestCert_Root01_PrivateKey; +extern const ByteSpan sTestCert_Root01_SubjectKeyId; +extern const ByteSpan sTestCert_Root01_AuthorityKeyId; + +extern const ByteSpan sTestCert_Root02_Chip; +extern const ByteSpan sTestCert_Root02_DER; +extern const ByteSpan sTestCert_Root02_PublicKey; +extern const ByteSpan sTestCert_Root02_PrivateKey; +extern const ByteSpan sTestCert_Root02_SubjectKeyId; +extern const ByteSpan sTestCert_Root02_AuthorityKeyId; + +extern const ByteSpan sTestCert_Root03_Chip; +extern const ByteSpan sTestCert_Root03_DER; +extern const ByteSpan sTestCert_Root03_PublicKey; +extern const ByteSpan sTestCert_Root03_PrivateKey; +extern const ByteSpan sTestCert_Root03_SubjectKeyId; +extern const ByteSpan sTestCert_Root03_AuthorityKeyId; + +extern const ByteSpan sTestCert_ICA01_Chip; +extern const ByteSpan sTestCert_ICA01_DER; +extern const ByteSpan sTestCert_ICA01_PublicKey; +extern const ByteSpan sTestCert_ICA01_PrivateKey; +extern const ByteSpan sTestCert_ICA01_SubjectKeyId; +extern const ByteSpan sTestCert_ICA01_AuthorityKeyId; + +extern const ByteSpan sTestCert_ICA02_Chip; +extern const ByteSpan sTestCert_ICA02_DER; +extern const ByteSpan sTestCert_ICA02_PublicKey; +extern const ByteSpan sTestCert_ICA02_PrivateKey; +extern const ByteSpan sTestCert_ICA02_SubjectKeyId; +extern const ByteSpan sTestCert_ICA02_AuthorityKeyId; + +extern const ByteSpan sTestCert_ICA01_1_Chip; +extern const ByteSpan sTestCert_ICA01_1_DER; +extern const ByteSpan sTestCert_ICA01_1_PublicKey; +extern const ByteSpan sTestCert_ICA01_1_PrivateKey; +extern const ByteSpan sTestCert_ICA01_1_SubjectKeyId; +extern const ByteSpan sTestCert_ICA01_1_AuthorityKeyId; + +extern const ByteSpan sTestCert_FWSign01_Chip; +extern const ByteSpan sTestCert_FWSign01_DER; +extern const ByteSpan sTestCert_FWSign01_PublicKey; +extern const ByteSpan sTestCert_FWSign01_PrivateKey; +extern const ByteSpan sTestCert_FWSign01_SubjectKeyId; +extern const ByteSpan sTestCert_FWSign01_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node01_01_Chip; +extern const ByteSpan sTestCert_Node01_01_DER; +extern const ByteSpan sTestCert_Node01_01_PublicKey; +extern const ByteSpan sTestCert_Node01_01_PrivateKey; +extern const ByteSpan sTestCert_Node01_01_SubjectKeyId; +extern const ByteSpan sTestCert_Node01_01_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node01_01_Err01_Chip; + +extern const ByteSpan sTestCert_Node01_02_Chip; +extern const ByteSpan sTestCert_Node01_02_DER; +extern const ByteSpan sTestCert_Node01_02_PublicKey; +extern const ByteSpan sTestCert_Node01_02_PrivateKey; +extern const ByteSpan sTestCert_Node01_02_SubjectKeyId; +extern const ByteSpan sTestCert_Node01_02_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node02_01_Chip; +extern const ByteSpan sTestCert_Node02_01_DER; +extern const ByteSpan sTestCert_Node02_01_PublicKey; +extern const ByteSpan sTestCert_Node02_01_PrivateKey; +extern const ByteSpan sTestCert_Node02_01_SubjectKeyId; +extern const ByteSpan sTestCert_Node02_01_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node02_02_Chip; +extern const ByteSpan sTestCert_Node02_02_DER; +extern const ByteSpan sTestCert_Node02_02_PublicKey; +extern const ByteSpan sTestCert_Node02_02_PrivateKey; +extern const ByteSpan sTestCert_Node02_02_SubjectKeyId; +extern const ByteSpan sTestCert_Node02_02_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node02_03_Chip; +extern const ByteSpan sTestCert_Node02_03_DER; +extern const ByteSpan sTestCert_Node02_03_PublicKey; +extern const ByteSpan sTestCert_Node02_03_PrivateKey; +extern const ByteSpan sTestCert_Node02_03_SubjectKeyId; +extern const ByteSpan sTestCert_Node02_03_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node02_04_Chip; +extern const ByteSpan sTestCert_Node02_04_DER; +extern const ByteSpan sTestCert_Node02_04_PublicKey; +extern const ByteSpan sTestCert_Node02_04_PrivateKey; +extern const ByteSpan sTestCert_Node02_04_SubjectKeyId; +extern const ByteSpan sTestCert_Node02_04_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node02_05_Chip; +extern const ByteSpan sTestCert_Node02_05_DER; +extern const ByteSpan sTestCert_Node02_05_PublicKey; +extern const ByteSpan sTestCert_Node02_05_PrivateKey; +extern const ByteSpan sTestCert_Node02_05_SubjectKeyId; +extern const ByteSpan sTestCert_Node02_05_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node02_06_Chip; +extern const ByteSpan sTestCert_Node02_06_DER; +extern const ByteSpan sTestCert_Node02_06_PublicKey; +extern const ByteSpan sTestCert_Node02_06_PrivateKey; +extern const ByteSpan sTestCert_Node02_06_SubjectKeyId; +extern const ByteSpan sTestCert_Node02_06_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node02_07_Chip; +extern const ByteSpan sTestCert_Node02_07_DER; +extern const ByteSpan sTestCert_Node02_07_PublicKey; +extern const ByteSpan sTestCert_Node02_07_PrivateKey; +extern const ByteSpan sTestCert_Node02_07_SubjectKeyId; +extern const ByteSpan sTestCert_Node02_07_AuthorityKeyId; + +extern const ByteSpan sTestCert_Node02_08_Chip; +extern const ByteSpan sTestCert_Node02_08_DER; +extern const ByteSpan sTestCert_Node02_08_PublicKey; +extern const ByteSpan sTestCert_Node02_08_PrivateKey; +extern const ByteSpan sTestCert_Node02_08_SubjectKeyId; +extern const ByteSpan sTestCert_Node02_08_AuthorityKeyId; } // namespace TestCerts } // namespace chip diff --git a/src/credentials/tests/TestChipCert.cpp b/src/credentials/tests/TestChipCert.cpp index e17de88eee1817..b81b8376fad974 100644 --- a/src/credentials/tests/TestChipCert.cpp +++ b/src/credentials/tests/TestChipCert.cpp @@ -186,7 +186,7 @@ static void TestChipCert_ChipToX509(nlTestSuite * inSuite, void * inContext) // Error Case: MutableByteSpan outCert(outCertBuf); - err = ConvertChipCertToX509Cert(ByteSpan(sTestCert_Node01_01_Err01_Chip, sTestCert_Node01_01_Err01_Chip_Len), outCert); + err = ConvertChipCertToX509Cert(sTestCert_Node01_01_Err01_Chip, outCert); NL_TEST_ASSERT(inSuite, err == CHIP_ERROR_INVALID_TLV_TAG); } @@ -2059,12 +2059,12 @@ static void TestChipCert_ExtractPublicKeyAndSKID(nlTestSuite * inSuite, void * i struct TestCase { uint8_t Cert; - const uint8_t * ExpectedPublicKey; - const uint8_t * ExpectedSKID; + ByteSpan ExpectedPublicKey; + ByteSpan ExpectedSKID; }; // clang-format off - static constexpr TestCase sTestCases[] = { + static const TestCase sTestCases[] = { // Cert ExpectedPublicKey ExpectedSKID // ======================================================================================= { TestCert::kRoot01, sTestCert_Root01_PublicKey, sTestCert_Root01_SubjectKeyId }, @@ -2094,12 +2094,12 @@ static void TestChipCert_ExtractPublicKeyAndSKID(nlTestSuite * inSuite, void * i P256PublicKeySpan publicKey; err = ExtractPublicKeyFromChipCert(cert, publicKey); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, publicKey.data_equal(P256PublicKeySpan(testCase.ExpectedPublicKey))); + NL_TEST_ASSERT(inSuite, publicKey.data_equal(testCase.ExpectedPublicKey)); CertificateKeyId skid; err = ExtractSKIDFromChipCert(cert, skid); NL_TEST_ASSERT(inSuite, err == CHIP_NO_ERROR); - NL_TEST_ASSERT(inSuite, skid.data_equal(CertificateKeyId(testCase.ExpectedSKID))); + NL_TEST_ASSERT(inSuite, skid.data_equal(testCase.ExpectedSKID)); } } diff --git a/src/credentials/tests/TestFabricTable.cpp b/src/credentials/tests/TestFabricTable.cpp index bb7cfb910c8f73..3bcb5411560e7a 100644 --- a/src/credentials/tests/TestFabricTable.cpp +++ b/src/credentials/tests/TestFabricTable.cpp @@ -89,16 +89,17 @@ static CHIP_ERROR LoadTestFabric_Node01_01(nlTestSuite * inSuite, FabricTable & static Crypto::P256Keypair opKey_Node01_01; FabricIndex fabricIndex; - memcpy(opKeysSerialized.Bytes(), TestCerts::sTestCert_Node01_01_PublicKey, TestCerts::sTestCert_Node01_01_PublicKey_Len); - memcpy(opKeysSerialized.Bytes() + TestCerts::sTestCert_Node01_01_PublicKey_Len, TestCerts::sTestCert_Node01_01_PrivateKey, - TestCerts::sTestCert_Node01_01_PrivateKey_Len); + memcpy(opKeysSerialized.Bytes(), TestCerts::sTestCert_Node01_01_PublicKey.data(), + TestCerts::sTestCert_Node01_01_PublicKey.size()); + memcpy(opKeysSerialized.Bytes() + TestCerts::sTestCert_Node01_01_PublicKey.size(), + TestCerts::sTestCert_Node01_01_PrivateKey.data(), TestCerts::sTestCert_Node01_01_PrivateKey.size()); - ByteSpan rcacSpan(TestCerts::sTestCert_Root01_Chip, TestCerts::sTestCert_Root01_Chip_Len); - ByteSpan icacSpan(TestCerts::sTestCert_ICA01_Chip, TestCerts::sTestCert_ICA01_Chip_Len); - ByteSpan nocSpan(TestCerts::sTestCert_Node01_01_Chip, TestCerts::sTestCert_Node01_01_Chip_Len); + ByteSpan rcacSpan(TestCerts::sTestCert_Root01_Chip); + ByteSpan icacSpan(TestCerts::sTestCert_ICA01_Chip); + ByteSpan nocSpan(TestCerts::sTestCert_Node01_01_Chip); - ReturnErrorOnFailure( - opKeysSerialized.SetLength(TestCerts::sTestCert_Node01_01_PublicKey_Len + TestCerts::sTestCert_Node01_01_PrivateKey_Len)); + ReturnErrorOnFailure(opKeysSerialized.SetLength(TestCerts::sTestCert_Node01_01_PublicKey.size() + + TestCerts::sTestCert_Node01_01_PrivateKey.size())); ReturnErrorOnFailure(opKey_Node01_01.Deserialize(opKeysSerialized)); ReturnErrorOnFailure(fabricTable.AddNewPendingTrustedRootCert(rcacSpan)); @@ -119,15 +120,16 @@ static CHIP_ERROR LoadTestFabric_Node01_02(nlTestSuite * inSuite, FabricTable & FabricIndex fabricIndex; static Crypto::P256Keypair opKey_Node01_02; - memcpy(opKeysSerialized.Bytes(), TestCerts::sTestCert_Node01_02_PublicKey, TestCerts::sTestCert_Node01_02_PublicKey_Len); - memcpy(opKeysSerialized.Bytes() + TestCerts::sTestCert_Node01_02_PublicKey_Len, TestCerts::sTestCert_Node01_02_PrivateKey, - TestCerts::sTestCert_Node01_02_PrivateKey_Len); + memcpy(opKeysSerialized.Bytes(), TestCerts::sTestCert_Node01_02_PublicKey.data(), + TestCerts::sTestCert_Node01_02_PublicKey.size()); + memcpy(opKeysSerialized.Bytes() + TestCerts::sTestCert_Node01_02_PublicKey.size(), + TestCerts::sTestCert_Node01_02_PrivateKey.data(), TestCerts::sTestCert_Node01_02_PrivateKey.size()); - ByteSpan rcacSpan(TestCerts::sTestCert_Root01_Chip, TestCerts::sTestCert_Root01_Chip_Len); - ByteSpan nocSpan(TestCerts::sTestCert_Node01_02_Chip, TestCerts::sTestCert_Node01_02_Chip_Len); + ByteSpan rcacSpan(TestCerts::sTestCert_Root01_Chip); + ByteSpan nocSpan(TestCerts::sTestCert_Node01_02_Chip); - ReturnErrorOnFailure( - opKeysSerialized.SetLength(TestCerts::sTestCert_Node01_02_PublicKey_Len + TestCerts::sTestCert_Node01_02_PrivateKey_Len)); + ReturnErrorOnFailure(opKeysSerialized.SetLength(TestCerts::sTestCert_Node01_02_PublicKey.size() + + TestCerts::sTestCert_Node01_02_PrivateKey.size())); ReturnErrorOnFailure(opKey_Node01_02.Deserialize(opKeysSerialized)); ReturnErrorOnFailure(fabricTable.AddNewPendingTrustedRootCert(rcacSpan)); @@ -152,17 +154,18 @@ static CHIP_ERROR LoadTestFabric_Node02_01(nlTestSuite * inSuite, FabricTable & FabricIndex fabricIndex; static Crypto::P256Keypair opKey_Node02_01; - memcpy(opKeysSerialized.Bytes(), TestCerts::sTestCert_Node02_01_PublicKey, TestCerts::sTestCert_Node02_01_PublicKey_Len); - memcpy(opKeysSerialized.Bytes() + TestCerts::sTestCert_Node02_01_PublicKey_Len, TestCerts::sTestCert_Node02_01_PrivateKey, - TestCerts::sTestCert_Node02_01_PrivateKey_Len); + memcpy(opKeysSerialized.Bytes(), TestCerts::sTestCert_Node02_01_PublicKey.data(), + TestCerts::sTestCert_Node02_01_PublicKey.size()); + memcpy(opKeysSerialized.Bytes() + TestCerts::sTestCert_Node02_01_PublicKey.size(), + TestCerts::sTestCert_Node02_01_PrivateKey.data(), TestCerts::sTestCert_Node02_01_PrivateKey.size()); - ByteSpan rcacSpan(TestCerts::sTestCert_Root02_Chip, TestCerts::sTestCert_Root02_Chip_Len); - ByteSpan icacSpan(TestCerts::sTestCert_ICA02_Chip, TestCerts::sTestCert_ICA02_Chip_Len); - ByteSpan nocSpan(TestCerts::sTestCert_Node02_01_Chip, TestCerts::sTestCert_Node02_01_Chip_Len); + ByteSpan rcacSpan(TestCerts::sTestCert_Root02_Chip); + ByteSpan icacSpan(TestCerts::sTestCert_ICA02_Chip); + ByteSpan nocSpan(TestCerts::sTestCert_Node02_01_Chip); NL_TEST_ASSERT(inSuite, - opKeysSerialized.SetLength(TestCerts::sTestCert_Node02_01_PublicKey_Len + - TestCerts::sTestCert_Node02_01_PrivateKey_Len) == CHIP_NO_ERROR); + opKeysSerialized.SetLength(TestCerts::sTestCert_Node02_01_PublicKey.size() + + TestCerts::sTestCert_Node02_01_PrivateKey.size()) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, opKey_Node02_01.Deserialize(opKeysSerialized) == CHIP_NO_ERROR); NL_TEST_ASSERT(inSuite, fabricTable.AddNewPendingTrustedRootCert(rcacSpan) == CHIP_NO_ERROR); @@ -218,7 +221,7 @@ void TestCollidingFabrics(nlTestSuite * inSuite, void * inContext) fabricTable.PermitCollidingFabrics(); NL_TEST_ASSERT(inSuite, LoadTestFabric_Node01_02(inSuite, fabricTable, /* doCommit = */ true) == CHIP_NO_ERROR); - ByteSpan rcacSpan(TestCerts::sTestCert_Root01_Chip, TestCerts::sTestCert_Root01_Chip_Len); + ByteSpan rcacSpan(TestCerts::sTestCert_Root01_Chip); Credentials::P256PublicKeySpan rootPublicKeySpan; NL_TEST_ASSERT(inSuite, Credentials::ExtractPublicKeyFromChipCert(rcacSpan, rootPublicKeySpan) == CHIP_NO_ERROR); @@ -228,7 +231,7 @@ void TestCollidingFabrics(nlTestSuite * inSuite, void * inContext) // { chip::Platform::ScopedMemoryBuffer nocBuf; - ByteSpan origNocSpan(TestCerts::sTestCert_Node01_01_Chip, TestCerts::sTestCert_Node01_01_Chip_Len); + ByteSpan origNocSpan(TestCerts::sTestCert_Node01_01_Chip); NodeId nodeId; FabricId fabricId; @@ -238,7 +241,7 @@ void TestCollidingFabrics(nlTestSuite * inSuite, void * inContext) { chip::Platform::ScopedMemoryBuffer nocBuf; - ByteSpan origNocSpan(TestCerts::sTestCert_Node01_02_Chip, TestCerts::sTestCert_Node01_02_Chip_Len); + ByteSpan origNocSpan(TestCerts::sTestCert_Node01_02_Chip); NodeId nodeId; FabricId fabricId; @@ -2357,12 +2360,12 @@ void TestFabricLookup(nlTestSuite * inSuite, void * inContext) // Attempt lookup of the Root01 fabric. { Crypto::P256PublicKey key; - NL_TEST_ASSERT(inSuite, key.Length() >= TestCerts::sTestCert_Root01_PublicKey_Len); - if (key.Length() < TestCerts::sTestCert_Root01_PublicKey_Len) + NL_TEST_ASSERT(inSuite, key.Length() >= TestCerts::sTestCert_Root01_PublicKey.size()); + if (key.Length() < TestCerts::sTestCert_Root01_PublicKey.size()) { return; } - memcpy(key.Bytes(), TestCerts::sTestCert_Root01_PublicKey, TestCerts::sTestCert_Root01_PublicKey_Len); + memcpy(key.Bytes(), TestCerts::sTestCert_Root01_PublicKey.data(), TestCerts::sTestCert_Root01_PublicKey.size()); auto fabricInfo = fabricTable.FindFabric(key, 0xFAB000000000001D); NL_TEST_ASSERT(inSuite, fabricInfo != nullptr); if (fabricInfo == nullptr) @@ -2376,12 +2379,12 @@ void TestFabricLookup(nlTestSuite * inSuite, void * inContext) // Attempt lookup of the Root02 fabric. { Crypto::P256PublicKey key; - NL_TEST_ASSERT(inSuite, key.Length() >= TestCerts::sTestCert_Root02_PublicKey_Len); - if (key.Length() < TestCerts::sTestCert_Root02_PublicKey_Len) + NL_TEST_ASSERT(inSuite, key.Length() >= TestCerts::sTestCert_Root02_PublicKey.size()); + if (key.Length() < TestCerts::sTestCert_Root02_PublicKey.size()) { return; } - memcpy(key.Bytes(), TestCerts::sTestCert_Root02_PublicKey, TestCerts::sTestCert_Root02_PublicKey_Len); + memcpy(key.Bytes(), TestCerts::sTestCert_Root02_PublicKey.data(), TestCerts::sTestCert_Root02_PublicKey.size()); auto fabricInfo = fabricTable.FindFabric(key, 0xFAB000000000001D); NL_TEST_ASSERT(inSuite, fabricInfo != nullptr); if (fabricInfo == nullptr) diff --git a/src/crypto/tests/CHIPCryptoPALTest.cpp b/src/crypto/tests/CHIPCryptoPALTest.cpp index 98be91ee13c706..4c4b37d39bddf7 100644 --- a/src/crypto/tests/CHIPCryptoPALTest.cpp +++ b/src/crypto/tests/CHIPCryptoPALTest.cpp @@ -2104,7 +2104,7 @@ static void TestX509_CertChainValidation(nlTestSuite * inSuite, void * inContext { sTestCert_PAA_FFF2_ValInPast_Cert, sTestCert_PAI_FFF2_8006_ValInPast_Cert, sTestCert_DAC_FFF2_8006_0024_ValInPast_Cert, CHIP_NO_ERROR, CertificateChainValidationResult::kSuccess }, { sTestCert_PAA_FFF2_ValInFuture_Cert, sTestCert_PAI_FFF2_8006_ValInFuture_Cert, sTestCert_DAC_FFF2_8006_0025_ValInFuture_Cert, CHIP_NO_ERROR, CertificateChainValidationResult::kSuccess }, // Valid cases without intermediate: - { ByteSpan(sTestCert_Root01_DER, sTestCert_Root01_DER_Len), ByteSpan(), ByteSpan(sTestCert_Node01_02_DER, sTestCert_Node01_02_DER_Len), CHIP_NO_ERROR, CertificateChainValidationResult::kSuccess }, + { sTestCert_Root01_DER, ByteSpan(), sTestCert_Node01_02_DER, CHIP_NO_ERROR, CertificateChainValidationResult::kSuccess }, // Error cases with invalid (empty Span) inputs: { ByteSpan(), sTestCert_PAI_FFF1_8000_Cert, sTestCert_DAC_FFF1_8000_0000_Cert, CHIP_ERROR_INVALID_ARGUMENT, CertificateChainValidationResult::kRootArgumentInvalid }, { sTestCert_PAA_FFF1_Cert, sTestCert_PAI_FFF1_8000_Cert, ByteSpan(), CHIP_ERROR_INVALID_ARGUMENT, CertificateChainValidationResult::kLeafArgumentInvalid }, diff --git a/src/protocols/secure_channel/tests/TestCASESession.cpp b/src/protocols/secure_channel/tests/TestCASESession.cpp index c0a6e6ac2c5b48..b4e090d3eb6b93 100644 --- a/src/protocols/secure_channel/tests/TestCASESession.cpp +++ b/src/protocols/secure_channel/tests/TestCASESession.cpp @@ -252,15 +252,16 @@ CHIP_ERROR InitCredentialSets() P256SerializedKeypair opKeysSerialized; // TODO: Rename gCommissioner* to gInitiator* - memcpy(opKeysSerialized.Bytes(), sTestCert_Node01_02_PublicKey, sTestCert_Node01_02_PublicKey_Len); - memcpy(opKeysSerialized.Bytes() + sTestCert_Node01_02_PublicKey_Len, sTestCert_Node01_02_PrivateKey, - sTestCert_Node01_02_PrivateKey_Len); + memcpy(opKeysSerialized.Bytes(), sTestCert_Node01_02_PublicKey.data(), sTestCert_Node01_02_PublicKey.size()); + memcpy(opKeysSerialized.Bytes() + sTestCert_Node01_02_PublicKey.size(), sTestCert_Node01_02_PrivateKey.data(), + sTestCert_Node01_02_PrivateKey.size()); - ReturnErrorOnFailure(opKeysSerialized.SetLength(sTestCert_Node01_02_PublicKey_Len + sTestCert_Node01_02_PrivateKey_Len)); + ReturnErrorOnFailure( + opKeysSerialized.SetLength(sTestCert_Node01_02_PublicKey.size() + sTestCert_Node01_02_PrivateKey.size())); - chip::ByteSpan rcacSpan(sTestCert_Root01_Chip, sTestCert_Root01_Chip_Len); - chip::ByteSpan icacSpan(sTestCert_ICA01_Chip, sTestCert_ICA01_Chip_Len); - chip::ByteSpan nocSpan(sTestCert_Node01_02_Chip, sTestCert_Node01_02_Chip_Len); + chip::ByteSpan rcacSpan(sTestCert_Root01_Chip); + chip::ByteSpan icacSpan(sTestCert_ICA01_Chip); + chip::ByteSpan nocSpan(sTestCert_Node01_02_Chip); chip::ByteSpan opKeySpan(opKeysSerialized.ConstBytes(), opKeysSerialized.Length()); ReturnErrorOnFailure( @@ -281,11 +282,12 @@ CHIP_ERROR InitCredentialSets() P256SerializedKeypair opKeysSerialized; auto deviceOpKey = Platform::MakeUnique(); - memcpy(opKeysSerialized.Bytes(), sTestCert_Node01_01_PublicKey, sTestCert_Node01_01_PublicKey_Len); - memcpy(opKeysSerialized.Bytes() + sTestCert_Node01_01_PublicKey_Len, sTestCert_Node01_01_PrivateKey, - sTestCert_Node01_01_PrivateKey_Len); + memcpy(opKeysSerialized.Bytes(), sTestCert_Node01_01_PublicKey.data(), sTestCert_Node01_01_PublicKey.size()); + memcpy(opKeysSerialized.Bytes() + sTestCert_Node01_01_PublicKey.size(), sTestCert_Node01_01_PrivateKey.data(), + sTestCert_Node01_01_PrivateKey.size()); - ReturnErrorOnFailure(opKeysSerialized.SetLength(sTestCert_Node01_01_PublicKey_Len + sTestCert_Node01_01_PrivateKey_Len)); + ReturnErrorOnFailure( + opKeysSerialized.SetLength(sTestCert_Node01_01_PublicKey.size() + sTestCert_Node01_01_PrivateKey.size())); ReturnErrorOnFailure(deviceOpKey->Deserialize(opKeysSerialized)); @@ -295,9 +297,9 @@ CHIP_ERROR InitCredentialSets() ReturnErrorOnFailure( InitFabricTable(gDeviceFabrics, &gDeviceStorageDelegate, &gDeviceOperationalKeystore, &gDeviceOpCertStore)); - chip::ByteSpan rcacSpan(sTestCert_Root01_Chip, sTestCert_Root01_Chip_Len); - chip::ByteSpan icacSpan(sTestCert_ICA01_Chip, sTestCert_ICA01_Chip_Len); - chip::ByteSpan nocSpan(sTestCert_Node01_01_Chip, sTestCert_Node01_01_Chip_Len); + chip::ByteSpan rcacSpan(sTestCert_Root01_Chip); + chip::ByteSpan icacSpan(sTestCert_ICA01_Chip); + chip::ByteSpan nocSpan(sTestCert_Node01_01_Chip); ReturnErrorOnFailure(gDeviceFabrics.AddNewFabricForTest(rcacSpan, icacSpan, nocSpan, ByteSpan{}, &gDeviceFabricIndex)); } From ba85422f5977fe86a990ce4af0bb77535597f8c9 Mon Sep 17 00:00:00 2001 From: Kevin Schoedel Date: Wed, 13 Sep 2023 19:21:10 -0400 Subject: [PATCH 089/134] Fix incorrect preprocessor usage of LwIP PBUF_POOL (#29232) Configuration allowed specifying an LwIP `pbuf_type` value for `System::PacketBuffer` allocations, and code tested this configuration in preprocessor conditions; however, the LwIP names are enum constants, not preprocessor defintions. This change replaces the configuration macro with a new one selecting between `PBUF_POOL` and `PBUF_RAM`. (From PR#14257 that introduced the configuration, it does not appear that other options were ever used.) Fixes #29208 --- src/system/SystemConfig.h | 14 ++++++++++---- src/system/SystemPacketBuffer.cpp | 2 +- src/system/SystemPacketBufferInternal.h | 19 ++++++++++++++++++- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/system/SystemConfig.h b/src/system/SystemConfig.h index fba85f5caafc4f..420cefef1290f4 100644 --- a/src/system/SystemConfig.h +++ b/src/system/SystemConfig.h @@ -359,15 +359,21 @@ #endif /* CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE */ /** - * @def CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_TYPE + * @def CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM * * @brief - * LwIP @pbuf_type for System::PacketBuffer allocations. + * In LwIP builds, this selects whether to use LwIP @pbuf_type @PBUF_RAM (1) + * or @PBUF_POOL (0) for System::PacketBuffer allocations. * * Note that this does not affect allocations by LwIP itself, e.g. the normal receive path. */ -#ifndef CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_TYPE -#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_TYPE PBUF_POOL +#ifndef CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM +#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM 0 +#endif /* CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM */ + +// Catch configurations attempting to use the former method (see issue #29208). +#ifdef CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_TYPE +#error "See CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM" #endif /* CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_TYPE */ /** diff --git a/src/system/SystemPacketBuffer.cpp b/src/system/SystemPacketBuffer.cpp index 209a80b8218c18..32f4b8e3830077 100644 --- a/src/system/SystemPacketBuffer.cpp +++ b/src/system/SystemPacketBuffer.cpp @@ -501,7 +501,7 @@ PacketBufferHandle PacketBufferHandle::New(size_t aAvailableSize, uint16_t aRese #if CHIP_SYSTEM_CONFIG_USE_LWIP lPacket = static_cast( - pbuf_alloc(PBUF_RAW, static_cast(lAllocSize), CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_TYPE)); + pbuf_alloc(PBUF_RAW, static_cast(lAllocSize), CHIP_SYSTEM_PACKETBUFFER_LWIP_PBUF_TYPE)); SYSTEM_STATS_UPDATE_LWIP_PBUF_COUNTS(); diff --git a/src/system/SystemPacketBufferInternal.h b/src/system/SystemPacketBufferInternal.h index e044e0d0f3819b..b0000f4e665df9 100644 --- a/src/system/SystemPacketBufferInternal.h +++ b/src/system/SystemPacketBufferInternal.h @@ -54,12 +54,25 @@ * * True if packet buffers are allocated from an LwIP pool (either standard or custom). */ -#if CHIP_SYSTEM_CONFIG_USE_LWIP && (CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_TYPE == PBUF_POOL) +#if CHIP_SYSTEM_CONFIG_USE_LWIP && !CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM #define CHIP_SYSTEM_PACKETBUFFER_FROM_LWIP_POOL 1 #else #define CHIP_SYSTEM_PACKETBUFFER_FROM_LWIP_POOL 0 #endif +/** + * CHIP_SYSTEM_PACKETBUFFER_LWIP_PBUF_TYPE + * + * LwIP @pbuf_type for System::PacketBuffer allocations. + */ +#if CHIP_SYSTEM_CONFIG_USE_LWIP +#if CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM +#define CHIP_SYSTEM_PACKETBUFFER_LWIP_PBUF_TYPE PBUF_RAM +#else +#define CHIP_SYSTEM_PACKETBUFFER_LWIP_PBUF_TYPE PBUF_POOL +#endif +#endif + /** * CHIP_SYSTEM_PACKETBUFFER_FROM_LWIP_STANDARD_POOL * @@ -114,3 +127,7 @@ CHIP_SYSTEM_PACKETBUFFER_FROM_LWIP_POOL #error "Inconsistent PacketBuffer LwIP pool configuration" #endif + +#if (CHIP_SYSTEM_PACKETBUFFER_FROM_LWIP_POOL + CHIP_SYSTEM_CONFIG_PACKETBUFFER_LWIP_PBUF_RAM) > 1 +#error "Inconsistent PacketBuffer LwIP pbuf_type configuration" +#endif From 338f642a0c7f95819b4fc9f453afaa1ce1e6ec7b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 13 Sep 2023 20:40:58 -0400 Subject: [PATCH 090/134] Fix CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED in clusters. (#29220) The define was being checked before including the config header that would actually define it. --- .../application-basic-server/application-basic-server.cpp | 7 ++++--- .../application-launcher-server.cpp | 7 ++++--- src/app/clusters/channel-server/channel-server.cpp | 7 ++++--- .../content-launch-server/content-launch-server.cpp | 7 ++++--- .../clusters/keypad-input-server/keypad-input-server.cpp | 7 ++++--- .../media-playback-server/media-playback-server.cpp | 7 ++++--- .../target-navigator-server/target-navigator-server.cpp | 7 ++++--- 7 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp index e2bf100aea2358..4c61cf11a3a97d 100644 --- a/src/app/clusters/application-basic-server/application-basic-server.cpp +++ b/src/app/clusters/application-basic-server/application-basic-server.cpp @@ -26,14 +26,15 @@ #include #include -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED -#include -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED #include #include #include #include +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +#include +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + #include using namespace chip; diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp index 982f1e8249548b..c44935472850e4 100644 --- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp +++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp @@ -31,13 +31,14 @@ #include #include #include +#include +#include #include +#include + #if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED #include #endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED -#include -#include -#include using namespace chip; using namespace chip::app::Clusters; diff --git a/src/app/clusters/channel-server/channel-server.cpp b/src/app/clusters/channel-server/channel-server.cpp index eaf4958270b2a0..91e9fc613dadf5 100644 --- a/src/app/clusters/channel-server/channel-server.cpp +++ b/src/app/clusters/channel-server/channel-server.cpp @@ -19,9 +19,6 @@ #include #include #include -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED -#include -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED #include #include #include @@ -29,6 +26,10 @@ #include #include +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +#include +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::Channel; diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp index fc0321ecb296f9..70144aaec1b06d 100644 --- a/src/app/clusters/content-launch-server/content-launch-server.cpp +++ b/src/app/clusters/content-launch-server/content-launch-server.cpp @@ -22,15 +22,16 @@ #include #include #include -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED -#include -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED #include #include #include #include #include +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +#include +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + #include using namespace chip; diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp index 9bcbfee6baae39..bf33427bfcd371 100644 --- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp +++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp @@ -28,15 +28,16 @@ #include #include #include -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED -#include -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED #include #include #include #include #include +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +#include +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::KeypadInput; diff --git a/src/app/clusters/media-playback-server/media-playback-server.cpp b/src/app/clusters/media-playback-server/media-playback-server.cpp index 443880cc12e40b..028fa8fcc2ec6e 100644 --- a/src/app/clusters/media-playback-server/media-playback-server.cpp +++ b/src/app/clusters/media-playback-server/media-playback-server.cpp @@ -29,14 +29,15 @@ #include #include #include -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED -#include -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED #include #include #include #include +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +#include +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::MediaPlayback; diff --git a/src/app/clusters/target-navigator-server/target-navigator-server.cpp b/src/app/clusters/target-navigator-server/target-navigator-server.cpp index d1146d9e3bd209..1718b2b9cc459c 100644 --- a/src/app/clusters/target-navigator-server/target-navigator-server.cpp +++ b/src/app/clusters/target-navigator-server/target-navigator-server.cpp @@ -28,14 +28,15 @@ #include #include #include -#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED -#include -#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED #include #include #include #include +#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +#include +#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED + using namespace chip; using namespace chip::app::Clusters; using namespace chip::app::Clusters::TargetNavigator; From f47ce538dcbb37b3bda40f15cca587f0c01cbe0b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 13 Sep 2023 20:41:51 -0400 Subject: [PATCH 091/134] Make sure CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR is always defined. (#29224) Possibly as 0. --- examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp | 6 +++--- examples/pump-app/cc13x4_26x4/main/AppTask.cpp | 6 +++--- .../pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp | 6 +++--- examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp | 6 +++--- src/platform/BUILD.gn | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp index 6fe2ee9973b3d7..625d48392f59a8 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -33,7 +33,7 @@ #include #include -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR #include #include #include @@ -81,7 +81,7 @@ AppTask AppTask::sAppTask; static DeviceCallbacks sDeviceCallbacks; -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR static DefaultOTARequestor sRequestorCore; static DefaultOTARequestorStorage sRequestorStorage; static DefaultOTARequestorDriver sRequestorUser; @@ -231,7 +231,7 @@ int AppTask::Init() ConfigurationMgr().LogDeviceConfig(); -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR InitializeOTARequestor(); #endif diff --git a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp index 4e70c312e77f33..8611b750f80a34 100644 --- a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp +++ b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp @@ -34,7 +34,7 @@ #include #include -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR #include #include #include @@ -82,7 +82,7 @@ AppTask AppTask::sAppTask; static DeviceCallbacks sDeviceCallbacks; -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR static DefaultOTARequestor sRequestorCore; static DefaultOTARequestorStorage sRequestorStorage; static DefaultOTARequestorDriver sRequestorUser; @@ -231,7 +231,7 @@ int AppTask::Init() ConfigurationMgr().LogDeviceConfig(); -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR InitializeOTARequestor(); #endif diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp index e7dadb13f75fad..cc59f4daee7b26 100644 --- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -30,7 +30,7 @@ #include #include -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR #include #include #include @@ -70,7 +70,7 @@ static Button_Handle sAppRightHandle; AppTask AppTask::sAppTask; -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR static DefaultOTARequestor sRequestorCore; static DefaultOTARequestorStorage sRequestorStorage; static DefaultOTARequestorDriver sRequestorUser; @@ -225,7 +225,7 @@ int AppTask::Init() ConfigurationMgr().LogDeviceConfig(); -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR InitializeOTARequestor(); #endif diff --git a/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp index 3d8b0bf2033b34..b51878e64651b6 100644 --- a/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp +++ b/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp @@ -30,7 +30,7 @@ #include #include -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR #include #include #include @@ -70,7 +70,7 @@ static Button_Handle sAppRightHandle; AppTask AppTask::sAppTask; -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR static DefaultOTARequestor sRequestorCore; static DefaultOTARequestorStorage sRequestorStorage; static DefaultOTARequestorDriver sRequestorUser; @@ -225,7 +225,7 @@ int AppTask::Init() ConfigurationMgr().LogDeviceConfig(); -#if defined(CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) +#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR InitializeOTARequestor(); #endif diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 5c1f079cef3cf9..86d5c3f4476fbb 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -133,9 +133,9 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { ] } - if (chip_enable_ota_requestor) { - defines += [ "CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR=1" ] - } + defines += [ + "CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR=${chip_enable_ota_requestor}", + ] if (chip_device_project_config_include != "") { defines += [ "CHIP_DEVICE_PROJECT_CONFIG_INCLUDE=${chip_device_project_config_include}" ] From 9db881557e313d6a06e7ab6f0a13d04dd1ba6468 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 03:36:05 -0400 Subject: [PATCH 092/134] Remove CONFIG_TLV_TRUNCATE. (#29233) It's not used right now, and it silently truncates the data being encoded, so should not be used. Fixes https://github.com/project-chip/connectedhomeip/issues/29218 --- src/lib/core/TLVWriter.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/lib/core/TLVWriter.cpp b/src/lib/core/TLVWriter.cpp index 41bfcfd4bc2c65..5249e0b4789f7a 100644 --- a/src/lib/core/TLVWriter.cpp +++ b/src/lib/core/TLVWriter.cpp @@ -301,8 +301,6 @@ CHIP_ERROR TLVWriter::VPutStringF(Tag tag, const char * fmt, va_list ap) size_t skipLen; size_t writtenBytes; #elif CONFIG_HAVE_VCBPRINTF -#elif CONFIG_TLV_TRUNCATE - size_t maxLen; #else char * tmpBuf; #endif @@ -324,17 +322,6 @@ CHIP_ERROR TLVWriter::VPutStringF(Tag tag, const char * fmt, va_list ap) else lenFieldSize = kTLVFieldSize_4Byte; -#if !(CONFIG_HAVE_VCBPRINTF) && !(CONFIG_HAVE_VSNPRINTF_EX) && CONFIG_TLV_TRUNCATE - // no facilities for splitting the stream across multiple buffers, - // just write however much fits in the current buffer. - // assume conservative tag length at this time (8 bytes) - maxLen = mRemainingLen - - (1 + 8 + (1 << static_cast(lenFieldSize)) + - 1); // 1 : control byte, 8 : tag length, stringLen + 1 for null termination - if (maxLen < dataLen) - dataLen = maxLen; -#endif - // write length. err = WriteElementHead( static_cast(static_cast(kTLVType_UTF8String) | static_cast(lenFieldSize)), tag, dataLen); From f9d5fa7537aa7856f69121290fd848ee2bc9d8a7 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 04:33:33 -0400 Subject: [PATCH 093/134] Be consistent about how we handle cluster names in config-data.yaml. (#29192) Use the cluster name as it appears in the XML. Fixes https://github.com/project-chip/connectedhomeip/issues/29186 --- src/app/common/templates/config-data.yaml | 24 +++++++++---------- .../zap-templates/templates/app/callback.zapt | 2 +- .../app/im-cluster-command-handler.zapt | 4 ++-- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index aa59f199cf1d55..40251139dae555 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -16,20 +16,18 @@ CommandHandlerInterfaceOnlyClusters: # List of clusters that are implemented entirely with # CommandHandlerInterface and hence do not need generated command dispatch. # This uses asUpperCamelCase versions of the cluster name. - - NetworkCommissioning + - Network Commissioning - Scenes - - RvcRunMode - - RvcCleanMode - - DishwasherMode - - LaundryWasherMode - - RefrigeratorAndTemperatureControlledCabinetMode - - OperationalState - - ActivatedCarbonFilterMonitoring - - HepaFilterMonitoring - - RvcOperationalState - # cluster format should match ClustersWithInitFunctions et al - # See https://github.com/project-chip/connectedhomeip/issues/29186 - - SampleMei + - RVC Run Mode + - RVC Clean Mode + - Dishwasher Mode + - Laundry Washer Mode + - Refrigerator And Temperature Controlled Cabinet Mode + - Operational State + - Activated Carbon Filter Monitoring + - HEPA Filter Monitoring + - RVC Operational State + - Sample MEI # We need a more configurable way of deciding which clusters have which init functions.... # See https://github.com/project-chip/connectedhomeip/issues/4369 diff --git a/src/app/zap-templates/templates/app/callback.zapt b/src/app/zap-templates/templates/app/callback.zapt index 9659df92b61416..53bbafd4325477 100644 --- a/src/app/zap-templates/templates/app/callback.zapt +++ b/src/app/zap-templates/templates/app/callback.zapt @@ -113,7 +113,7 @@ void emberAf{{asUpperCamelCase label}}ClusterClientTickCallback(chip::EndpointId {{#zcl_clusters}} {{#zcl_commands}} {{#if (isClient source)}} -{{#unless (isInConfigList (asUpperCamelCase parent.name) "CommandHandlerInterfaceOnlyClusters")}} +{{#unless (isInConfigList parent.name "CommandHandlerInterfaceOnlyClusters")}} /** * @brief {{parent.name}} Cluster {{name}} Command callback (from {{source}}) */ diff --git a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt index 2d210b03aea1cc..e41e9328fac98d 100644 --- a/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt +++ b/src/app/zap-templates/templates/app/im-cluster-command-handler.zapt @@ -21,7 +21,7 @@ namespace app { namespace Clusters { {{#all_user_clusters_with_incoming_commands}} -{{#unless (isInConfigList (asUpperCamelCase clusterName) "CommandHandlerInterfaceOnlyClusters")}} +{{#unless (isInConfigList clusterName "CommandHandlerInterfaceOnlyClusters")}} {{#if (isServer clusterSide)}} namespace {{asUpperCamelCase clusterName}} { @@ -71,7 +71,7 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: switch (aCommandPath.mClusterId) { {{#all_user_clusters_with_incoming_commands}} - {{#unless (isInConfigList (asUpperCamelCase clusterName) "CommandHandlerInterfaceOnlyClusters")}} + {{#unless (isInConfigList clusterName "CommandHandlerInterfaceOnlyClusters")}} {{#if (isServer clusterSide)}} case Clusters::{{asUpperCamelCase clusterName}}::Id: Clusters::{{asUpperCamelCase clusterName}}::DispatchServerCommand(apCommandObj, aCommandPath, aReader); From 52caffd1dcf7a77ff766bd93ee03829c6b38f73f Mon Sep 17 00:00:00 2001 From: manjunath-grl <102359958+manjunath-grl@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:54:29 +0530 Subject: [PATCH 094/134] Fix script issues Sep 12 (#29179) * Semi-automated --> Automated tests: TC-ACL-2.5 TC-ACL-2.6 TC-MEDIAPLAYBACK-6.3 Manual --> Automated: TC-TCCM-3.1 TC-TCCM-3.2 TC-TCTL-2.1 TC-TCTL-2.2 TC-TCTL-2.3 * Fixes issue: 634, 636, 637, 639, 640, 641, 642, 645, 646 Modified tests: TC_CADMIN_1_26 TC_DA_1_8 TC_DGGEN_2_1 TC_DGETH_2_1 TC_DGWIFI_3_2_Simulated TC_DISHALM_3_1 TC_DISHALM_3_2 TC_DISHALM_3_3 TC_DISHALM_3_4 TC_DISHALM_3_5 TC_DISHALM_3_6 TC_GRPKEY_2_1 TC_GRPKEY_2_2 TC_LTIME_3_1 TC_MOD_3_3 TC_MOD_3_4 TC_SC_4_2 TC_SC_4_3 TC_SC_4_4 TC_SC_4_6 TC_TCCM_3_2 TC_WNCV_3_1 TC_WNCV_3_2 * Fixes issue: 645, 643 Modified tests: TC-ACL-2.10 TC-GRPKEY-2.2 Manual tests: TC-BIND-2.1 TC-CNET-4.10 TC-MOD-1.3 TC-SWTCH-2.2 * Restyled by whitespace * Fixed the MOD-3.4 and TCTL-2.3 CI failures. * Fixed MOD-3.4 CI failure. * Fix Darwin failure for TCTL-2.3 * Modifed test as per comments: TC-DGETH-2.1 TC-DGGEN-2.1 TC-TCCM-3.1 TC-TCTL-2.1 TC-GRPKEY-2.1 * Restyled by prettier-yaml * Removed wait step as it is not in test-plan. * Fixes issue: #29182, #29183 * Fix issue: 647 * Fix CI failures for ACL-2.5, 2.6 testcases --------- Co-authored-by: Restyled.io --- .../templates/tests/ciTests.json | 5 +- scripts/tests/chiptest/__init__.py | 6 +- src/app/tests/suites/certification/PICS.yaml | 8 +- .../certification/Test_TC_ACL_2_10.yaml | 20 +- .../suites/certification/Test_TC_ACL_2_5.yaml | 213 ++- .../suites/certification/Test_TC_ACL_2_6.yaml | 262 ++-- .../certification/Test_TC_BIND_2_1.yaml | 14 +- .../certification/Test_TC_CADMIN_1_26.yaml | 2 +- .../certification/Test_TC_CNET_4_10.yaml | 4 +- .../suites/certification/Test_TC_DA_1_8.yaml | 1264 +++++++++++++++-- .../certification/Test_TC_DGETH_2_1.yaml | 199 +-- .../certification/Test_TC_DGGEN_2_1.yaml | 134 +- .../Test_TC_DGWIFI_3_2_Simulated.yaml | 2 +- .../certification/Test_TC_DISHALM_3_1.yaml | 6 + .../certification/Test_TC_DISHALM_3_2.yaml | 6 + .../certification/Test_TC_DISHALM_3_3.yaml | 6 + .../certification/Test_TC_DISHALM_3_4.yaml | 6 + .../certification/Test_TC_DISHALM_3_5.yaml | 6 + .../certification/Test_TC_DISHALM_3_6.yaml | 6 + .../certification/Test_TC_GRPKEY_2_1.yaml | 46 +- .../certification/Test_TC_GRPKEY_2_2.yaml | 14 +- .../certification/Test_TC_LTIME_3_1.yaml | 4 +- .../Test_TC_MEDIAPLAYBACK_6_3.yaml | 108 +- .../suites/certification/Test_TC_MOD_1_3.yaml | 766 +++++++--- .../suites/certification/Test_TC_MOD_3_3.yaml | 23 +- .../suites/certification/Test_TC_MOD_3_4.yaml | 5 +- .../suites/certification/Test_TC_SC_4_1.yaml | 20 +- .../suites/certification/Test_TC_SC_4_2.yaml | 2 +- .../suites/certification/Test_TC_SC_4_3.yaml | 2 +- .../suites/certification/Test_TC_SC_4_4.yaml | 2 +- .../suites/certification/Test_TC_SC_4_6.yaml | 2 +- .../certification/Test_TC_SWTCH_2_2.yaml | 19 + .../certification/Test_TC_TCCM_3_1.yaml | 246 ++-- .../certification/Test_TC_TCTL_2_1.yaml | 129 +- .../certification/Test_TC_TCTL_2_2.yaml | 77 +- .../certification/Test_TC_TCTL_2_3.yaml | 76 +- .../certification/Test_TC_TSTAT_2_1.yaml | 4 +- .../certification/Test_TC_TSTAT_2_2.yaml | 10 +- .../certification/Test_TC_WNCV_3_1.yaml | 30 +- .../certification/Test_TC_WNCV_3_2.yaml | 26 +- .../tests/suites/certification/ci-pics-values | 16 +- src/app/tests/suites/ciTests.json | 12 +- src/app/tests/suites/manualTests.json | 17 +- .../zap-generated/test/Commands.h | 906 ++++++++---- 44 files changed, 3149 insertions(+), 1582 deletions(-) diff --git a/examples/darwin-framework-tool/templates/tests/ciTests.json b/examples/darwin-framework-tool/templates/tests/ciTests.json index ad899068350067..3d53b4ac173568 100644 --- a/examples/darwin-framework-tool/templates/tests/ciTests.json +++ b/examples/darwin-framework-tool/templates/tests/ciTests.json @@ -50,6 +50,9 @@ "Test_TC_PSCFG_2_1", "Test_TC_PSCFG_2_2", "Disabled because darwin-framework-tool does not support GetCommissionerRootCertificate", - "Test_AddNewFabricFromExistingFabric" + "Test_AddNewFabricFromExistingFabric", + "Disabled because darwin-framework-tool does not support EqualityCommands pseudo-cluster", + "Test_TC_TCCM_3_1", + "Test_TC_TCTL_2_1" ] } diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index eda65d58438abe..3180be2da54847 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -192,8 +192,12 @@ def _GetChipReplUnsupportedTests() -> Set[str]: "Test_TC_G_2_4.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_RVCRUNM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster "Test_TC_RVCCLEANM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_TCCM_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster + "Test_TC_TCTL_2_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster # chip-repl and chip-tool disagree on what the YAML here should look like: https://github.com/project-chip/connectedhomeip/issues/29110 "TestClusterMultiFabric.yaml", + "Test_TC_ACL_2_5.yaml", # chip-repl does not support LastReceivedEventNumber : https://github.com/project-chip/connectedhomeip/issues/28884 + "Test_TC_ACL_2_6.yaml", # chip-repl does not support LastReceivedEventNumber : https://github.com/project-chip/connectedhomeip/issues/28884 } @@ -231,7 +235,7 @@ def target_for_name(name: str): return TestTarget.LOCK if name.startswith("OTA_"): return TestTarget.OTA - if name.startswith("Test_TC_BRBINFO_"): + if name.startswith("Test_TC_BRBINFO_") or name.startswith("Test_TC_ACT_"): return TestTarget.BRIDGE return TestTarget.ALL_CLUSTERS diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index d26d399904833e..646a9aaaa47043 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -3660,7 +3660,7 @@ PICS: id: GRPKEY.S.C01.Rsp - label: "Does the device implement the KeySetReadResponse command}?" - id: GRPKEY.S.C02.Rsp + id: GRPKEY.S.C02.Tx - label: "Does the device implement the KeySetRemove command}?" id: GRPKEY.S.C03.Rsp @@ -3670,7 +3670,7 @@ PICS: - label: "Does the device implement the KeySetReadAllIndicesResponse command}?" - id: GRPKEY.S.C05.Rsp + id: GRPKEY.S.C05.Tx # # client / attributes @@ -7074,10 +7074,10 @@ PICS: id: LTIME.S.A0002 - label: "Does the DUT (Server) support 12 Hr Hour Format ?" - id: LTIME.S.A0000.12HR + id: LTIME.S.M.12HR - label: "Does the DUT (Server) support 24 Hr Hour Format ?" - id: LTIME.S.A0000.24HR + id: LTIME.S.M.24HR # # client / attributes diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml index 46cee17ddfd5a2..baa544bca18818 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_10.yaml @@ -99,8 +99,8 @@ tests: #Issue https://github.com/project-chip/connectedhomeip/issues/26127 - label: - "TH1 puts DUT into commissioning mode, TH2 commissions DUT using admin - node ID N2" + "Step 3: TH1 puts DUT into commissioning mode, TH2 commissions DUT + using admin node ID N2" verification: | Open a commissioning window On TH1(Chiptool)using below command @@ -128,7 +128,7 @@ tests: - name: "expectedValue" value: "y" - - label: "TH2 starts a commissioning process with DUT" + - label: "Step 3: TH2 starts a commissioning process with DUT" PICS: PICS_SDK_CI_ONLY identity: "beta" cluster: "CommissionerCommands" @@ -426,7 +426,6 @@ tests: value: "y" - label: "TH1 Connects to the device again" - PICS: PICS_SDK_CI_ONLY cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -444,6 +443,19 @@ tests: - name: "nodeId" value: nodeId2 + - label: "TH2 Connects to the device again after reboot." + verification: | + Connect TH2 to the device(DUT) again after reboot. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" + - label: "Step 10:TH1 writes DUT Endpoint 0 AccessControl cluster ACL attribute" PICS: ACL.S.A0000 diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml index bc2a1b7ddb315c..981ebc8c5d30d6 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_5.yaml @@ -102,6 +102,7 @@ tests: PICS: ACL.S.E01 command: "readEvent" event: "AccessControlExtensionChanged" + eventNumber: "LastReceivedEventNumber + 1" response: value: { @@ -126,52 +127,40 @@ tests: arguments: value: [{ Data: D_OK_SINGLE, FabricIndex: CurrentFabricIndexValue }] - #Issue: https://github.com/project-chip/connectedhomeip/issues/24149 - label: "Step 7: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" - verification: | - ./chip-tool accesscontrol read-event access-control-extension-changed 1 0 - On TH1(Chiptool) , Verify AccessControlExtensionChanged containing at least 2 new elements. - - [1661427357.681328][23441:23446] CHIP:TOO: } - [1661427357.681520][23441:23446] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Event 0x0000_0001 - [1661427357.681555][23441:23446] CHIP:TOO: Event number: 5 - [1661427357.681580][23441:23446] CHIP:TOO: Priority: Info - [1661427357.681602][23441:23446] CHIP:TOO: Timestamp: 95095658 - [1661427357.681660][23441:23446] CHIP:TOO: AccessControlExtensionChanged: { - [1661427357.681697][23441:23446] CHIP:TOO: AdminNodeID: 112233 - [1661427357.681730][23441:23446] CHIP:TOO: AdminPasscodeID: null - [1661427357.681764][23441:23446] CHIP:TOO: ChangeType: 2 - [1661427357.681793][23441:23446] CHIP:TOO: LatestValue: { - [1661427357.681826][23441:23446] CHIP:TOO: Data: 1718 - [1661427357.681854][23441:23446] CHIP:TOO: FabricIndex: 1 - [1661427357.681882][23441:23446] CHIP:TOO: } - [1661427357.681924][23441:23446] CHIP:TOO: FabricIndex: 1 - [1661427357.681951][23441:23446] CHIP:TOO: } - [1661427357.682163][23441:23446] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Event 0x0000_0001 - [1661427357.682207][23441:23446] CHIP:TOO: Event number: 6 - [1661427357.682230][23441:23446] CHIP:TOO: Priority: Info - [1661427357.682260][23441:23446] CHIP:TOO: Timestamp: 95095659 - [1661427357.682327][23441:23446] CHIP:TOO: AccessControlExtensionChanged: { - [1661427357.682375][23441:23446] CHIP:TOO: AdminNodeID: 112233 - [1661427357.682405][23441:23446] CHIP:TOO: AdminPasscodeID: null - [1661427357.682434][23441:23446] CHIP:TOO: ChangeType: 1 - [1661427357.682459][23441:23446] CHIP:TOO: LatestValue: { - [1661427357.682495][23441:23446] CHIP:TOO: Data: 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018 - [1661427357.682524][23441:23446] CHIP:TOO: FabricIndex: 1 - [1661427357.682550][23441:23446] CHIP:TOO: } - [1661427357.682579][23441:23446] CHIP:TOO: FabricIndex: 1 - [1661427357.682603][23441:23446] CHIP:TOO: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && ACL.S.E01 - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + PICS: ACL.S.E01 + command: "readEvent" + event: "AccessControlExtensionChanged" + eventNumber: "LastReceivedEventNumber + 1" + response: + - values: + - value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 2, + LatestValue: + { + Data: D_OK_EMPTY, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } + - values: + - value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 1, + LatestValue: + { + Data: D_OK_SINGLE, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } - label: "Step 8: TH writes DUT Endpoint 0 AccessControl cluster Extension @@ -185,37 +174,26 @@ tests: response: error: CONSTRAINT_ERROR - #Issue: https://github.com/project-chip/connectedhomeip/issues/24149 - label: "Step 9: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" - verification: | - ./chip-tool accesscontrol read-event access-control-extension-changed 1 0 - - On TH1(Chiptool) , Verify AccessControl cluster AccessControlExtensionChanged containing at least 1 new element, and MUST NOT contain an added event for the extension with data that is too large - - [1661427763.925039][23523:23528] CHIP:TOO: Event number: 7 - [1661427763.925054][23523:23528] CHIP:TOO: Priority: Info - [1661427763.925067][23523:23528] CHIP:TOO: Timestamp: 95411825 - [1661427763.925095][23523:23528] CHIP:TOO: AccessControlExtensionChanged: { - [1661427763.925112][23523:23528] CHIP:TOO: AdminNodeID: 112233 - [1661427763.925127][23523:23528] CHIP:TOO: AdminPasscodeID: null - [1661427763.925142][23523:23528] CHIP:TOO: ChangeType: 2 - [1661427763.925156][23523:23528] CHIP:TOO: LatestValue: { - [1661427763.925174][23523:23528] CHIP:TOO: Data: 17D00000F1FF01003D48656C6C6F20576F726C642E205468697320697320612073696E676C6520656C656D656E74206C6976696E6720617320612063686172737472696E670018 - [1661427763.925191][23523:23528] CHIP:TOO: FabricIndex: 1 - [1661427763.925205][23523:23528] CHIP:TOO: } - [1661427763.925220][23523:23528] CHIP:TOO: FabricIndex: 1 - [1661427763.925234][23523:23528] CHIP:TOO: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && ACL.S.E01 - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + PICS: ACL.S.E01 + command: "readEvent" + event: "AccessControlExtensionChanged" + eventNumber: "LastReceivedEventNumber + 1" + response: + value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 2, + LatestValue: + { + Data: D_OK_SINGLE, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } - label: "Step 10: TH writes DUT Endpoint 0 AccessControl cluster Extension @@ -233,38 +211,26 @@ tests: response: error: CONSTRAINT_ERROR - #Issue: https://github.com/project-chip/connectedhomeip/issues/24149 - label: "Step 11: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" - verification: | - ./chip-tool accesscontrol read-event access-control-extension-changed 1 0 - On TH1(Chiptool) , Verify AccessControl cluster AccessControlExtensionChanged event - containing at least 1 new element, and MUST NOT contain an added event for the second extension - [[1661428163.049647][23604:23609] CHIP:TOO: Event number: 8 - [1661428163.049660][23604:23609] CHIP:TOO: Priority: Info - [1661428163.049673][23604:23609] CHIP:TOO: Timestamp: 95827304 - [1661428163.049698][23604:23609] CHIP:TOO: AccessControlExtensionChanged: { - [1661428163.049714][23604:23609] CHIP:TOO: AdminNodeID: 112233 - [1661428163.049729][23604:23609] CHIP:TOO: AdminPasscodeID: null - [1661428163.049744][23604:23609] CHIP:TOO: ChangeType: 1 - [1661428163.049758][23604:23609] CHIP:TOO: LatestValue: { - [1661428163.049774][23604:23609] CHIP:TOO: Data: 1718 - [1661428163.049789][23604:23609] CHIP:TOO: FabricIndex: 1 - [1661428163.049803][23604:23609] CHIP:TOO: } - [1661428163.049817][23604:23609] CHIP:TOO: FabricIndex: 1 - [1661428163.049831][23604:23609] CHIP:TOO: } - [1661428163.050010][23604:23609] CHIP:EM: Sending Standalone Ack for MessageCounter:70117030 on exchange 55174i - [1661428163.050065][23604:23609] CHIP:IN: Prepared secure message 0x7f2e7d092ff0 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 55174i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && ACL.S.E01 - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + PICS: ACL.S.E01 + command: "readEvent" + event: "AccessControlExtensionChanged" + eventNumber: "LastReceivedEventNumber + 1" + response: + value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 1, + LatestValue: + { + Data: D_OK_EMPTY, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } - label: "Step 12: TH writes DUT Endpoint 0 AccessControl cluster Extension @@ -275,36 +241,23 @@ tests: arguments: value: [] - #Issue: https://github.com/project-chip/connectedhomeip/issues/24149 - label: "Step 13: TH reads DUT Endpoint 0 AccessControl cluster AccessControlExtensionChanged event" - verification: | - ./chip-tool accesscontrol read-event access-control-extension-changed 1 0 - - On TH1(Chiptool) , Verify AccessControl cluster AccessControlExtensionChanged event containing at least 1 new element - - [1661428343.982081][23629:23634] CHIP:TOO: Event number: 9 - [1661428343.982087][23629:23634] CHIP:TOO: Priority: Info - [1661428343.982092][23629:23634] CHIP:TOO: Timestamp: 96078599 - [1661428343.982103][23629:23634] CHIP:TOO: AccessControlExtensionChanged: { - [1661428343.982109][23629:23634] CHIP:TOO: AdminNodeID: 112233 - [1661428343.982115][23629:23634] CHIP:TOO: AdminPasscodeID: null - [1661428343.982121][23629:23634] CHIP:TOO: ChangeType: 2 - [1661428343.982127][23629:23634] CHIP:TOO: LatestValue: { - [1661428343.982133][23629:23634] CHIP:TOO: Data: 1718 - [1661428343.982139][23629:23634] CHIP:TOO: FabricIndex: 1 - [1661428343.982145][23629:23634] CHIP:TOO: } - [1661428343.982151][23629:23634] CHIP:TOO: FabricIndex: 1 - [1661428343.982157][23629:23634] CHIP:TOO: } - [1661428343.982246][23629:23634] CHIP:EM: Sending Standalone Ack for MessageCounter:13864065 on exchange 38943i - [1661428343.982272][23629:23634] CHIP:IN: Prepared secure message 0x7ff9a8e43ff0 to 0x0000000000000001 (1) of type 0x10 and - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && ACL.S.E01 - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + PICS: ACL.S.E01 + command: "readEvent" + event: "AccessControlExtensionChanged" + eventNumber: "LastReceivedEventNumber + 1" + response: + value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 2, + LatestValue: + { + Data: D_OK_EMPTY, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } diff --git a/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml b/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml index 942fd2f97f82c2..946c1e0fdeda1b 100644 --- a/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACL_2_6.yaml @@ -54,6 +54,7 @@ tests: PICS: ACL.S.E00 command: "readEvent" event: "AccessControlEntryChanged" + eventNumber: "LastReceivedEventNumber + 1" response: value: { @@ -100,96 +101,62 @@ tests: }, ] - #Issue: https://github.com/project-chip/connectedhomeip/issues/24149 - label: "Step 5: TH reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event" - verification: | - ./chip-tool accesscontrol read-event access-control-entry-changed 1 0 - - On TH1(Chiptool) , Verify AccessControl cluster AccessControlEntryChanged event containing at least 3 new elements - - [1661181829.402498][19315:19320] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Event 0x0000_0000 - [1661181829.402502][19315:19320] CHIP:TOO: Event number: 3 - [1661181829.402504][19315:19320] CHIP:TOO: Priority: Info - [1661181829.402506][19315:19320] CHIP:TOO: Timestamp: 31085832 - [1661181829.402536][19315:19320] CHIP:TOO: AccessControlEntryChanged: { - [1661181829.402543][19315:19320] CHIP:TOO: AdminNodeID: null - [1661181829.402548][19315:19320] CHIP:TOO: AdminPasscodeID: 0 - [1661181829.402551][19315:19320] CHIP:TOO: ChangeType: 1 - [1661181829.402554][19315:19320] CHIP:TOO: LatestValue: { - [1661181829.402557][19315:19320] CHIP:TOO: Privilege: 5 - [1661181829.402560][19315:19320] CHIP:TOO: AuthMode: 2 - [1661181829.402564][19315:19320] CHIP:TOO: Subjects: 1 entries - [1661181829.402569][19315:19320] CHIP:TOO: [1]: 112233 - [1661181829.402572][19315:19320] CHIP:TOO: Targets: null - [1661181829.402575][19315:19320] CHIP:TOO: FabricIndex: 1 - [1661181829.402578][19315:19320] CHIP:TOO: } - [1661181829.402581][19315:19320] CHIP:TOO: FabricIndex: 1 - [1661181829.402584][19315:19320] CHIP:TOO: } - [1661181829.402609][19315:19320] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Event 0x0000_0000 - [1661181829.402612][19315:19320] CHIP:TOO: Event number: 4 - [1661181829.402615][19315:19320] CHIP:TOO: Priority: Info - [1661181829.402617][19315:19320] CHIP:TOO: Timestamp: 31297570 - [1661181829.402624][19315:19320] CHIP:TOO: AccessControlEntryChanged: { - [1661181829.402627][19315:19320] CHIP:TOO: AdminNodeID: 112233 - [1661181829.402630][19315:19320] CHIP:TOO: AdminPasscodeID: null - [1661181829.402633][19315:19320] CHIP:TOO: ChangeType: 2 - [1661181829.402635][19315:19320] CHIP:TOO: LatestValue: { - [1661181829.402638][19315:19320] CHIP:TOO: Privilege: 5 - [1661181829.402641][19315:19320] CHIP:TOO: AuthMode: 2 - [1661181829.402644][19315:19320] CHIP:TOO: Subjects: 1 entries - [1661181829.402647][19315:19320] CHIP:TOO: [1]: 112233 - [1661181829.402650][19315:19320] CHIP:TOO: Targets: null - [1661181829.402653][19315:19320] CHIP:TOO: FabricIndex: 1 - [1661181829.402656][19315:19320] CHIP:TOO: } - [1661181829.402658][19315:19320] CHIP:TOO: FabricIndex: 1 - [1661181829.402661][19315:19320] CHIP:TOO: } - [1661181829.402687][19315:19320] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Event 0x0000_0000 - [1661181829.402689][19315:19320] CHIP:TOO: Event number: 5 - [1661181829.402692][19315:19320] CHIP:TOO: Priority: Info - [1661181829.402694][19315:19320] CHIP:TOO: Timestamp: 31297570 - [1661181829.402699][19315:19320] CHIP:TOO: AccessControlEntryChanged: { - [1661181829.402702][19315:19320] CHIP:TOO: AdminNodeID: 112233 - [1661181829.402704][19315:19320] CHIP:TOO: AdminPasscodeID: null - [1661181829.402707][19315:19320] CHIP:TOO: ChangeType: 1 - [1661181829.402710][19315:19320] CHIP:TOO: LatestValue: { - [1661181829.402713][19315:19320] CHIP:TOO: Privilege: 5 - [1661181829.402715][19315:19320] CHIP:TOO: AuthMode: 2 - [1661181829.402718][19315:19320] CHIP:TOO: Subjects: 1 entries - [1661181829.402722][19315:19320] CHIP:TOO: [1]: 112233 - [1661181829.402724][19315:19320] CHIP:TOO: Targets: null - [1661181829.402727][19315:19320] CHIP:TOO: FabricIndex: 1 - [1661181829.402729][19315:19320] CHIP:TOO: } - [1661181829.402732][19315:19320] CHIP:TOO: FabricIndex: 1 - [1661181829.402735][19315:19320] CHIP:TOO: } - [1661181829.402758][19315:19320] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Event 0x0000_0000 - [1661181829.402761][19315:19320] CHIP:TOO: Event number: 6 - [1661181829.402763][19315:19320] CHIP:TOO: Priority: Info - [1661181829.402765][19315:19320] CHIP:TOO: Timestamp: 31297571 - [1661181829.402770][19315:19320] CHIP:TOO: AccessControlEntryChanged: { - [1661181829.402773][19315:19320] CHIP:TOO: AdminNodeID: 112233 - [1661181829.402775][19315:19320] CHIP:TOO: AdminPasscodeID: null - [1661181829.402778][19315:19320] CHIP:TOO: ChangeType: 1 - [1661181829.402780][19315:19320] CHIP:TOO: LatestValue: { - [1661181829.402783][19315:19320] CHIP:TOO: Privilege: 3 - [1661181829.402786][19315:19320] CHIP:TOO: AuthMode: 3 - [1661181829.402789][19315:19320] CHIP:TOO: Subjects: null - [1661181829.402791][19315:19320] CHIP:TOO: Targets: null - [1661181829.402794][19315:19320] CHIP:TOO: FabricIndex: 1 - [1661181829.402796][19315:19320] CHIP:TOO: } - [1661181829.402799][19315:19320] CHIP:TOO: FabricIndex: 1 - [1661181829.402801][19315:19320] CHIP:TOO: } - [1661181829.402840][19315:19320] CHIP:EM: Sending Standalone Ack for MessageCounter:139733206 on exchange 44167i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && ACL.S.E00 - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + PICS: ACL.S.E00 + command: "readEvent" + event: "AccessControlEntryChanged" + eventNumber: "LastReceivedEventNumber + 1" + response: + - values: + - value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 2, + LatestValue: + { + Privilege: 5, + AuthMode: 2, + Subjects: [CommissionerNodeId], + Targets: null, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } + - values: + - value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 1, + LatestValue: + { + Privilege: 5, + AuthMode: 2, + Subjects: [CommissionerNodeId], + Targets: null, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } + - values: + - value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 1, + LatestValue: + { + Privilege: 3, + AuthMode: 3, + Subjects: null, + Targets: null, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } - label: "Step 6: TH writes DUT Endpoint 0 AccessControl cluster ACL attribute, @@ -223,74 +190,59 @@ tests: response: error: CONSTRAINT_ERROR - #Issue: https://github.com/project-chip/connectedhomeip/issues/24149 - label: "Step 7: TH reads DUT Endpoint 0 AccessControl cluster AccessControlEntryChanged event" - verification: | - ./chip-tool accesscontrol read-event access-control-entry-changed 1 0 - - On TH1(Chiptool) , Verify AccessControl cluster AccessControlEntryChanged event containing - at least 3 new elements and MUST NOT contain an added event for second entry written at step 6 - - [1662107335.746678][89356:89361] CHIP:TOO: Event number: 10 - [1662107335.746688][89356:89361] CHIP:TOO: Priority: Info - [1662107335.746698][89356:89361] CHIP:TOO: Timestamp: 370685212 - [1662107335.746722][89356:89361] CHIP:TOO: AccessControlEntryChanged: { - [1662107335.746736][89356:89361] CHIP:TOO: AdminNodeID: 112233 - [1662107335.746750][89356:89361] CHIP:TOO: AdminPasscodeID: null - [1662107335.746763][89356:89361] CHIP:TOO: ChangeType: 2 - [1662107335.746774][89356:89361] CHIP:TOO: LatestValue: { - [1662107335.746786][89356:89361] CHIP:TOO: Privilege: 3 - [1662107335.746797][89356:89361] CHIP:TOO: AuthMode: 3 - [1662107335.746810][89356:89361] CHIP:TOO: Subjects: null - [1662107335.746823][89356:89361] CHIP:TOO: Targets: null - [1662107335.746837][89356:89361] CHIP:TOO: FabricIndex: 1 - [1662107335.746850][89356:89361] CHIP:TOO: } - [1662107335.746863][89356:89361] CHIP:TOO: FabricIndex: 1 - [1662107335.746875][89356:89361] CHIP:TOO: } - [1662107335.746995][89356:89361] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Event 0x0000_0000 - [1662107335.747009][89356:89361] CHIP:TOO: Event number: 11 - [1662107335.747020][89356:89361] CHIP:TOO: Priority: Info - [1662107335.747032][89356:89361] CHIP:TOO: Timestamp: 370685213 - [1662107335.747058][89356:89361] CHIP:TOO: AccessControlEntryChanged: { - [1662107335.747073][89356:89361] CHIP:TOO: AdminNodeID: 112233 - [1662107335.747085][89356:89361] CHIP:TOO: AdminPasscodeID: null - [1662107335.747097][89356:89361] CHIP:TOO: ChangeType: 2 - [1662107335.747108][89356:89361] CHIP:TOO: LatestValue: { - [1662107335.747119][89356:89361] CHIP:TOO: Privilege: 5 - [1662107335.747130][89356:89361] CHIP:TOO: AuthMode: 2 - [1662107335.747144][89356:89361] CHIP:TOO: Subjects: 1 entries - [1662107335.747160][89356:89361] CHIP:TOO: [1]: 112233 - [1662107335.747175][89356:89361] CHIP:TOO: Targets: null - [1662107335.747188][89356:89361] CHIP:TOO: FabricIndex: 1 - [1662107335.747201][89356:89361] CHIP:TOO: } - [1662107335.747214][89356:89361] CHIP:TOO: FabricIndex: 1 - [1662107335.747226][89356:89361] CHIP:TOO: } - [1662107335.747348][89356:89361] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_001F Event 0x0000_0000 - [1662107335.747362][89356:89361] CHIP:TOO: Event number: 12 - [1662107335.747374][89356:89361] CHIP:TOO: Priority: Info - [1662107335.747385][89356:89361] CHIP:TOO: Timestamp: 370685215 - [1662107335.747412][89356:89361] CHIP:TOO: AccessControlEntryChanged: { - [1662107335.747426][89356:89361] CHIP:TOO: AdminNodeID: 112233 - [1662107335.747438][89356:89361] CHIP:TOO: AdminPasscodeID: null - [1662107335.747450][89356:89361] CHIP:TOO: ChangeType: 1 - [1662107335.747461][89356:89361] CHIP:TOO: LatestValue: { - [1662107335.747473][89356:89361] CHIP:TOO: Privilege: 5 - [1662107335.747484][89356:89361] CHIP:TOO: AuthMode: 2 - [1662107335.747500][89356:89361] CHIP:TOO: Subjects: 1 entries - [1662107335.747516][89356:89361] CHIP:TOO: [1]: 112233 - [1662107335.747530][89356:89361] CHIP:TOO: Targets: null - [1662107335.747543][89356:89361] CHIP:TOO: FabricIndex: 1 - [1662107335.747554][89356:89361] CHIP:TOO: } - [1662107335.747565][89356:89361] CHIP:TOO: FabricIndex: 1 - [1662107335.747576][89356:89361] CHIP:TOO: } - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_SKIP_SAMPLE_APP && ACL.S.E00 - arguments: - values: - - name: "message" - value: "Enter 'y' after success" - - name: "expectedValue" - value: "y" + PICS: ACL.S.E00 + command: "readEvent" + event: "AccessControlEntryChanged" + eventNumber: "LastReceivedEventNumber + 1" + response: + - values: + - value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 2, + LatestValue: + { + Privilege: 3, + AuthMode: 3, + Subjects: null, + Targets: null, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } + - values: + - value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 2, + LatestValue: + { + Privilege: 5, + AuthMode: 2, + Subjects: [CommissionerNodeId], + Targets: null, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } + - values: + - value: + { + AdminNodeID: CommissionerNodeId, + AdminPasscodeID: null, + ChangeType: 1, + LatestValue: + { + Privilege: 5, + AuthMode: 2, + Subjects: [CommissionerNodeId], + Targets: null, + FabricIndex: CurrentFabricIndexValue, + }, + FabricIndex: CurrentFabricIndexValue, + } diff --git a/src/app/tests/suites/certification/Test_TC_BIND_2_1.yaml b/src/app/tests/suites/certification/Test_TC_BIND_2_1.yaml index 483d57169defa6..4abaa89d9844b9 100644 --- a/src/app/tests/suites/certification/Test_TC_BIND_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_BIND_2_1.yaml @@ -41,11 +41,19 @@ tests: - label: "Pre-Conditions" verification: | - TH2 supports On/Off server on Endpoint 1. + 1 TH2 supports On/Off server on Endpoint 1. - TH3 supports On/Off server on Endpoint 2. + 2 TH3 supports On/Off server on Endpoint 2. - DUT supports On/Off client. + 3 DUT supports On/Off client. + + 1. TH1 - Test Harness1 as Commissioner + + 2. TH2 - Test Harness2 as Controlee + + 3. TH3 - Test Harness3 as Controlee + + 4. DUT - Controller disabled: true - label: "Step 1: Factory Reset DUT" diff --git a/src/app/tests/suites/certification/Test_TC_CADMIN_1_26.yaml b/src/app/tests/suites/certification/Test_TC_CADMIN_1_26.yaml index d6af78ccfd2b92..8b915f178984a8 100644 --- a/src/app/tests/suites/certification/Test_TC_CADMIN_1_26.yaml +++ b/src/app/tests/suites/certification/Test_TC_CADMIN_1_26.yaml @@ -1971,7 +1971,7 @@ tests: administratorcommissioning read window-status 1 0 --commissioner-name alpha - Verify TH_CR1 logs for windowstatus to be 1 + Verify TH_CR1 logs for windowstatus to be 2 ReportDataMessage = diff --git a/src/app/tests/suites/certification/Test_TC_CNET_4_10.yaml b/src/app/tests/suites/certification/Test_TC_CNET_4_10.yaml index a127b1c26c2fd5..e0adf7ec94ea14 100644 --- a/src/app/tests/suites/certification/Test_TC_CNET_4_10.yaml +++ b/src/app/tests/suites/certification/Test_TC_CNET_4_10.yaml @@ -233,9 +233,9 @@ tests: "Step 11: TH sends ArmFailSafe command to the DUT with ExpiryLengthSeconds set to 900" verification: | - ./chip-tool generalcommissioning arm-fail-safe 90 0 1 0 + ./chip-tool generalcommissioning arm-fail-safe 900 1 1 0 - Via the TH (chip-tool), Verify the DUT sends ArmFailSafe with timeout as 90 secs to the TH. + Via the TH (chip-tool), Verify the DUT sends ArmFailSafe with timeout as 900 secs to the TH. [1657626161.611078][2780:2785] CHIP:DMG: Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 [1657626161.611183][2780:2785] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0030 Command 0x0000_0001 diff --git a/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml b/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml index 188e23dcccf156..7f190760dc2dfa 100644 --- a/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml +++ b/src/app/tests/suites/certification/Test_TC_DA_1_8.yaml @@ -52,331 +52,1297 @@ tests: "Step 1b: CD Test Vector: The product_id_array field has one PID value which matches the PID value in DAC." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_dac_origin_vid_pid_present_match/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690284781.863086][15687:15687] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690284781.863091][15687:15687] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690284781.863094][15687:15687] CHIP:SVR: Commissioning completed successfully + [1690284781.863099][15687:15687] CHIP:DIS: Updating services using commissioning mode 0 + [1690284781.863232][15687:15687] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690284781.863516][15687:15687] CHIP:DL: Using wifi MAC for hostname + [1690284781.863520][15687:15687] CHIP:DIS: Advertise operational node BC763936FB9BFB4F-0000000000000001 + [1690284781.863527][15687:15687] CHIP:DIS: Responding with _matter._tcp.local + [1690284781.863530][15687:15687] CHIP:DIS: Responding with BC763936FB9BFB4F-0000000000000001._matter._tcp.local + [1690284781.863533][15687:15687] CHIP:DIS: Responding with BC763936FB9BFB4F-0000000000000001._matter._tcp.local + [1690284781.863535][15687:15687] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284781.863537][15687:15687] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284781.863540][15687:15687] CHIP:DIS: Responding with _IBC763936FB9BFB4F._sub._matter._tcp.local + [1690284781.863541][15687:15687] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: BC763936FB9BFB4F-0000000000000001. + [1690284781.863659][15687:15687] CHIP:DIS: mDNS service published: _matter._tcp disabled: true - label: - "Step 1c: PAI Test Vector: Fallback VID and PID encoding example from - spec: valid example showing that order or separators are not - considered at all for the overall validity of the embedded fields" + "Step 1c: DAC Test Vector: Valid certificate signature algorithm + ECDSA_WITH_SHA256" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_sig_algo_ecdsa_with_sha256/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + [1690282264.371827][14553:14553] CHIP:IN: (S) Sending msg 23779882 on secure session with LSID: 16850 + [1690282264.371844][14553:14553] CHIP:DMG: Command handler moving to [CommandSen] + [1690282264.371847][14553:14553] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690282264.371851][14553:14553] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690282264.371855][14553:14553] CHIP:SVR: Commissioning completed successfully + [1690282264.371860][14553:14553] CHIP:DIS: Updating services using commissioning mode 0 + [1690282264.372005][14553:14553] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690282264.372310][14553:14553] CHIP:DL: Using wifi MAC for hostname + [1690282264.372315][14553:14553] CHIP:DIS: Advertise operational node 1D83B90391F33656-0000000000000001 + [1690282264.372322][14553:14553] CHIP:DIS: Responding with _matter._tcp.local + [1690282264.372324][14553:14553] CHIP:DIS: Responding with 1D83B90391F33656-0000000000000001._matter._tcp.local + [1690282264.372327][14553:14553] CHIP:DIS: Responding with 1D83B90391F33656-0000000000000001._matter._tcp.local + [1690282264.372329][14553:14553] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690282264.372331][14553:14553] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1d: PAI Test Vector: Fallback VID and PID encoding example: - valid but less human-readable" + "Step 1d: PAI Test Vector: Certificate Key Usage extension + digitalSignature field is wrong (not present for DAC and present for + PAI, which is OK as optional)" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_key_usage_dig_sig_wrong/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690282103.319220][14495:14495] CHIP:DMG: Command handler moving to [CommandSen] + [1690282103.319223][14495:14495] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690282103.319228][14495:14495] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690282103.319231][14495:14495] CHIP:SVR: Commissioning completed successfully + [1690282103.319237][14495:14495] CHIP:DIS: Updating services using commissioning mode 0 + [1690282103.319424][14495:14495] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690282103.319836][14495:14495] CHIP:DL: Using wifi MAC for hostname + [1690282103.319841][14495:14495] CHIP:DIS: Advertise operational node 245D3DEA8B49CCBC-0000000000000001 + [1690282103.319847][14495:14495] CHIP:DIS: Responding with _matter._tcp.local disabled: true - - label: - "Step 1e: CD Test Vector: The authorized_paa_list contains two PAAs - one of which is valid PAA authorized to sign the PAI." + - label: "Step 1e: CD Test Vector: Valid CMS digest algorithm SHA256." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_digest_algo_sha256/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690283252.582992][15010:15010] CHIP:IN: (S) Sending msg 90677485 on secure session with LSID: 13429 + [1690283252.583011][15010:15010] CHIP:DMG: Command handler moving to [CommandSen] + [1690283252.583014][15010:15010] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690283252.583020][15010:15010] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690283252.583024][15010:15010] CHIP:SVR: Commissioning completed successfully + [1690283252.583031][15010:15010] CHIP:DIS: Updating services using commissioning mode 0 + [1690283252.583246][15010:15010] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690283252.583664][15010:15010] CHIP:DL: Using wifi MAC for hostname + [1690283252.583669][15010:15010] CHIP:DIS: Advertise operational node 4A9A302B80B2F60D-0000000000000001 + [1690283252.583676][15010:15010] CHIP:DIS: Responding with _matter._tcp.local + [1690283252.583679][15010:15010] CHIP:DIS: Responding with 4A9A302B80B2F60D-0000000000000001._matter._tcp.local + [1690283252.583682][15010:15010] CHIP:DIS: Responding with 4A9A302B80B2F60D-00000000000 disabled: true - label: - "Step 1f: DAC Test Vector: Valid certificate public key curve - prime256v1" + "Step 1f: DAC Test Vector: Fallback VID and PID encoding example from + spec: valid and recommended since easily human-readable" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_02/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133857.877392][11175:11175] CHIP:IN: (S) Sending msg 86521032 on secure session with LSID: 18679 + [1691133857.877592][11175:11175] CHIP:DMG: Command handler moving to [CommandSen] + [1691133857.877626][11175:11175] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133857.877673][11175:11175] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133857.877703][11175:11175] CHIP:SVR: Commissioning completed successfully + [1691133857.877753][11175:11175] CHIP:DIS: Updating services using commissioning mode 0 + [1691133857.889402][11175:11175] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133857.918651][11175:11175] CHIP:DL: Using wifi MAC for hostname + [1691133857.918706][11175:11175] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133857.918754][11175:11175] CHIP:DIS: Responding with _matter._tcp.local disabled: true - label: "Step 1g: PAI Test Vector: Valid certificate public key curve prime256v1" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_sig_curve_prime256v1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + [1690281511.267951][14201:14201] CHIP:IN: (S) Sending msg 224547489 on secure session with LSID: 18074 + [1690281511.267975][14201:14201] CHIP:DMG: Command handler moving to [CommandSen] + [1690281511.267978][14201:14201] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690281511.267985][14201:14201] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690281511.267989][14201:14201] CHIP:SVR: Commissioning completed successfully + [1690281511.267996][14201:14201] CHIP:DIS: Updating services using commissioning mode 0 + [1690281511.268177][14201:14201] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690281511.268587][14201:14201] CHIP:DL: Using wifi MAC for hostname + [1690281511.268593][14201:14201] CHIP:DIS: Advertise operational node C149B332A9D60CE1-0000000000000001 + [1690281511.268603][14201:14201] CHIP:DIS: Responding with _matter._tcp.local + [1690281511.268607][14201:14201] CHIP:DIS: Responding with C149B332A9D60CE1-0000000000000001._matter._tcp.local + [1690281511.268611][14201:14201] CHIP:DIS: Responding with C149B332A9D60CE1-0000000000000001._matter._tcp.local + [1690281511.268614][14201:14201] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690281511.268616][14201:14201] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690281511.268621][14201:14201] CHIP:DIS: Responding with _IC149B332A9D60CE1._sub._matter._tcp.local + [1690281511.268623][14201:14201] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: C149B332A9D60CE1-0000000000000001. + [1690281511.268802][14201:14201] CHIP:DIS: mDNS service published: _matter._tcp disabled: true - label: - "Step 1h: PAI Test Vector: Certificate includes optional Authority - Information Access extension" + "Step 1h: DAC Test Vector: Fallback VID and PID encoding example from + spec: valid, but highly discouraged, since embedding of substrings + within other substrings may be confusing to human readers" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_05/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133794.712296][11157:11157] CHIP:IN: (S) Sending msg 176064909 on secure session with LSID: 23128 + [1691133794.712460][11157:11157] CHIP:DMG: Command handler moving to [CommandSen] + [1691133794.712484][11157:11157] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133794.712519][11157:11157] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133794.712541][11157:11157] CHIP:SVR: Commissioning completed successfully + [1691133794.712578][11157:11157] CHIP:DIS: Updating services using commissioning mode 0 + [1691133794.721139][11157:11157] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133794.750359][11157:11157] CHIP:DL: Using wifi MAC for hostname + [1691133794.750415][11157:11157] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133794.750462][11157:11157] CHIP:DIS: Responding with _matter._tcp.local + [1691133794.750483][11157:11157] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133794.750507][11157:11157] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133794.750525][11157:11157] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133794.750541][11157:11157] CHIP:DIS: Responding with E45F010F1A010000.local disabled: true - label: - "Step 1i: PAI Test Vector: Certificate includes optional Subject - Alternative Name extension" + "Step 1i: PAI Test Vector: Valid certificate signature algorithm + ECDSA_WITH_SHA256" + verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_sig_algo_ecdsa_with_sha256/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690282205.406742][14526:14526] CHIP:DMG: Command handler moving to [CommandSen] + [1690282205.406744][14526:14526] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690282205.406749][14526:14526] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690282205.406752][14526:14526] CHIP:SVR: Commissioning completed successfully + [1690282205.406757][14526:14526] CHIP:DIS: Updating services using commissioning mode 0 + [1690282205.406908][14526:14526] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690282205.407193][14526:14526] CHIP:DL: Using wifi MAC for hostname + [1690282205.407198][14526:14526] CHIP:DIS: Advertise operational node 0BC515CC89B3B451-0000000000000001 + [1690282205.407204][14526:14526] CHIP:DIS: Responding with _matter._tcp.local + [1690282205.407207][14526:14526] CHIP:DIS: Responding with 0BC515CC89B3B451-0000000000000001._matter._tcp.local + [1690282205.407210][14526:14526] CHIP:DIS: Responding with 0BC515CC89B3B451-0000000000000001._matter._tcp.local + [1690282205.407212][14526:14526] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690282205.407213][14526:14526] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1j: DAC Test Vector: Certificate includes optional Extended Key - Usage extension" + "Step 1j: DAC Test Vector: Fallback VID and PID encoding example from + spec: valid, but less readable" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_04/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691134005.932359][11214:11214] CHIP:DMG: Command handler moving to [CommandSen] + [1691134005.932385][11214:11214] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691134005.932425][11214:11214] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691134005.932449][11214:11214] CHIP:SVR: Commissioning completed successfully + [1691134005.932492][11214:11214] CHIP:DIS: Updating services using commissioning mode 0 + [1691134005.942626][11214:11214] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691134005.972635][11214:11214] CHIP:DL: Using wifi MAC for hostname + [1691134005.972688][11214:11214] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691134005.972733][11214:11214] CHIP:DIS: Responding with _matter._tcp.local + [1691134005.972754][11214:11214] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691134005.972778][11214:11214] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691134005.972796][11214:11214] CHIP:DIS: Responding with E45F010F1A010000.local disabled: true - label: - "Step 1k: CD Test Vector: The product_id_array field has 100 PID - values one of which matches the PID value in DAC." + "Step 1k: CD Test Vector: Valid CMS signature algorithm + ECDSA_WITH_SHA256." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_sig_algo_ecdsa_with_sha256/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690285168.741667][16055:16055] CHIP:EM: <<< [E:60515r S:59089 M:252248938 (Ack:182146297)] (S) Msg TX to 1:000000000001B669 [81EE] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690285168.741672][16055:16055] CHIP:IN: (S) Sending msg 252248938 on secure session with LSID: 59089 + [1690285168.741691][16055:16055] CHIP:DMG: Command handler moving to [CommandSen] + [1690285168.741693][16055:16055] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690285168.741698][16055:16055] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690285168.741700][16055:16055] CHIP:SVR: Commissioning completed successfully + [1690285168.741705][16055:16055] CHIP:DIS: Updating services using commissioning mode 0 + [1690285168.741839][16055:16055] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690285168.742127][16055:16055] CHIP:DL: Using wifi MAC for hostname + [1690285168.742132][16055:16055] CHIP:DIS: Advertise operational node 5C044033A18D81EE-0000000000000001 + [1690285168.742139][16055:16055] CHIP:DIS: Responding with _matter._tcp.local + [1690285168.742141][16055:16055] CHIP:DIS: Responding with 5C044033A18D81EE-0000000000000001._matter._tcp.local + [1690285168.742145][16055:16055] CHIP:DIS: Responding with 5C044033A18D81EE-0000000000000001._matter._tcp.local + [1690285168.742147][16055:16055] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690285168.742148][16055:16055] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690285168.742152][16055:16055] CHIP:DIS: Responding with _I5C044033A18D81EE._sub._matter._tcp.local + [1690285168.742154][16055:16055] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 5C044033A18D81EE-0000000000000001. + [1690285168.742275][16055:16055] CHIP:DIS: mDNS service published: _matter._tcp + [1690285168.742282][16055:16055] CHIP:IN: Expiring all PASE sessions + [1690285168.742284][16055:16055] CHIP:IN: SecureSession[0x55e03b27a900]: MarkForEviction Type:1 LSID:59088 + [1690285168.742287][16055:16055] CHIP:SC: SecureSession[0x55e03b27a900, LSID:59088]: State change 'kActive' --> 'kPendingEviction' + [1690285168.742290][16055:16055] CHIP:IN: SecureSession[0x55e03b27a900]: Released - Type:1 LSID:59088 disabled: true - label: "Step 1l: PAI Test Vector: Fallback VID and PID encoding example from - spec: valid but less readable" + spec: valid, but less readable" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_04/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133565.491036][11098:11098] CHIP:DMG: Command handler moving to [CommandSen] + [1691133565.491066][11098:11098] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133565.491112][11098:11098] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133565.491139][11098:11098] CHIP:SVR: Commissioning completed successfully + [1691133565.491182][11098:11098] CHIP:DIS: Updating services using commissioning mode 0 + [1691133565.500346][11098:11098] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133565.528577][11098:11098] CHIP:DL: Using wifi MAC for hostname + [1691133565.528631][11098:11098] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133565.528676][11098:11098] CHIP:DIS: Responding with _matter._tcp.local + [1691133565.528697][11098:11098] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133565.528721][11098:11098] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133565.528739][11098:11098] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133565.528756][11098:11098] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133565.528780][11098:11098] CHIP:DIS: Responding with _I3CBA812920C1A81B._sub._matter._tcp.local + [1691133565.528798][11098:11098] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 3CBA812920C1A81B-0000000000000001. + [1691133565.543946][11098:11098] CHIP:DIS: mDNS service published: _matter._tcp disabled: true - label: - "Step 1m: DAC Test Vector: Fallback VID and PID encoding example: - valid but less human-readable" + "Step 1m: DAC Test Vector: Certificate includes optional Extended Key + Usage extension" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_extended_key_usage_present/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690281699.777371][14314:14314] CHIP:IN: (S) Sending msg 237488731 on secure session with LSID: 53990 + [1690281699.777407][14314:14314] CHIP:DMG: Command handler moving to [CommandSen] + [1690281699.777410][14314:14314] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690281699.777416][14314:14314] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690281699.777420][14314:14314] CHIP:SVR: Commissioning completed successfully + [1690281699.777426][14314:14314] CHIP:DIS: Updating services using commissioning mode 0 + [1690281699.777580][14314:14314] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690281699.777915][14314:14314] CHIP:DL: Using wifi MAC for hostname + [1690281699.777921][14314:14314] CHIP:DIS: Advertise operational node 4B076F272AA45A20-0000000000000001 + [1690281699.777929][14314:14314] CHIP:DIS: Responding with _matter._tcp.local disabled: true - label: "Step 1n: DAC Test Vector: Mix of Fallback and Matter OID encoding for - VID and PID: valid Matter OIDs are used and wrong values in the + VID and PID: valid, Matter OIDs are used and wrong values in the common-name are ignored" verification: | - Verify that the TH is successfully commissioned for each test case - disabled: true + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_15/test_case_vector.json --product-id 177 - - label: - "Step 1o: CD Test Vector: The dac_origin_vendor_id and - dac_origin_product_id fields are not present." - verification: | - Verify that the TH is successfully commissioned for each test case + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + 691133646.091682][11117:11117] CHIP:EM: <<< [E:50678r S:27653 M:163771128 (Ack:45828179)] (S) Msg TX to 1:000000000001B669 [A81B] --- Type 0001:09 (IM:InvokeCommandResponse) + [1691133646.091736][11117:11117] CHIP:IN: (S) Sending msg 163771128 on secure session with LSID: 27653 + [1691133646.091927][11117:11117] CHIP:DMG: Command handler moving to [CommandSen] + [1691133646.091951][11117:11117] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133646.091990][11117:11117] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133646.092012][11117:11117] CHIP:SVR: Commissioning completed successfully + [1691133646.092051][11117:11117] CHIP:DIS: Updating services using commissioning mode 0 + [1691133646.101029][11117:11117] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133646.130460][11117:11117] CHIP:DL: Using wifi MAC for hostname disabled: true - label: - "Step 1p: PAI Test Vector: Certificate Key Usage extension - diginalSignature field is wrong (not present for DAC and present for - PAI which is OK as optional)" + "Step 1o: CD Test Vector: The product_id_array field has one PID value + which matches the PID value in DAC." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_pid_array_count01_valid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690280928.950144][13907:13907] CHIP:DMG: { + [1690280928.950146][13907:13907] CHIP:DMG: peer_address = UDP:[fe80::5a6b:cc3a:f0c1:ab99%wlp0s20f3]:44344 + [1690280928.950147][13907:13907] CHIP:DMG: } + [1690280928.950149][13907:13907] CHIP:DMG: + [1690280928.950160][13907:13907] CHIP:EM: <<< [E:42046r S:55761 M:4615769 (Ack:127152057)] (S) Msg TX to 1:000000000001B669 [BCFB] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690280928.950165][13907:13907] CHIP:IN: (S) Sending msg 4615769 on secure session with LSID: 55761 + [1690280928.950185][13907:13907] CHIP:DMG: Command handler moving to [CommandSen] + [1690280928.950187][13907:13907] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690280928.950192][13907:13907] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690280928.950195][13907:13907] CHIP:SVR: Commissioning completed successfully + [1690280928.950200][13907:13907] CHIP:DIS: Updating services using commissioning mode 0 + [1690280928.950333][13907:13907] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690280928.950625][13907:13907] CHIP:DL: Using wifi MAC for hostname + [1690280928.950629][13907:13907] CHIP:DIS: Advertise operational node 48D63053063CBCFB-0000000000000001 + [1690280928.950636][13907:13907] CHIP:DIS: Responding with _matter._tcp.local + [1690280928.950638][13907:13907] CHIP:DIS: Responding with 48D63053063CBCFB-0000000000000001._matter._tcp.local + [1690280928.950642][13907:13907] CHIP:DIS: Responding with 48D63053063CBCFB-0000000000000001._matter._tcp.local + [1690280928.950644][13907:13907] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690280928.950646][13907:13907] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690280928.950650][13907:13907] CHIP:DIS: Responding with _I48D63053063CBCFB._sub._matter._tcp.local + [1690280928.950651][13907:13907] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 48D63053063CBCFB-0000000000000001. + [1690280928.950815][13907:13907] CHIP:DIS: mDNS service published: _matter._tcp disabled: true - - label: - "Step 1q: PAI Test Vector: Valid certificate signature algorithm - ECDSA_WITH_SHA256" + - label: "Step 1p: CD Test Vector: Valid format_version field set to 1." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_format_version_1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + [1690283303.542736][15037:15037] CHIP:IN: (S) Sending msg 210903775 on secure session with LSID: 64447 + [1690283303.542761][15037:15037] CHIP:DMG: Command handler moving to [CommandSen] + [1690283303.542763][15037:15037] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690283303.542769][15037:15037] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690283303.542772][15037:15037] CHIP:SVR: Commissioning completed successfully + [1690283303.542778][15037:15037] CHIP:DIS: Updating services using commissioning mode 0 + [1690283303.542948][15037:15037] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690283303.543270][15037:15037] CHIP:DL: Using wifi MAC for hostname + [1690283303.543275][15037:15037] CHIP:DIS: Advertise operational node 5F5C8ABEB09C0582-0000000000000001 + [1690283303.543281][15037:15037] CHIP:DIS: Responding with _matter._tcp.local + [1690283303.543283][15037:15037] CHIP:DIS: Responding with 5F5C8ABEB09C0582-0000000000000001._matter._tcp.local + [1690283303.543287][15037:15037] CHIP:DIS: Responding with 5F5C8ABEB09C0582-0000000000000001._matter._tcp.local + [1690283303.543290][15037:15037] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690283303.543293][15037:15037] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - - label: - "Step 1r: DAC Test Vector: Valid certificate signature algorithm - ECDSA_WITH_SHA256" + - label: "Step 1q: CD Test Vector: Valid CMS eContentType pkcs7-data." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_econtent_type_pkcs7_data/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690284421.688328][15513:15513] CHIP:EM: <<< [E:57094r S:37474 M:62088858 (Ack:198482245)] (S) Msg TX to 1:000000000001B669 [9014] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690284421.688334][15513:15513] CHIP:IN: (S) Sending msg 62088858 on secure session with LSID: 37474 + [1690284421.688360][15513:15513] CHIP:DMG: Command handler moving to [CommandSen] + [1690284421.688362][15513:15513] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690284421.688382][15513:15513] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690284421.688386][15513:15513] CHIP:SVR: Commissioning completed successfully + [1690284421.688393][15513:15513] CHIP:DIS: Updating services using commissioning mode 0 + [1690284421.688535][15513:15513] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690284421.688930][15513:15513] CHIP:DL: Using wifi MAC for hostname + [1690284421.688935][15513:15513] CHIP:DIS: Advertise operational node 77378B1179759014-0000000000000001 + [1690284421.688945][15513:15513] CHIP:DIS: Responding with _matter._tcp.local + [1690284421.688948][15513:15513] CHIP:DIS: Responding with 77378B1179759014-0000000000000001._matter._tcp.local + [1690284421.688952][15513:15513] CHIP:DIS: Responding with 77378B1179759014-0000000000000001._matter._tcp.local + [1690284421.688955][15513:15513] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284421.688957][15513:15513] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1s: DAC Test Vector: Fallback VID and PID encoding example from + "Step 1r: DAC Test Vector: Fallback VID and PID encoding example from spec: valid example showing that order or separators are not considered at all for the overall validity of the embedded fields" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_03/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133683.498853][11126:11126] CHIP:EM: <<< [E:25280r S:10496 M:16556542 (Ack:4636808)] (S) Msg TX to 1:000000000001B669 [A81B] --- Type 0001:09 (IM:InvokeCommandResponse) + [1691133683.498897][11126:11126] CHIP:IN: (S) Sending msg 16556542 on secure session with LSID: 10496 + [1691133683.499062][11126:11126] CHIP:DMG: Command handler moving to [CommandSen] + [1691133683.499084][11126:11126] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133683.499121][11126:11126] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133683.499143][11126:11126] CHIP:SVR: Commissioning completed successfully + [1691133683.499178][11126:11126] CHIP:DIS: Updating services using commissioning mode 0 + [1691133683.507672][11126:11126] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133683.538207][11126:11126] CHIP:DL: Using wifi MAC for hostname + [1691133683.538269][11126:11126] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133683.538318][11126:11126] CHIP:DIS: Responding with _matter._tcp.local disabled: true - - label: "Step 1t: CD Test Vector: Valid CMS version set to v3." + - label: "Step 1s: struct_cd_authorized_paa_list_count1_valid (pid=32768)" + PICS: + "CD Test Vector: The authorized_paa_list contains one valid PAA which + is authorized to sign the PAI." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_authorized_paa_list_count1_valid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690284610.899952][15595:15595] CHIP:IN: (S) Sending msg 181434251 on secure session with LSID: 27220 + [1690284610.899971][15595:15595] CHIP:DMG: Command handler moving to [CommandSen] + [1690284610.899974][15595:15595] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690284610.899980][15595:15595] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690284610.899983][15595:15595] CHIP:SVR: Commissioning completed successfully + [1690284610.899990][15595:15595] CHIP:DIS: Updating services using commissioning mode 0 + [1690284610.900176][15595:15595] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690284610.900592][15595:15595] CHIP:DL: Using wifi MAC for hostname + [1690284610.900597][15595:15595] CHIP:DIS: Advertise operational node B50245B397D68077-0000000000000001 + [1690284610.900604][15595:15595] CHIP:DIS: Responding with _matter._tcp.local + [1690284610.900608][15595:15595] CHIP:DIS: Responding with B50245B397D68077-0000000000000001._matter._tcp.local + [1690284610.900611][15595:15595] CHIP:DIS: Responding with B50245B397D68077-0000000000000001._matter._tcp.local + [1690284610.900612][15595:15595] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284610.900614][15595:15595] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1u: PAI Test Vector: Fallback VID and PID encoding example from - spec: valid and recommended since easily human-readable" + "Step 1t: DAC Test Vector: Certificate includes optional Authority + Information Access extension" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_authority_info_access_present/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + [1690282820.254108][14791:14791] CHIP:EM: <<< [E:60778r S:62234 M:190073547 (Ack:21030011)] (S) Msg TX to 1:000000000001B669 [D14E] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690282820.254113][14791:14791] CHIP:IN: (S) Sending msg 190073547 on secure session with LSID: 62234 + [1690282820.254132][14791:14791] CHIP:DMG: Command handler moving to [CommandSen] + [1690282820.254134][14791:14791] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690282820.254140][14791:14791] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690282820.254144][14791:14791] CHIP:SVR: Commissioning completed successfully + [1690282820.254151][14791:14791] CHIP:DIS: Updating services using commissioning mode 0 + [1690282820.254349][14791:14791] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690282820.254759][14791:14791] CHIP:DL: Using wifi MAC for hostname + [1690282820.254764][14791:14791] CHIP:DIS: Advertise operational node CEA5FEC505CBD14E-0000000000000001 + [1690282820.254771][14791:14791] CHIP:DIS: Responding with _matter._tcp.local + [1690282820.254774][14791:14791] CHIP:DIS: Responding with CEA5FEC505CBD14E-0000000000000001._matter._tcp.local + [1690282820.254777][14791:14791] CHIP:DIS: Responding with CEA5FEC505CBD14E-0000000000000001._matter._tcp.local + [1690282820.254779][14791:14791] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1v: CD Test Vector: The subjectKeyIdentifier contains SKID of a - well-known Zigbee Alliance certificate." + "Step 1u: PAI Test Vector: Certificate includes optional Subject + Alternative Name extension" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_subject_alt_name_present/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690281643.630949][14294:14294] CHIP:DMG: + [1690281643.630963][14294:14294] CHIP:EM: <<< [E:39979r S:47218 M:84512679 (Ack:239864246)] (S) Msg TX to 1:000000000001B669 [1239] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690281643.630969][14294:14294] CHIP:IN: (S) Sending msg 84512679 on secure session with LSID: 47218 + [1690281643.630996][14294:14294] CHIP:DMG: Command handler moving to [CommandSen] + [1690281643.630999][14294:14294] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690281643.631018][14294:14294] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690281643.631022][14294:14294] CHIP:SVR: Commissioning completed successfully + [1690281643.631028][14294:14294] CHIP:DIS: Updating services using commissioning mode 0 + [1690281643.631184][14294:14294] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690281643.631535][14294:14294] CHIP:DL: Using wifi MAC for hostname + [1690281643.631541][14294:14294] CHIP:DIS: Advertise operational node 5CFD1EA3CA4F1239-0000000000000001 + [1690281643.631549][14294:14294] CHIP:DIS: Responding with _matter._tcp.local + [1690281643.631552][14294:14294] CHIP:DIS: Responding with 5CFD1EA3CA4F1239-0000000000000001._matter._tcp.local + [1690281643.631557][14294:14294] CHIP:DIS: Responding with 5CFD1EA3CA4F1239-0000000000000001._matter._tcp.local + [1690281643.631559][14294:14294] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690281643.631561][14294:14294] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690281643.631566][14294:14294] CHIP:DIS: Responding with _I5CFD1EA3CA4F1239._sub._matter._tcp.local + [1690281643.631569][14294:14294] CHIP:DIS: CHIP minimal mDNS configured as 'Operational devic disabled: true - label: - "Step 1w: PAI Test Vector: Certificate Basic Constraint extension - PathLen field set to 0" + "Step 1v: PAI Test Vector: Valid certificate version field set to + v3(2)" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_cert_version_v3/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690284881.973167][15840:15840] CHIP:IN: (S) Sending msg 66827213 on secure session with LSID: 9046 + [1690284881.973187][15840:15840] CHIP:DMG: Command handler moving to [CommandSen] + [1690284881.973189][15840:15840] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690284881.973194][15840:15840] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690284881.973198][15840:15840] CHIP:SVR: Commissioning completed successfully + [1690284881.973204][15840:15840] CHIP:DIS: Updating services using commissioning mode 0 + [1690284881.973368][15840:15840] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690284881.973707][15840:15840] CHIP:DL: Using wifi MAC for hostname + [1690284881.973712][15840:15840] CHIP:DIS: Advertise operational node 7EA725F8C916B163-0000000000000001 + [1690284881.973718][15840:15840] CHIP:DIS: Responding with _matter._tcp.local + [1690284881.973722][15840:15840] CHIP:DIS: Responding with 7EA725F8C916B163-0000000000000001._matter._tcp.local + [1690284881.973727][15840:15840] CHIP:DIS: Responding with 7EA725F8C916B163-0000000000000001._matter._tcp.local + [1690284881.973730][15840:15840] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284881.973732][15840:15840] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284881.973736][15840:15840] CHIP:DIS: Responding with _I7EA725F8C916B163._sub._matter._tcp.local + [1690284881.973738][15840:15840] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 7EA725F8C916B163-0000000000000001. + [1690284881.973870][15840:15840] CHIP:DIS: mDNS service published: _matter._tcp + [1690284881.973878][15840:15840] CHIP:IN: Expiring all PASE sessions disabled: true - label: - "Step 1x: DAC Test Vector: Certificate includes optional Authority - Information Access extension" + "Step 1x: DAC Test Vector: Valid certificate public key curve + prime256v1" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_sig_curve_prime256v1/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690281455.843936][14173:14173] CHIP:DMG: Command handler moving to [CommandSen] + [1690281455.843939][14173:14173] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690281455.843945][14173:14173] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690281455.843948][14173:14173] CHIP:SVR: Commissioning completed successfully + [1690281455.843955][14173:14173] CHIP:DIS: Updating services using commissioning mode 0 + [1690281455.844138][14173:14173] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690281455.844557][14173:14173] CHIP:DL: Using wifi MAC for hostname + [1690281455.844562][14173:14173] CHIP:DIS: Advertise operational node 11190E6CBCA37351-0000000000000001 + [1690281455.844572][14173:14173] CHIP:DIS: Responding with _matter._tcp.local + [1690281455.844574][14173:14173] CHIP:DIS: Responding with 11190E6CBCA37351-0000000000000001._matter._tcp.local + [1690281455.844577][14173:14173] CHIP:DIS: Responding with 11190E6CBCA37351-0000000000000001._matter._tcp.local + [1690281455.844579][14173:14173] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690281455.844580][14173:14173] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690281455.844584][14173:14173] CHIP:DIS: Responding with _I11190E6CBCA37351._sub._matter._tcp.local + [1690281455.844585][14173:14173] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 11190E6CBCA37351-0000000000000001. + [1690281455.844712][14173:14173] CHIP:DIS: mDNS service published: _matter._tcp disabled: true - label: - "Step 1y: PAI Test Vector: Fallback VID and PID encoding example from - spec: invalid since substring following Mpid: is not exactly 4 - uppercase hexadecimal digits" + "Step 1y: CD Test Vector: Origin VID/PID different than VID/PID + (correct use of origin)" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_origin_pid_vid_correct/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690284963.167271][15885:15885] CHIP:EM: <<< [E:48097r S:38151 M:153690039 (Ack:256986686)] (S) Msg TX to 1:000000000001B669 [DC37] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690284963.167276][15885:15885] CHIP:IN: (S) Sending msg 153690039 on secure session with LSID: 38151 + [1690284963.167295][15885:15885] CHIP:DMG: Command handler moving to [CommandSen] + [1690284963.167297][15885:15885] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690284963.167301][15885:15885] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690284963.167305][15885:15885] CHIP:SVR: Commissioning completed successfully + [1690284963.167310][15885:15885] CHIP:DIS: Updating services using commissioning mode 0 + [1690284963.167458][15885:15885] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690284963.167793][15885:15885] CHIP:DL: Using wifi MAC for hostname + [1690284963.167799][15885:15885] CHIP:DIS: Advertise operational node D641EF3E2998DC37-0000000000000001 + [1690284963.167806][15885:15885] CHIP:DIS: Responding with _matter._tcp.local + [1690284963.167809][15885:15885] CHIP:DIS: Responding with D641EF3E2998DC37-0000000000000001._matter._tcp.local + [1690284963.167813][15885:15885] CHIP:DIS: Responding with D641EF3E2998DC37-0000000000000001._matter._tcp.local + [1690284963.167815][15885:15885] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284963.167817][15885:15885] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284963.167821][15885:15885] CHIP:DIS: Responding with _ID641EF3E2998DC37._sub._matter._tcp.local + [1690284963.167822][15885:15885] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: D641EF3E2998DC37-0000000000000001. + [1690284963.167955][15885:15885] CHIP:DIS: mDNS service published: _matter._tcp + [1690284963.167963][15885:15885] CHIP:IN: Expiring all PASE sessions + [1690284963.167966][15885:15885] CHIP:IN: SecureSession[0x55781da28900]: MarkForEviction Type:1 LSID:38150 + [1690284963.167968][15885:15885] CHIP:SC: SecureSession[0x55781da28900, LSID:38150]: State change 'kActive' --> 'kPendingEviction' + [1690284963.167971][15885:15885] CHIP:IN: SecureSession[0x55781da28900]: Released - Type:1 LSID:38150 disabled: true - label: - "Step 1z: DAC Test Vector: Fallback VID and PID encoding example from - spec: valid but less readable" + "Step 1z: DAC Test Vector: Fallback VID and PID encoding example: + valid, but less human-readable" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_11/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133604.268090][11108:11108] CHIP:IN: (S) Sending msg 242960033 on secure session with LSID: 63451 + [1691133604.268262][11108:11108] CHIP:DMG: Command handler moving to [CommandSen] + [1691133604.268288][11108:11108] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133604.268325][11108:11108] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133604.268347][11108:11108] CHIP:SVR: Commissioning completed successfully + [1691133604.268383][11108:11108] CHIP:DIS: Updating services using commissioning mode 0 + [1691133604.276764][11108:11108] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133604.304404][11108:11108] CHIP:DL: Using wifi MAC for hostname + [1691133604.304458][11108:11108] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133604.304504][11108:11108] CHIP:DIS: Responding with _matter._tcp.local + [1691133604.304525][11108:11108] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133604.304549][11108:11108] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133604.304567][11108:11108] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133604.304584][11108:11108] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133604.304607][11108:11108] CHIP:DIS: Responding with _I3CBA812920C1A81B._sub._matter._tcp.local + [1691133604.304625][11108:11108] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 3CBA812920C1A81B-0000000000000001. + [1691133604.318978][11108:11108] CHIP:DIS: mDNS service published: _matter._tcp disabled: true - label: - "Step 1a1: PAI Test Vector: Certificate includes optional Extended Key - Usage extension" + "Step 1a1: CD Test Vector: The optional authorized_paa_list field is + not present." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_11/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133604.268090][11108:11108] CHIP:IN: (S) Sending msg 242960033 on secure session with LSID: 63451 + [1691133604.268262][11108:11108] CHIP:DMG: Command handler moving to [CommandSen] + [1691133604.268288][11108:11108] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133604.268325][11108:11108] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133604.268347][11108:11108] CHIP:SVR: Commissioning completed successfully + [1691133604.268383][11108:11108] CHIP:DIS: Updating services using commissioning mode 0 + [1691133604.276764][11108:11108] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133604.304404][11108:11108] CHIP:DL: Using wifi MAC for hostname + [1691133604.304458][11108:11108] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133604.304504][11108:11108] CHIP:DIS: Responding with _matter._tcp.local + [1691133604.304525][11108:11108] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133604.304549][11108:11108] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133604.304567][11108:11108] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133604.304584][11108:11108] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133604.304607][11108:11108] CHIP:DIS: Responding with _I3CBA812920C1A81B._sub._matter._tcp.local + [1691133604.304625][11108:11108] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 3CBA812920C1A81B-0000000000000001. + [1691133604.318978][11108:11108] CHIP:DIS: mDNS service published: _matter._tcp disabled: true - label: - "Step 1a2: PAI Test Vector: Fallback VID and PID encoding example from - spec: valid and recommended since easily human-readable" + "Step 1a2: PAI Test Vector: Certificate Basic Constraint extension + PathLen field set to 0" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_basic_pathlen0/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690282754.571961][14759:14759] CHIP:IN: (S) Sending msg 91936501 on secure session with LSID: 30223 + [1690282754.571981][14759:14759] CHIP:DMG: Command handler moving to [CommandSen] + [1690282754.571983][14759:14759] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690282754.571988][14759:14759] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690282754.571991][14759:14759] CHIP:SVR: Commissioning completed successfully + [1690282754.571996][14759:14759] CHIP:DIS: Updating services using commissioning mode 0 + [1690282754.572134][14759:14759] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690282754.572426][14759:14759] CHIP:DL: Using wifi MAC for hostname + [1690282754.572430][14759:14759] CHIP:DIS: Advertise operational node 58FC20AC9B9D8E05-0000000000000001 + [1690282754.572437][14759:14759] CHIP:DIS: Responding with _matter._tcp.local + [1690282754.572439][14759:14759] CHIP:DIS: Responding with 58FC20AC9B9D8E05-0000000000000001._matter._tcp.local + [1690282754.572443][14759:14759] CHIP:DIS: Responding with 58FC20AC9B9D8E05-0000000000000001._matter._tcp.local + [1690282754.572445][14759:14759] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690282754.572446][14759:14759] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1a3: CD Test Vector: The product_id_array field has 10 PID - values one of which matches the PID value in DAC." + "Step 1a3: PAI Test Vector: Certificate includes optional Extended Key + Usage extension" verification: | - Verify that the TH is successfully commissioned for each test case - disabled: true + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider credentials/development/commissioner_dut/struct_pai_ext_extended_key_usage_present/test_case_vector.json --product-id 32768 - - label: "Step 1a4: CD Test Vector: Valid CMS digest algorithm SHA256." - verification: | - Verify that the TH is successfully commissioned for each test case + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690283021.015921][14889:14889] CHIP:EM: <<< [E:60698r S:45413 M:45750376 (Ack:107099218)] (S) Msg TX to 1:000000000001B669 [1780] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690283021.015926][14889:14889] CHIP:IN: (S) Sending msg 45750376 on secure session with LSID: 45413 + [1690283021.015944][14889:14889] CHIP:DMG: Command handler moving to [CommandSen] + [1690283021.015946][14889:14889] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690283021.015952][14889:14889] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690283021.015955][14889:14889] CHIP:SVR: Commissioning completed successfully + [1690283021.015961][14889:14889] CHIP:DIS: Updating services using commissioning mode 0 + [1690283021.016106][14889:14889] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690283021.016432][14889:14889] CHIP:DL: Using wifi MAC for hostname + [1690283021.016437][14889:14889] CHIP:DIS: Advertise operational node 6189A454650D1780-0000000000000001 + [1690283021.016444][14889:14889] CHIP:DIS: Responding with _matter._tcp.local + [1690283021.016448][14889:14889] CHIP:DIS: Responding with 6189A454650D1780-0000000000000001._matter._tcp.local + [1690283021.016451][14889:14889] CHIP:DIS: Responding with 6189A454650D1780-0000000000000001._matter._tcp.local + [1690283021.016453][14889:14889] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - - label: "Step 1a5: CD Test Vector: Valid format_version field set to 1." + - label: + "Step 1a4: CD Test Vector: The authorized_paa_list contains two PAAs + one of which is valid PAA authorized to sign the PAI." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_authorized_paa_list_count2_valid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690281322.025731][14131:14131] CHIP:IN: (S) Sending msg 41804784 on secure session with LSID: 9174 + [1690281322.025755][14131:14131] CHIP:DMG: Command handler moving to [CommandSen] + [1690281322.025758][14131:14131] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690281322.025764][14131:14131] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690281322.025767][14131:14131] CHIP:SVR: Commissioning completed successfully + [1690281322.025775][14131:14131] CHIP:DIS: Updating services using commissioning mode 0 + [1690281322.025963][14131:14131] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690281322.026393][14131:14131] CHIP:DL: Using wifi MAC for hostname + [1690281322.026399][14131:14131] CHIP:DIS: Advertise operational node 84F519477133A8DD-0000000000000001 + [1690281322.026406][14131:14131] CHIP:DIS: Responding with _matter._tcp.local + [1690281322.026409][14131:14131] CHIP:DIS: Responding with 84F519477133A8DD-0000000000000001._matter._tcp.local + [1690281322.026412][14131:14131] CHIP:DIS: Responding with 84F519477133A8DD-0000000000000001._matter._tcp.local + [1690281322.026414][14131:14131] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690281322.026415][14131:14131] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690281322.026418][14131:14131] CHIP:DIS: Responding with _I84F519477133A8DD._sub._matter._tcp.local + [1690281322.026420][14131:14131] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 84F519477133A8DD-0000000000000001. + [1690281322.026553][14131:14131] CHIP:DIS: mDNS service published: _matter._tcp + [1690281322.026574][14131:14131] CHIP:IN: Expiring all PASE sessions + [1690281322.026577][14131:14131] CHIP:IN: SecureSession[0x5622cf2b9900]: MarkForEviction Type:1 LSID:9173 + [1690281322.026580][14131:14131] CHIP:SC: SecureSession[0x5622cf2b9900, LSID:9173]: State change 'kActive' --> 'kPendingEviction' + [1690281322.026585][14131:14131] CHIP:IN: SecureSession[0x5622cf2b9900]: Released - Type:1 LSID:9173 disabled: true - label: - "Step 1a6: PAI Test Vector: Fallback VID and PID encoding example from - spec: valid but highly discouraged since embedding of substrings - within other substrings may be confusing to human readers" + "Step 1a5: PAI Test Vector: Fallback VID and PID encoding example: + valid, but less human-readable" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_11/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133504.964515][11082:11082] CHIP:IN: (S) Sending msg 180652456 on secure session with LSID: 17161 + [1691133504.964688][11082:11082] CHIP:DMG: Command handler moving to [CommandSen] + [1691133504.964712][11082:11082] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133504.964751][11082:11082] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133504.964774][11082:11082] CHIP:SVR: Commissioning completed successfully + [1691133504.964812][11082:11082] CHIP:DIS: Updating services using commissioning mode 0 + [1691133504.973810][11082:11082] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133505.002105][11082:11082] CHIP:DL: Using wifi MAC for hostname + [1691133505.002160][11082:11082] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133505.002206][11082:11082] CHIP:DIS: Responding with _matter._tcp.local + [1691133505.002228][11082:11082] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133505.002252][11082:11082] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133505.002270][11082:11082] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133505.002287][11082:11082] CHIP:DIS: Responding with E45F010F1A010000.local disabled: true - label: - "Step 1a7: CD Test Vector: The version_number field matches the VID - and PID used in a DeviceSoftwareVersionModel entry in the DCL matching - the certification record associated with the product presenting this - CD." + "Step 1a6: PAI Test Vector: Certificate includes optional Authority + Information Access extension" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_ext_authority_info_access_present/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690281588.041492][14260:14260] CHIP:IN: (S) Sending msg 97011383 on secure session with LSID: 55955 + [1690281588.041512][14260:14260] CHIP:DMG: Command handler moving to [CommandSen] + [1690281588.041514][14260:14260] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690281588.041518][14260:14260] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690281588.041521][14260:14260] CHIP:SVR: Commissioning completed successfully + [1690281588.041527][14260:14260] CHIP:DIS: Updating services using commissioning mode 0 + [1690281588.041673][14260:14260] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690281588.041987][14260:14260] CHIP:DL: Using wifi MAC for hostname + [1690281588.041991][14260:14260] CHIP:DIS: Advertise operational node 2B6360850F2AA29E-0000000000000001 + [1690281588.041998][14260:14260] CHIP:DIS: Responding with _matter._tcp.local + [1690281588.042001][14260:14260] CHIP:DIS: Responding with 2B6360850F2AA29E-0000000000000001._matter._tcp.local + [1690281588.042004][14260:14260] CHIP:DIS: Responding with 2B6360850F2AA29E-0000000000000001._matter._tcp.local + [1690281588.042006][14260:14260] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - - label: "Step 1a8: CD Test Vector: Valid CMS eContentType pkcs7-data." + - label: + "Step 1a7: CD Test Vector: The product_id_array field has 10 PID + values one of which matches the PID value in DAC." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_pid_array_count10_valid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690283198.563854][14969:14969] CHIP:DMG: + [1690283198.563874][14969:14969] CHIP:EM: <<< [E:31520r S:48689 M:92701905 (Ack:201369370)] (S) Msg TX to 1:000000000001B669 [665B] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690283198.563880][14969:14969] CHIP:IN: (S) Sending msg 92701905 on secure session with LSID: 48689 + [1690283198.563904][14969:14969] CHIP:DMG: Command handler moving to [CommandSen] + [1690283198.563906][14969:14969] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690283198.563912][14969:14969] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690283198.563931][14969:14969] CHIP:SVR: Commissioning completed successfully + [1690283198.563937][14969:14969] CHIP:DIS: Updating services using commissioning mode 0 + [1690283198.564081][14969:14969] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690283198.564368][14969:14969] CHIP:DL: Using wifi MAC for hostname + [1690283198.564373][14969:14969] CHIP:DIS: Advertise operational node ED9E34CD70DA665B-0000000000000001 + [1690283198.564379][14969:14969] CHIP:DIS: Responding with _matter._tcp.local + [1690283198.564382][14969:14969] CHIP:DIS: Responding with ED9E34CD70DA665B-0000000000000001._matter._tcp.local + [1690283198.564385][14969:14969] CHIP:DIS: Responding with ED9E34CD70DA665B-0000000000000001._matter._tcp.local + [1690283198.564388][14969:14969] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690283198.564391][14969:14969] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690283198.564395][14969:14969] CHIP:DIS: Responding with _IED9E34CD70DA665B._sub._matter._tcp.local disabled: true - label: - "Step 1a9: CD Test Vector: The optional authorized_paa_list field is - not present." + "Step 1a8: PAI Test Vector: Fallback VID and PID encoding example from + spec: valid and recommended since easily human-readable" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_01/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + + [1691133717.188791][11135:11135] CHIP:DMG: Command handler moving to [CommandSen] + [1691133717.188813][11135:11135] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133717.188851][11135:11135] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133717.188873][11135:11135] CHIP:SVR: Commissioning completed successfully + [1691133717.188963][11135:11135] CHIP:DIS: Updating services using commissioning mode 0 + [1691133717.197295][11135:11135] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133717.227051][11135:11135] CHIP:DL: Using wifi MAC for hostname + [1691133717.227105][11135:11135] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133717.227151][11135:11135] CHIP:DIS: Responding with _matter._tcp.local + [1691133717.227173][11135:11135] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133717.227196][11135:11135] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133717.227213][11135:11135] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133717.227230][11135:11135] CHIP:DIS: Responding with E45F010F1A010000.local disabled: true - label: - "Step 1a10: CD Test Vector: The authorized_paa_list contains one valid - PAA which is authorized to sign the PAI." + "Step 1a9: PAI Test Vector: Mix of Fallback and Matter OID encoding + for VID and PID: valid, Matter OIDs are used and wrong values in the + common-name are ignored" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_15/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + + [1691133823.605618][11166:11166] CHIP:IN: (S) Sending msg 86167972 on secure session with LSID: 25854 + [1691133823.605816][11166:11166] CHIP:DMG: Command handler moving to [CommandSen] + [1691133823.605843][11166:11166] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133823.605884][11166:11166] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133823.605908][11166:11166] CHIP:SVR: Commissioning completed successfully + [1691133823.605951][11166:11166] CHIP:DIS: Updating services using commissioning mode 0 + [1691133823.615735][11166:11166] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133823.644833][11166:11166] CHIP:DL: Using wifi MAC for hostname + [1691133823.644901][11166:11166] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133823.644958][11166:11166] CHIP:DIS: Responding with _matter._tcp.local + [1691133823.644980][11166:11166] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133823.645003][11166:11166] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133823.645021][11166:11166] CHIP:DIS: Responding with E45F010F1A010000.local disabled: true - label: - "Step 1a11: DAC Test Vector: Certificate includes optional Subject - Alternative Name extension" + "Step 1a10: CD Test Vector: The dac_origin_vendor_id and + dac_origin_product_id fields are not present." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_dac_origin_vid_pid_missing/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690282050.659492][14471:14471] CHIP:IN: (S) Sending msg 139602564 on secure session with LSID: 47523 + [1690282050.659514][14471:14471] CHIP:DMG: Command handler moving to [CommandSen] + [1690282050.659516][14471:14471] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690282050.659521][14471:14471] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690282050.659525][14471:14471] CHIP:SVR: Commissioning completed successfully + [1690282050.659530][14471:14471] CHIP:DIS: Updating services using commissioning mode 0 + [1690282050.659681][14471:14471] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690282050.659967][14471:14471] CHIP:DL: Using wifi MAC for hostname + [1690282050.659972][14471:14471] CHIP:DIS: Advertise operational node E18AD0BA9454A7B3-0000000000000001 + [1690282050.659978][14471:14471] CHIP:DIS: Responding with _matter._tcp.local + [1690282050.659981][14471:14471] CHIP:DIS: Responding with E18AD0BA9454A7B3-0000000000000001._matter._tcp.local + [1690282050.659983][14471:14471] CHIP:DIS: Responding with E18AD0BA9454A7B3-0000000000000001._matter._tcp.local + [1690282050.659986][14471:14471] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690282050.659988][14471:14471] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1a12: CD Test Vector: The authorized_paa_list contains ten PAAs - one of which is valid PAA authorized to sign the PAI." + "Step 1a11: PAI Test Vector: Fallback VID and PID encoding example + from spec: valid, but highly discouraged, since embedding of + substrings within other substrings may be confusing to human readers" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_05/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133942.195845][11196:11196] CHIP:DMG: Command handler moving to [CommandSen] + [1691133942.195895][11196:11196] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133942.195932][11196:11196] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133942.195954][11196:11196] CHIP:SVR: Commissioning completed successfully + [1691133942.195992][11196:11196] CHIP:DIS: Updating services using commissioning mode 0 + [1691133942.204326][11196:11196] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133942.234088][11196:11196] CHIP:DL: Using wifi MAC for hostname + [1691133942.234144][11196:11196] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133942.234191][11196:11196] CHIP:DIS: Responding with _matter._tcp.local + [1691133942.234211][11196:11196] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133942.234236][11196:11196] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133942.234253][11196:11196] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133942.234270][11196:11196] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133942.234293][11196:11196] CHIP:DIS: Responding with _I3CBA812920C1A81B._sub._matter._tcp.local + [1691133942.234310][11196:11196] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 3CBA812920C1A81B-0000000000000001. + [1691133942.248506][11196:11196] CHIP:DIS: mDNS service published: _matter._tcp + [1691133942.248592][11196:11196] CHIP:IN: Expiring all PASE sessions disabled: true - label: - "Step 1a13: CD Test Vector: The dac_origin_vendor_id and - dac_origin_product_id fields present and contain the VID and PID - values that match the VID and PID found in the DAC Subject DN." + "Step 1a12: DAC Test Vector: Fallback VID and PID encoding example + from spec: valid and recommended since easily human-readable" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_vidpid_fallback_encoding_01/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133758.299501][11147:11147] CHIP:DMG: Command handler moving to [CommandSen] + [1691133758.299527][11147:11147] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133758.299566][11147:11147] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133758.299588][11147:11147] CHIP:SVR: Commissioning completed successfully + [1691133758.299645][11147:11147] CHIP:DIS: Updating services using commissioning mode 0 + [1691133758.308433][11147:11147] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133758.337691][11147:11147] CHIP:DL: Using wifi MAC for hostname + [1691133758.337745][11147:11147] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133758.337792][11147:11147] CHIP:DIS: Responding with _matter._tcp.local + [1691133758.337813][11147:11147] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133758.337837][11147:11147] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133758.337855][11147:11147] CHIP:DIS: Responding with E45F010F1A010000.local disabled: true - label: - "Step 1a14: PAI Test Vector: Valid certificate version field set to - v3(2)" + "Step 1a13: CD Test Vector: The product_id_array field has 100 PID + values one of which matches the PID value in DAC." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_pid_array_count100_valid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + [1690281746.033133][14335:14335] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690281746.033152][14335:14335] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690281746.033155][14335:14335] CHIP:SVR: Commissioning completed successfully + [1690281746.033161][14335:14335] CHIP:DIS: Updating services using commissioning mode 0 + [1690281746.033313][14335:14335] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690281746.033672][14335:14335] CHIP:DL: Using wifi MAC for hostname + [1690281746.033678][14335:14335] CHIP:DIS: Advertise operational node B859A17C7F0CAC6A-0000000000000001 + [1690281746.033685][14335:14335] CHIP:DIS: Responding with _matter._tcp.local + [1690281746.033687][14335:14335] CHIP:DIS: Responding with B859A17C7F0CAC6A-0000000000000001._matter._tcp.local + [1690281746.033689][14335:14335] CHIP:DIS: Responding with B859A17C7F0CAC6A-0000000000000001._matter._tcp.local + [1690281746.033692][14335:14335] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1a15: PAI Test Vector: Fallback VID and PID encoding example - from spec: invalid since substring following Mpid: is not exactly 4 - uppercase hexadecimal digits" + "Step 1a14: CD Test Vector: The authorized_paa_list contains ten PAAs + one of which is valid PAA authorized to sign the PAI." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_authorized_paa_list_count10_valid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + + [1690284741.166276][15669:15669] CHIP:EM: <<< [E:33408r S:14062 M:243658599 (Ack:15676972)] (S) Msg TX to 1:000000000001B669 [8D32] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690284741.166281][15669:15669] CHIP:IN: (S) Sending msg 243658599 on secure session with LSID: 14062 + [1690284741.166299][15669:15669] CHIP:DMG: Command handler moving to [CommandSen] + [1690284741.166301][15669:15669] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690284741.166306][15669:15669] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690284741.166308][15669:15669] CHIP:SVR: Commissioning completed successfully + [1690284741.166313][15669:15669] CHIP:DIS: Updating services using commissioning mode 0 + [1690284741.166452][15669:15669] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690284741.166760][15669:15669] CHIP:DL: Using wifi MAC for hostname + [1690284741.166765][15669:15669] CHIP:DIS: Advertise operational node E065C8CE19D78D32-0000000000000001 + [1690284741.166773][15669:15669] CHIP:DIS: Responding with _matter._tcp.local + [1690284741.166775][15669:15669] CHIP:DIS: Responding with E065C8CE19D78D32-0000000000000001._matter._tcp.local + [1690284741.166779][15669:15669] CHIP:DIS: Responding with E065C8CE19D78D32-0000000000000001._matter._tcp.local + [1690284741.166781][15669:15669] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284741.166783][15669:15669] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - - label: - "Step 1a16: CD Test Vector: Origin VID/PID different than VID/PID - (correct use of origin)" + - label: "Step 1a15: CD Test Vector: Valid CMS version set to v3." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_cms_v3/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + [1690282393.467881][14612:14612] CHIP:IN: (S) Sending msg 94459263 on secure session with LSID: 43887 + [1690282393.467938][14612:14612] CHIP:DMG: Command handler moving to [CommandSen] + [1690282393.467944][14612:14612] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690282393.467957][14612:14612] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690282393.467976][14612:14612] CHIP:SVR: Commissioning completed successfully + [1690282393.467981][14612:14612] CHIP:DIS: Updating services using commissioning mode 0 + [1690282393.468129][14612:14612] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690282393.468468][14612:14612] CHIP:DL: Using wifi MAC for hostname + [1690282393.468473][14612:14612] CHIP:DIS: Advertise operational node 49B289AA3BF98F84-0000000000000001 + [1690282393.468480][14612:14612] CHIP:DIS: Responding with _matter._tcp.local + [1690282393.468482][14612:14612] CHIP:DIS: Responding with 49B289AA3BF98F84-0000000000000001._matter._tcp.local + [1690282393.468485][14612:14612] CHIP:DIS: Responding with 49B289AA3BF98F84-0000000000000001._matter._tcp.local + [1690282393.468487][14612:14612] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690282393.468490][14612:14612] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690282393.468495][14612:14612] CHIP:DIS: Responding with _I49B289AA3BF98F84._sub._matter._tcp.local + [1690282393.468497][14612:14612] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 49B289AA3BF98F84-0000000000000001. + [1690282393.468648][14612:14612] CHIP:DIS: mDNS service published: _matter._tcp disabled: true - label: - "Step 1a17: DAC Test Vector: Valid certificate version field set to - v3(2)" + "Step 1a16: CD Test Vector: The version_number field matches the VID + and PID used in a DeviceSoftwareVersionModel entry in the DCL matching + the certification record associated with the product presenting this + CD." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_version_number_match/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690284319.839377][15436:15436] CHIP:DMG: Command handler moving to [CommandSen] + [1690284319.839380][15436:15436] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690284319.839386][15436:15436] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690284319.839390][15436:15436] CHIP:SVR: Commissioning completed successfully + [1690284319.839397][15436:15436] CHIP:DIS: Updating services using commissioning mode 0 + [1690284319.839563][15436:15436] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690284319.839898][15436:15436] CHIP:DL: Using wifi MAC for hostname + [1690284319.839904][15436:15436] CHIP:DIS: Advertise operational node 3C17C1D4CC8533E7-0000000000000001 + [1690284319.839913][15436:15436] CHIP:DIS: Responding with _matter._tcp.local + [1690284319.839916][15436:15436] CHIP:DIS: Responding with 3C17C1D4CC8533E7-0000000000000001._matter._tcp.local + [1690284319.839920][15436:15436] CHIP:DIS: Responding with 3C17C1D4CC8533E7-0000000000000001._matter._tcp.local + [1690284319.839923][15436:15436] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284319.839925][15436:15436] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1a18: DAC Test Vector: Fallback VID and PID encoding example - from spec: valid and recommended since easily human-readable" + "Step 1a17: CD Test Vector: The subjectKeyIdentifier contains SKID of + a well-known Zigbee Alliance certificate." verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_cd_signer_info_skid_valid/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690282693.478614][14715:14715] CHIP:EM: <<< [E:60094r S:39472 M:208019369 (Ack:213101818)] (S) Msg TX to 1:000000000001B669 [185C] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690282693.478621][14715:14715] CHIP:IN: (S) Sending msg 208019369 on secure session with LSID: 39472 + [1690282693.478644][14715:14715] CHIP:DMG: Command handler moving to [CommandSen] + [1690282693.478646][14715:14715] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690282693.478664][14715:14715] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690282693.478669][14715:14715] CHIP:SVR: Commissioning completed successfully + [1690282693.478675][14715:14715] CHIP:DIS: Updating services using commissioning mode 0 + [1690282693.478862][14715:14715] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690282693.479280][14715:14715] CHIP:DL: Using wifi MAC for hostname + [1690282693.479301][14715:14715] CHIP:DIS: Advertise operational node 7C5CE67CD6B2185C-0000000000000001 + [1690282693.479311][14715:14715] CHIP:DIS: Responding with _matter._tcp.local + [1690282693.479314][14715:14715] CHIP:DIS: Responding with 7C5CE67CD6B2185C-0000000000000001._matter._tcp.local + [1690282693.479318][14715:14715] CHIP:DIS: Responding with 7C5CE67CD6B2185C-0000000000000001._matter._tcp.local + [1690282693.479321][14715:14715] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690282693.479323][14715:14715] CHIP:DIS: Responding with 8C1D96786A130000.local disabled: true - label: - "Step 1a19: PAI Test Vector: Mix of Fallback and Matter OID encoding - for VID and PID: valid Matter OIDs are used and wrong values in the - common-name are ignored" + "Step 1a18: PAI Test Vector: Fallback VID and PID encoding example + from spec: valid example showing that order or separators are not + considered at all for the overall validity of the embedded fields" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_03/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691132563.220796][11028:11028] CHIP:EM: <<< [E:46477r S:48989 M:134841745 (Ack:88555256)] (S) Msg TX to 1:000000000001B669 [A81B] --- Type 0001:09 (IM:InvokeCommandResponse) + [1691132563.220859][11028:11028] CHIP:IN: (S) Sending msg 134841745 on secure session with LSID: 48989 + [1691132563.221085][11028:11028] CHIP:DMG: Command handler moving to [CommandSen] + [1691132563.221114][11028:11028] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691132563.221159][11028:11028] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691132563.221185][11028:11028] CHIP:SVR: Commissioning completed successfully + [1691132563.221227][11028:11028] CHIP:DIS: Updating services using commissioning mode 0 + [1691132563.230310][11028:11028] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691132563.259708][11028:11028] CHIP:DL: Using wifi MAC for hostname + [1691132563.259762][11028:11028] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691132563.259809][11028:11028] CHIP:DIS: Responding with _matter._tcp.local + [1691132563.259831][11028:11028] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691132563.259855][11028:11028] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691132563.259872][11028:11028] CHIP:DIS: Responding with E45F010F1A010000.local + [1691132563.259888][11028:11028] CHIP:DIS: Responding with E45F010F1A010000.local disabled: true - label: - "Step 1a20: DAC Test Vector: Fallback VID and PID encoding example - from spec: valid but highly discouraged since embedding of substrings - within other substrings may be confusing to human readers" + "Step 1a19: DAC Test Vector: Certificate includes optional Subject + Alternative Name extension" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_ext_subject_alt_name_present/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690284666.597714][15618:15618] CHIP:IN: (S) Sending msg 208022493 on secure session with LSID: 54251 + [1690284666.597737][15618:15618] CHIP:DMG: Command handler moving to [CommandSen] + [1690284666.597739][15618:15618] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690284666.597761][15618:15618] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690284666.597764][15618:15618] CHIP:SVR: Commissioning completed successfully + [1690284666.597769][15618:15618] CHIP:DIS: Updating services using commissioning mode 0 + [1690284666.597908][15618:15618] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690284666.598238][15618:15618] CHIP:DL: Using wifi MAC for hostname + [1690284666.598243][15618:15618] CHIP:DIS: Advertise operational node C9AE838209F8DA83-0000000000000001 + [1690284666.598249][15618:15618] CHIP:DIS: Responding with _matter._tcp.local + [1690284666.598251][15618:15618] CHIP:DIS: Responding with C9AE838209F8DA83-0000000000000001._matter._tcp.local + [1690284666.598255][15618:15618] CHIP:DIS: Responding with C9AE838209F8DA83-0000000000000001._matter._tcp.local + [1690284666.598256][15618:15618] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284666.598258][15618:15618] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690284666.598261][15618:15618] CHIP:DIS: Responding with _IC9AE838209F8DA83._sub._matter._tcp.local disabled: true - label: - "Step 1a21: CD Test Vector: Valid CMS signature algorithm - ECDSA_WITH_SHA256." + "Step 1a20: DAC Test Vector: Valid certificate version field set to + v3(2)" verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_dac_cert_version_v3/test_case_vector.json --product-id 32768 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1690285010.058545][15920:15920] CHIP:EM: <<< [E:56176r S:34847 M:35213965 (Ack:162929554)] (S) Msg TX to 1:000000000001B669 [D8B9] --- Type 0001:09 (IM:InvokeCommandResponse) + [1690285010.058550][15920:15920] CHIP:IN: (S) Sending msg 35213965 on secure session with LSID: 34847 + [1690285010.058568][15920:15920] CHIP:DMG: Command handler moving to [CommandSen] + [1690285010.058571][15920:15920] CHIP:DMG: Command handler moving to [AwaitingDe] + [1690285010.058577][15920:15920] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1690285010.058581][15920:15920] CHIP:SVR: Commissioning completed successfully + [1690285010.058588][15920:15920] CHIP:DIS: Updating services using commissioning mode 0 + [1690285010.058786][15920:15920] CHIP:DIS: CHIP minimal mDNS started advertising. + [1690285010.059205][15920:15920] CHIP:DL: Using wifi MAC for hostname + [1690285010.059210][15920:15920] CHIP:DIS: Advertise operational node 50778ED0BE0AD8B9-0000000000000001 + [1690285010.059216][15920:15920] CHIP:DIS: Responding with _matter._tcp.local + [1690285010.059219][15920:15920] CHIP:DIS: Responding with 50778ED0BE0AD8B9-0000000000000001._matter._tcp.local + [1690285010.059222][15920:15920] CHIP:DIS: Responding with 50778ED0BE0AD8B9-0000000000000001._matter._tcp.local + [1690285010.059224][15920:15920] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690285010.059226][15920:15920] CHIP:DIS: Responding with 8C1D96786A130000.local + [1690285010.059229][15920:15920] CHIP:DIS: Responding with _I50778ED0BE0AD8B9._sub._matter._tcp.local + [1690285010.059231][15920:15920] CHIP:DIS: CHIP minimal mDNS configured as 'Operational device'; instance name: 50778ED0BE0AD8B9-0000000000000001. + [1690285010.059353][15920:15920] CHIP:DIS: mDNS service published: _matter._tcp + [1690285010.059362][15920:15920] CHIP:IN: Expiring all PASE sessions + [1690285010.059364][15920:15920] CHIP:IN: SecureSession[0x560f3fe66900]: MarkForEviction Type:1 LSID:34846 + [1690285010.059367][15920:15920] CHIP:SC: SecureSession[0x560f3fe66900, LSID:34846]: State change 'kActive' --> 'kPendingEviction' + [1690285010.059371][15920:15920] CHIP:IN: SecureSession[0x560f3fe66900]: Released - Type:1 LSID:34846 disabled: true - label: - "Step 1a22: DAC Test Vector: Fallback VID and PID encoding example - from spec: valid and recommended since easily human-readable" + "Step 1a21: PAI Test Vector: Fallback VID and PID encoding example + from spec: valid and recommended since easily human-readable " verification: | - Verify that the TH is successfully commissioned for each test case + Execute the below mentioned command to put TH(all-cluster-app) into a commissionable state, Pls use equivalent command on the respective Platform + ./chip-all-clusters-app --trace_decode 1 --dac_provider $CHIP_ROOT/credentials/development/commissioner_dut/struct_pai_vidpid_fallback_encoding_02/test_case_vector.json --product-id 177 + + Once TH(all-clusters-app) reach the commissionable state pls send below mentioned command on DUT(chip-tool). Pls use equivalent command on the respective platform + ./chip-tool pairing onnetwork 1 20202021 --trace_decode 1 + + On TH(all-clusters-app), Verify that the DUT(chip-tool) and TH(all-clusters-app) is successfully commissioned + + [1691133976.341499][11204:11204] CHIP:DMG: Command handler moving to [CommandSen] + [1691133976.341528][11204:11204] CHIP:DMG: Command handler moving to [AwaitingDe] + [1691133976.341572][11204:11204] CHIP:DL: HandlePlatformSpecificBLEEvent 32782 + [1691133976.341598][11204:11204] CHIP:SVR: Commissioning completed successfully + [1691133976.341644][11204:11204] CHIP:DIS: Updating services using commissioning mode 0 + [1691133976.352197][11204:11204] CHIP:DIS: CHIP minimal mDNS started advertising. + [1691133976.381983][11204:11204] CHIP:DL: Using wifi MAC for hostname + [1691133976.382037][11204:11204] CHIP:DIS: Advertise operational node 3CBA812920C1A81B-0000000000000001 + [1691133976.382084][11204:11204] CHIP:DIS: Responding with _matter._tcp.local + [1691133976.382105][11204:11204] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133976.382128][11204:11204] CHIP:DIS: Responding with 3CBA812920C1A81B-0000000000000001._matter._tcp.local + [1691133976.382146][11204:11204] CHIP:DIS: Responding with E45F010F1A010000.local + [1691133976.382162][11204:11204] CHIP:DIS: Responding with E45F010F1A010000.local disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_DGETH_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DGETH_2_1.yaml index 93078217b6cac4..071b07473ddbd0 100644 --- a/src/app/tests/suites/certification/Test_TC_DGETH_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGETH_2_1.yaml @@ -38,8 +38,7 @@ tests: response: constraints: type: enum8 - minValue: 0 - maxValue: 9 + anyOf: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, null] - label: "Step 3: Read FullDuplex attribute constraints" PICS: DGETH.S.A0001 @@ -48,8 +47,8 @@ tests: response: constraints: type: boolean + anyOf: [0, 1, null] - #issue #13648 - label: "Step 4a: Read PacketRxCount attribute constraints" PICS: DGETH.S.A0002 command: "readAttribute" @@ -57,20 +56,41 @@ tests: response: constraints: type: int64u + minValue: 0 + maxValue: "18446744073709551615" - - label: - "Step 4b: Read PacketRxCount value from DUT and verify the number of - packets received on ethernet network interface" + - label: "Step 4b: Reboot target device" + PICS: PICS_SDK_CI_ONLY + cluster: "SystemCommands" + command: "Reboot" + + - label: "Step 4c: Reboot target device(DUT)" verification: | - ./chip-tool ethernetnetworkdiagnostics read packet-rx-count 1 0 + Did the DUT successfully reboot? + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP + arguments: + values: + - name: "message" + value: "Please reboot the DUT and enter 'y' after DUT starts" + - name: "expectedValue" + value: "y" - Verify the value of PacketRxCount is in range uint64 on TH(chip-tool) log + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - [1687347048.760521][160021:160023] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_0002 DataVersion: 2942806365 - [1687347048.760567][160021:160023] CHIP:TOO: PacketRxCount: 286 - [1687347048.760621][160021:160023] CHIP:EM: <<< [E:20760i S:62442 M:2940871 (Ack:194995517)] (S) Msg TX to 1:0000000000000001 [096C] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1687347048.760632][160021:160023] CHIP:IN: (S) Sending msg 2940871 on secure session with LSID: 62442 - [1687347048.760681][160021:160023] CHIP:EM: Flushed pending ack for MessageCounter:194995517 on exchange 20760i + #Test-plan issue: https://github.com/CHIP-Specifications/chip-test-plans/issues/3413 + - label: + "Step 4d: Upon a node reboot, PacketRxCount attribute value will be + reset to 0" + verification: | + Upon a node reboot, the value will be reset to 0. cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT && DGETH.S.A0002 @@ -88,21 +108,15 @@ tests: response: constraints: type: int64u + minValue: 0 + maxValue: "18446744073709551615" + #Test-plan issue: https://github.com/CHIP-Specifications/chip-test-plans/issues/3413 - label: - "Step 5b: Read PacketTxCount value from DUT and verify the number of - packets received on ethernet network interface" + "Step 5b: Read PacketTxCount attribute constraints, Upon a node + reboot, the value will be reset to 0" verification: | - ./chip-tool ethernetnetworkdiagnostics read packet-tx-count 1 0 - - Verify the value of PacketTxCount is in range uint64 on TH(chip-tool) Log - - [1687347066.917105][160026:160028] CHIP:DMG: } - [1687347066.917138][160026:160028] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_0003 DataVersion: 2942806365 - [1687347066.917163][160026:160028] CHIP:TOO: PacketTxCount: 610 - [1687347066.917187][160026:160028] CHIP:EM: <<< [E:25784i S:60435 M:6319619 (Ack:183312357)] (S) Msg TX to 1:0000000000000001 [096C] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1687347066.917192][160026:160028] CHIP:IN: (S) Sending msg 6319619 on secure session with LSID: 60435 - [1687347066.917217][160026:160028] CHIP:EM: Flushed pending ack for MessageCounter:183312357 on exchange 25784i + Upon a node reboot, the value will be reset to 0. cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT && DGETH.S.A0003 @@ -113,159 +127,52 @@ tests: - name: "expectedValue" value: "y" - - label: "Step 6a: Read TxErrCount attribute constraints" + - label: + "Step 6: Read TxErrCount attribute constraints, Upon a node reboot, + the value will be reset to 0" PICS: DGETH.S.A0004 command: "readAttribute" attribute: "TxErrCount" response: + value: 0 constraints: type: int64u - label: - "Step 6b: Read TxErrCount value from DUT and verify value indicates - the number of failed packet transmission on ethernet network interface" - verification: | - ./chip-tool ethernetnetworkdiagnostics read tx-err-count 1 0 - - Verify the value of TxErrCount is in range uint64 on TH(chip-tool) Log - - CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_0004 DataVersion: 3872576452 - [1649663843.295395][8123:8128] CHIP:TOO: TxErrCount: 0 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGETH.S.A0004 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Step 7a: Read CollisionCount attribute constraints" + "Step 7: Read CollisionCount attribute , Upon a node reboot, the value + will be reset to 0" PICS: DGETH.S.A0005 command: "readAttribute" attribute: "CollisionCount" response: + value: 0 constraints: type: int64u - - label: - "Step 7b: Read CollisionCount value from DUT and verify value - indicates the number of collision occurred while transmitting packets - on ethernet network interface" - verification: | - ./chip-tool ethernetnetworkdiagnostics read tx-err-count 1 0 - - Verify the value of TxErrCount is in range uint64 on TH(chip-tool) Log - [1687347083.503598][160029:160031] CHIP:DMG: } - [1687347083.503668][160029:160031] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_0004 DataVersion: 2942806365 - [1687347083.503714][160029:160031] CHIP:TOO: TxErrCount: 0 - [1687347083.503797][160029:160031] CHIP:EM: <<< [E:52218i S:59742 M:235974545 (Ack:86510465)] (S) Msg TX to 1:0000000000000001 [096C] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1687347083.503811][160029:160031] CHIP:IN: (S) Sending msg 235974545 on secure session with LSID: 59742 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGETH.S.A0005 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Step 8a: Read OverrunCount attribute constraints" + - label: "Step 8: Read OverrunCount attribute constraints" PICS: DGETH.S.A0006 command: "readAttribute" attribute: "OverrunCount" response: + value: 0 constraints: type: int64u - - label: - "Step 8b: Read OverrunCount value from DUT and verify value indicates - the number of packets dropped due to lack of buffer memory on ethernet - network interface" - verification: | - ./chip-tool ethernetnetworkdiagnostics read overrun-count 1 0 - - Verify the value of OverrunCount is in range uint64 on TH(chip-tool) Log - - [1687347120.446609][160039:160041] CHIP:DMG: } - [1687347120.446640][160039:160041] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_0006 DataVersion: 2942806365 - [1687347120.446659][160039:160041] CHIP:TOO: OverrunCount: 0 - [1687347120.446682][160039:160041] CHIP:EM: <<< [E:16803i S:59128 M:141104124 (Ack:148139165)] (S) Msg TX to 1:0000000000000001 [096C] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1687347120.446686][160039:160041] CHIP:IN: (S) Sending msg 141104124 on secure session with LSID: 59128 - [1687347120.446707][160039:160041] CHIP:EM: Flushed pending ack for MessageCounter:148139165 on exchange 16803i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGETH.S.A0006 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Step 9a: Read CarrierDetect attribute constraints" + - label: "Step 9: Read CarrierDetect attribute constraints" PICS: DGETH.S.A0007 command: "readAttribute" attribute: "CarrierDetect" response: constraints: type: boolean + anyOf: [0, 1, null] - - label: - "Step 9b: Read CarrierDetect value from DUT and verify value indicates - the presence of carrier detect control signal on ethernet network - interface" - verification: | - ./chip-tool ethernetnetworkdiagnostics read carrier-detect 1 0 - - Verify the value of CarrierDetect is either bool or if the interface is not configured or operational, NULL should be read, this is optional attribute implemented in RPI, may vary based on DUT implementation on TH(chip-tool) Log: - - [1687347138.406057][160043:160045] CHIP:DMG: } - [1687347138.406124][160043:160045] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_0007 DataVersion: 2942806365 - [1687347138.406151][160043:160045] CHIP:TOO: CarrierDetect: null - [1687347138.406212][160043:160045] CHIP:EM: <<< [E:63037i S:51494 M:51175683 (Ack:138099847)] (S) Msg TX to 1:0000000000000001 [096C] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1687347138.406225][160043:160045] CHIP:IN: (S) Sending msg 51175683 on secure session with LSID: 51494 - [1687347138.406267][160043:160045] CHIP:EM: Flushed pending ack for MessageCounter:138099847 on exchange 63037i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGETH.S.A0007 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" - - - label: "Step 10a: Read TimeSinceReset attribute constraints" + - label: "Step 10: Read TimeSinceReset attribute constraints" PICS: DGETH.S.A0008 command: "readAttribute" attribute: "TimeSinceReset" response: constraints: type: int64u - - - label: - "Step 10b: Read TimeSinceReset value from DUT and verify the value - indicates the duration of time, in minutes" - verification: | - ./chip-tool ethernetnetworkdiagnostics read time-since-reset 1 0 - - Verify the value of TimeSinceReset is in range uint64, If the interface is not configured or operational, NULL should be read, this is optional attribute implemented in RPI, may vary based on DUT implementation on TH(chip-tool) Log: - - [1687347156.459485][160053:160055] CHIP:DMG: } - [1687347156.459542][160053:160055] CHIP:TOO: Endpoint: 0 Cluster: 0x0000_0037 Attribute 0x0000_0008 DataVersion: 2942806365 - [1687347156.459573][160053:160055] CHIP:TOO: TimeSinceReset: 228 - [1687347156.459644][160053:160055] CHIP:EM: <<< [E:9032i S:5312 M:202808493 (Ack:150717838)] (S) Msg TX to 1:0000000000000001 [096C] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1687347156.459656][160053:160055] CHIP:IN: (S) Sending msg 202808493 on secure session with LSID: 5312 - [1687347156.459701][160053:160055] CHIP:EM: Flushed pending ack for MessageCounter:150717838 on exchange 9032i - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && DGETH.S.A0008 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + minValue: 0 + maxValue: "18446744073709551615" diff --git a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml index 4e0904126d1187..22a222055e689f 100644 --- a/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGGEN_2_1.yaml @@ -31,7 +31,70 @@ config: defaultValue: "0x0000000000000003" tests: - - label: "Step 1: Wait for the commissioned device to be retrieved" + - label: "Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 1a: Reset Devices to factory defaults" + PICS: PICS_SDK_CI_ONLY + cluster: "SystemCommands" + command: "FactoryReset" + + - label: "Step 1a: Reset Devices to factory defaults" + PICS: PICS_USER_PROMPT + verification: | + Reset Devices to factory defaults + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Factory Reset the DUT and enter 'y' after success" + - name: "expectedValue" + value: "y" + + - label: "Step 1b: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId + + - label: "Step 2a: TH reads a RebootCount attribute value from DUT." + PICS: DGGEN.S.A0001 + command: "readAttribute" + attribute: "RebootCount" + response: + saveAs: boot_count1 + constraints: + type: int16u + minValue: 0 + maxValue: 1 + + - label: "Step 2b: Reboot target device" + PICS: PICS_SDK_CI_ONLY + cluster: "SystemCommands" + command: "Reboot" + + - label: "Step 2b: Reboot target device(DUT)" + PICS: PICS_USER_PROMPT + verification: | + Did the DUT successfully reboot? + cluster: "LogCommands" + command: "UserPrompt" + arguments: + values: + - name: "message" + value: "Please reboot the DUT and enter 'y' after DUT starts" + - name: "expectedValue" + value: "y" + + - label: "Wait for the commissioned device to be retrieved" cluster: "DelayCommands" command: "WaitForCommissionee" arguments: @@ -39,8 +102,20 @@ tests: - name: "nodeId" value: nodeId + - label: + "Step 2b: TH reads a RebootCount attribute value from DUT. Verify that + boot_count2 is greater than boot_count1." + PICS: DGGEN.S.A0001 + command: "readAttribute" + attribute: "RebootCount" + response: + constraints: + type: int16u + minValue: boot_count1 + 1 + maxValue: 65535 + #Not possible in YAML. what extact values to be checked - - label: "Step 2: TH reads NetworkInterfaces structure attribute from DUT." + - label: "Step 3: TH reads NetworkInterfaces structure attribute from DUT." verification: | ./chip-tool generaldiagnostics read network-interfaces 1 0 On TH(chip-tool), Verify that The NetworkInterfaces attribute SHALL be a list of NetworkInterface structs, i.e The read data type( NetworkInterface struct) must match the value listed below @@ -105,55 +180,6 @@ tests: - name: "expectedValue" value: "y" - - label: "Step 3a: TH reads a RebootCount attribute value from DUT." - PICS: DGGEN.S.A0001 - command: "readAttribute" - attribute: "RebootCount" - response: - saveAs: boot_count1 - constraints: - type: int16u - minValue: 1 - maxValue: 65535 - - - label: "Step 3b: Reboot target device" - PICS: PICS_SDK_CI_ONLY - cluster: "SystemCommands" - command: "Reboot" - - - label: "Step 3b: Reboot target device(DUT)" - PICS: PICS_USER_PROMPT - verification: | - Did the DUT successfully reboot? - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please reboot the DUT and enter 'y' after DUT starts" - - name: "expectedValue" - value: "y" - - - label: "Wait for the commissioned device to be retrieved" - cluster: "DelayCommands" - command: "WaitForCommissionee" - arguments: - values: - - name: "nodeId" - value: nodeId - - - label: - "Step 3b: TH reads a RebootCount attribute value from DUT. Store the - value in boot_count2." - PICS: DGGEN.S.A0001 - command: "readAttribute" - attribute: "RebootCount" - response: - constraints: - type: int16u - minValue: boot_count1 + 1 - maxValue: 65535 - - label: "Step 4a: TH reads the Uptime attribute value of DUT. Store the value in uptime1" @@ -328,11 +354,11 @@ tests: saveAs: TestEventTriggersEnabledValue - label: - "Step 9b: Verify ff this TestEventTriggersEnabled attribute value is - set to True" + "Step 9b: Verify TestEventTriggersEnabled attribute value is set to + True" PICS: DGGEN.S.A0008 cluster: "EqualityCommands" - command: "UnsignedNumberEquals" + command: "BooleanEquals" arguments: values: - name: "Value1" diff --git a/src/app/tests/suites/certification/Test_TC_DGWIFI_3_2_Simulated.yaml b/src/app/tests/suites/certification/Test_TC_DGWIFI_3_2_Simulated.yaml index ddd2e798443a26..bc14534503a9c1 100644 --- a/src/app/tests/suites/certification/Test_TC_DGWIFI_3_2_Simulated.yaml +++ b/src/app/tests/suites/certification/Test_TC_DGWIFI_3_2_Simulated.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: 52.3.1. [TC-DGWIFI-3.1] Attributes observed with client as DUT +name: 52.3.1. [TC-DGWIFI-3.2] Command Generated [DUT as Client] PICS: - DGWIFI.C diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml index a991414d1e77e2..7e27605410e1cb 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_1.yaml @@ -57,6 +57,12 @@ tests: [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true + - label: "Step 1d: Set the value of LatchResponse to 0." + PICS: " !DISHALM.S.A0001 " + verification: | + When the DISHALM.S.A0001(Latch) feature is not supported or enabled, Set the value of LatchResponse to 0. + disabled: true + - label: "Step 2a: Operate device to set the condition to raise the Inflow alarm" diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml index 89e64432a55b1c..98ef5006cacf94 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_2.yaml @@ -57,6 +57,12 @@ tests: [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true + - label: "Step 1d: Set the value of LatchResponse to 0." + PICS: " !DISHALM.S.A0001 " + verification: | + When the DISHALM.S.A0001(Latch) feature is not supported or enabled, Set the value of LatchResponse to 0. + disabled: true + - label: "Step 2a: Operate device to set the condition to raise the Drain alarm" PICS: DISHALM.S.M.ManuallyControlled diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml index 9954513fad13a9..dd1c8e75789e5e 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_3.yaml @@ -57,6 +57,12 @@ tests: [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true + - label: "Step 1d: Set the value of LatchResponse to 0." + PICS: " !DISHALM.S.A0001 " + verification: | + When the DISHALM.S.A0001(Latch) feature is not supported or enabled, Set the value of LatchResponse to 0. + disabled: true + - label: "Step 2a: Operate device to set the condition to raise the Door alarm" PICS: DISHALM.S.M.ManuallyControlled diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml index 6718ca38042624..2b1c94bd58f59b 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_4.yaml @@ -59,6 +59,12 @@ tests: [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true + - label: "Step 1d: Set the value of LatchResponse to 0." + PICS: " !DISHALM.S.A0001 " + verification: | + When the DISHALM.S.A0001(Latch) feature is not supported or enabled, Set the value of LatchResponse to 0. + disabled: true + - label: "Step 2a: Operate device to set the condition to raise the TempLow alarm" diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml index 87cfb045d00b73..a2b66804fc367f 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_5.yaml @@ -59,6 +59,12 @@ tests: [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true + - label: "Step 1d: Set the value of LatchResponse to 0." + PICS: " !DISHALM.S.A0001 " + verification: | + When the DISHALM.S.A0001(Latch) feature is not supported or enabled, Set the value of LatchResponse to 0. + disabled: true + - label: "Step 2a: Operate device to set the condition to raise the TempHigh alarm" diff --git a/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml b/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml index e5f340c43fabae..e6c8cd85c8179d 100644 --- a/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_DISHALM_3_6.yaml @@ -58,6 +58,12 @@ tests: [1689842371.478410][2614:2616] CHIP:EM: <<< [E:35394i S:46214 M:140335917 (Ack:184279491)] (S) Msg TX to 1:0000000000000001 [C4B0] --- Type 0000:10 (SecureChannel:StandaloneAck) disabled: true + - label: "Step 1d: Set the value of LatchResponse to 0." + PICS: " !DISHALM.S.A0001 " + verification: | + When the DISHALM.S.A0001(Latch) feature is not supported or enabled, Set the value of LatchResponse to 0. + disabled: true + - label: "Step 2a: Operate device to set the condition to raise the WaterLevel alarm" diff --git a/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml index ed34bd274d83d6..3cef4c28dd6e4b 100644 --- a/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_1.yaml @@ -85,25 +85,7 @@ tests: EpochStartTime2: "18446744073709551614", } - - label: - "Step 5: TH sends AddGroup Command to DUT on PIXIT.G.ENDPOINT with the - the following settings GroupID: 0x0103 GroupName: 'Test Group'" - PICS: G.S.C00.Rsp - endpoint: Groups.Endpoint - cluster: "Groups" - command: "AddGroup" - arguments: - values: - - name: GroupID - value: 0x0103 - - name: GroupName - value: "Test Group" - response: - values: - - name: "Status" - value: 0 - - name: "GroupID" - value: 0x0103 + # Step 5 does not exist in the test plan. - label: "Step 6: TH reads GroupTable attribute from GroupKeyManagement cluster @@ -112,15 +94,7 @@ tests: command: "readAttribute" attribute: "GroupTable" response: - value: - [ - { - FabricIndex: 1, - GroupId: 0x0103, - Endpoints: [Groups.Endpoint], - GroupName: "Test Group", - }, - ] + value: [] - label: "Step 7a: TH attempts to write to the GroupTable attribute from @@ -210,19 +184,3 @@ tests: value: MaxGroupKeysPerFabricValue response: error: UNSUPPORTED_WRITE - - - label: - "Step 12: TH cleans up the groups by sending the RemoveAllGroups - command to the DUT on PIXIT.G.ENDPOINT" - PICS: GRPKEY.S.C04.Rsp - cluster: "Groups" - endpoint: Groups.Endpoint - command: "RemoveAllGroups" - - - label: "TH verifies the group has been removed in the GroupTable" - PICS: GRPKEY.S.A0001 - cluster: "Group Key Management" - command: "readAttribute" - attribute: "GroupTable" - response: - value: [] diff --git a/src/app/tests/suites/certification/Test_TC_GRPKEY_2_2.yaml b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_2.yaml index d601de9a55f522..245da43f236450 100644 --- a/src/app/tests/suites/certification/Test_TC_GRPKEY_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_GRPKEY_2_2.yaml @@ -65,7 +65,7 @@ tests: - label: "Step 3: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as 0x01a" - PICS: GRPKEY.S.C01.Rsp + PICS: GRPKEY.S.C01.Rsp && GRPKEY.S.C02.Tx command: "KeySetRead" arguments: values: @@ -575,7 +575,7 @@ tests: - label: "Step 18: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as 0x01a" - PICS: GRPKEY.S.C01.Rsp + PICS: GRPKEY.S.C01.Rsp && GRPKEY.S.C02.Tx command: "KeySetRead" arguments: values: @@ -703,7 +703,7 @@ tests: value: "y" - label: - "Step 23: TH again sends KeySetWrite command to DUT with any other + "Step 22: TH again sends KeySetWrite command to DUT with any other GroupKeySetID not used yet." PICS: GRPKEY.S.C00.Rsp && PICS_SKIP_SAMPLE_APP command: "KeySetWrite" @@ -724,7 +724,7 @@ tests: response: error: RESOURCE_EXHAUSTED - - label: "Step 24: TH sends KeySetReadAllIndices command to DUT." + - label: "Step 23: TH sends KeySetReadAllIndices command to DUT." verification: | ./chip-tool groupkeymanagement key-set-read-all-indices 1 0 @@ -736,7 +736,7 @@ tests: [1692342735.277550][8297:8300] CHIP:TOO: [2]: 1 [1692342735.277554][8297:8300] CHIP:TOO: [3]: 0 [1692342735.277557][8297:8300] CHIP:TOO: } - PICS: GRPKEY.S.C05.Rsp && PICS_SKIP_SAMPLE_APP + PICS: GRPKEY.S.C04.Rsp && GRPKEY.S.C05.Tx && PICS_SKIP_SAMPLE_APP cluster: "LogCommands" command: "UserPrompt" arguments: @@ -747,7 +747,7 @@ tests: value: "y" - label: - "Step 22: TH removes the Group key set that was added by sending a + "Step 24: TH removes the Group key set that was added by sending a KeySetRemove command to the GroupKeyManagement cluster with the GroupKeySetID field set to 0x0" PICS: GRPKEY.S.C03.Rsp @@ -760,7 +760,7 @@ tests: error: INVALID_COMMAND - label: - "Step 23: TH removes the Group key set that was added by sending a + "Step 25: TH removes the Group key set that was added by sending a KeySetRemove command to the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01b that does not exist in the GroupKeyMap attribute list." diff --git a/src/app/tests/suites/certification/Test_TC_LTIME_3_1.yaml b/src/app/tests/suites/certification/Test_TC_LTIME_3_1.yaml index 0af218e0a83173..65e9e1a3d73365 100644 --- a/src/app/tests/suites/certification/Test_TC_LTIME_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_LTIME_3_1.yaml @@ -43,7 +43,7 @@ tests: - label: "Step 2: If (LTIME.S.A0000.12HR) TH writes 0 to HourFormat attribute" - PICS: LTIME.S.A0000.12HR + PICS: LTIME.S.M.12HR command: "writeAttribute" attribute: "HourFormat" arguments: @@ -58,7 +58,7 @@ tests: - label: "Step 4: If (LTIME.S.A0000.24HR) TH writes 1 to HourFormat attribute" - PICS: LTIME.S.A0000.24HR + PICS: LTIME.S.M.24HR command: "writeAttribute" attribute: "HourFormat" arguments: diff --git a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_3.yaml b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_3.yaml index 0853e1e0625fdf..261a0ed8eb27f0 100644 --- a/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_MEDIAPLAYBACK_6_3.yaml @@ -79,90 +79,44 @@ tests: response: value: { "Position": 10000 } - #Issue 10988 - label: "Step 3: TH reads the StartTime attribute from the DUT" - PICS: MEDIAPLAYBACK.S.A0001 && PICS_USER_PROMPT - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool mediaplayback read start-time 1 3 - ./chip-tv-casting-app mediaplayback read start-time 1 3 - - On TH(chip-tool), Verify that the response is a valid start time or null. - [1654001778189] [97015:7707437] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_0506 Attribute 0x0000_0001 DataVersion: 775839144 - [1654001778190] [97015:7707437] CHIP: [TOO] StartTime: 0 - cluster: "LogCommands" - command: "UserPrompt" - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + PICS: MEDIAPLAYBACK.S.A0001 + command: "readAttribute" + attribute: "StartTime" + response: + constraints: + type: epoch_us - #Issue 10988 - label: "Step 4: TH reads the SeekRangeEnd attribute from the DUT" - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool mediaplayback read seek-range-end 1 3 - ./chip-tv-casting-app mediaplayback read seek-range-end 1 3 - - On TH(chip-tool), Verify that the response is a valid position or Nas. - [1654002119527] [97409:7712444] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_0506 Attribute 0x0000_0005 DataVersion: 775839144 - [1654002119527] [97409:7712444] CHIP: [TOO] SeekRangeEnd: 80000 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0005 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + PICS: MEDIAPLAYBACK.S.A0005 + command: "readAttribute" + attribute: "SeekRangeEnd" + response: + constraints: + type: int64u + minValue: 0 + maxValue: "18446744073709551615" - #Issue 10988 - label: "Step 5: TH reads the SeekRangeStart attribute from the DUT" - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool mediaplayback read seek-range-start 1 3 - ./chip-tv-casting-app mediaplayback read seek-range-start 1 3 - - On TH(chip-tool), Verify that the response is a valid position or Nas. - [1661240180.806771][2930:2935] CHIP:DMG: SuppressResponse = true, - [1661240180.806809][2930:2935] CHIP:DMG: InteractionModelRevision = 1 - [1661240180.806844][2930:2935] CHIP:DMG: } - [1661240180.807024][2930:2935] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0506 Attribute 0x0000_0006 DataVersion: 1520269522 - [1661240180.807103][2930:2935] CHIP:TOO: SeekRangeStart: 0 - [1661240180.807211][2930:2935] CHIP:EM: Sending Standalone Ack for MessageCounter:164562596 on exchange 31684i - [1661240180.807299][2930:2935] CHIP:IN: Prepared secure message 0xffff95f5d978 to 0x0000000000000001 (1) of type 0x10 and protocolId (0, 0) on exchange 31684i with MessageCounter:104721987 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0006 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + PICS: MEDIAPLAYBACK.S.A0006 + command: "readAttribute" + attribute: "SeekRangeStart" + response: + constraints: + type: int64u + minValue: 0 + maxValue: "18446744073709551615" - #Issue 10988 - label: "Step 6: TH reads the Duration attribute from the DUT" - verification: | - The TH commands for this test step can be invoked using chip-tool (when DUT is a commissionee) or tv-casting-app (when DUT is a commissioner): - ./chip-tool mediaplayback read duration 1 3 - ./chip-tv-casting-app mediaplayback read duration 1 3 - - On TH(chip-tool), Verify that the response is null or not 0. - [1654001869267] [97168:7708957] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_0506 Attribute 0x0000_0002 DataVersion: 775839144 - [1654001869267] [97168:7708957] CHIP: [TOO] Duration: 80000 - cluster: "LogCommands" - command: "UserPrompt" - PICS: PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0002 - arguments: - values: - - name: "message" - value: "Please enter 'y' for success" - - name: "expectedValue" - value: "y" + PICS: MEDIAPLAYBACK.S.A0002 + command: "readAttribute" + attribute: "Duration" + response: + constraints: + type: int64u + notValue: 0 + minValue: 0 + maxValue: "18446744073709551615" - label: "Step 7: TH sends a Seek command to the DUT with a Position value diff --git a/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml b/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml index c446b4dcea2801..b2c5355ece71eb 100644 --- a/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_1_3.yaml @@ -35,122 +35,215 @@ tests: verification: | ./chip-tool modeselect read supported-modes 1 1 - Verify the "SupportedModes response" on the TH (all-cluster-app) log: - - [1666940683.282921][9718:9718] CHIP:DMG: ReportDataMessage = - [1666940683.282923][9718:9718] CHIP:DMG: { - [1666940683.282925][9718:9718] CHIP:DMG: AttributeReportIBs = - [1666940683.282928][9718:9718] CHIP:DMG: [ - [1666940683.282929][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940683.282933][9718:9718] CHIP:DMG: { - [1666940683.282935][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940683.282937][9718:9718] CHIP:DMG: { - [1666940683.282939][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940683.282941][9718:9718] CHIP:DMG: AttributePathIB = - [1666940683.282944][9718:9718] CHIP:DMG: { - [1666940683.282946][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940683.282948][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940683.282950][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, - [1666940683.282952][9718:9718] CHIP:DMG: } - [1666940683.282955][9718:9718] CHIP:DMG: - [1666940683.282957][9718:9718] CHIP:DMG: Data = [ - [1666940683.282959][9718:9718] CHIP:DMG: - [1666940683.282962][9718:9718] CHIP:DMG: ], - [1666940683.282964][9718:9718] CHIP:DMG: }, - [1666940683.282966][9718:9718] CHIP:DMG: - [1666940683.282968][9718:9718] CHIP:DMG: }, - [1666940683.282972][9718:9718] CHIP:DMG: - [1666940683.282974][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940683.282978][9718:9718] CHIP:DMG: { - [1666940683.282980][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940683.282982][9718:9718] CHIP:DMG: { - [1666940683.282984][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940683.282986][9718:9718] CHIP:DMG: AttributePathIB = - [1666940683.282988][9718:9718] CHIP:DMG: { - [1666940683.282990][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940683.282992][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940683.282995][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, - [1666940683.282997][9718:9718] CHIP:DMG: ListIndex = Null, - [1666940683.282999][9718:9718] CHIP:DMG: } - [1666940683.283001][9718:9718] CHIP:DMG: - [1666940683.283003][9718:9718] CHIP:DMG: Data = - [1666940683.283005][9718:9718] CHIP:DMG: { - [1666940683.283008][9718:9718] CHIP:DMG: 0x0 = "Black" (5 chars), - [1666940683.283011][9718:9718] CHIP:DMG: 0x1 = 0, - [1666940683.283013][9718:9718] CHIP:DMG: 0x2 = [ - [1666940683.283015][9718:9718] CHIP:DMG: - [1666940683.283020][9718:9718] CHIP:DMG: { - [1666940683.283022][9718:9718] CHIP:DMG: 0x0 = 0, - [1666940683.283025][9718:9718] CHIP:DMG: 0x1 = 0, - [1666940683.283027][9718:9718] CHIP:DMG: }, - [1666940683.283030][9718:9718] CHIP:DMG: ], - [1666940683.283032][9718:9718] CHIP:DMG: }, - [1666940683.283034][9718:9718] CHIP:DMG: }, - [1666940683.283037][9718:9718] CHIP:DMG: - [1666940683.283039][9718:9718] CHIP:DMG: }, - [1666940683.283044][9718:9718] CHIP:DMG: - [1666940683.283046][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940683.283049][9718:9718] CHIP:DMG: { - [1666940683.283051][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940683.283053][9718:9718] CHIP:DMG: { - [1666940683.283055][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940683.283057][9718:9718] CHIP:DMG: AttributePathIB = - [1666940683.283059][9718:9718] CHIP:DMG: { - [1666940683.283061][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940683.283064][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940683.283066][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, - [1666940683.283068][9718:9718] CHIP:DMG: ListIndex = Null, - [1666940683.283070][9718:9718] CHIP:DMG: } - [1666940683.283072][9718:9718] CHIP:DMG: - [1666940683.283074][9718:9718] CHIP:DMG: Data = - [1666940683.283076][9718:9718] CHIP:DMG: { - [1666940683.283079][9718:9718] CHIP:DMG: 0x0 = "Cappuccino" (10 chars), - [1666940683.283081][9718:9718] CHIP:DMG: 0x1 = 4, - [1666940683.283084][9718:9718] CHIP:DMG: 0x2 = [ - [1666940683.283086][9718:9718] CHIP:DMG: - [1666940683.283088][9718:9718] CHIP:DMG: { - [1666940683.283091][9718:9718] CHIP:DMG: 0x0 = 0, - [1666940683.283093][9718:9718] CHIP:DMG: 0x1 = 0, - [1666940683.283095][9718:9718] CHIP:DMG: }, - [1666940683.283098][9718:9718] CHIP:DMG: ], - [1666940683.283100][9718:9718] CHIP:DMG: }, - [1666940683.283102][9718:9718] CHIP:DMG: }, - [1666940683.283105][9718:9718] CHIP:DMG: - [1666940683.283107][9718:9718] CHIP:DMG: }, - [1666940683.283112][9718:9718] CHIP:DMG: - [1666940683.283114][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940683.283117][9718:9718] CHIP:DMG: { - [1666940683.283119][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940683.283121][9718:9718] CHIP:DMG: { - [1666940683.283123][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940683.283125][9718:9718] CHIP:DMG: AttributePathIB = - [1666940683.283128][9718:9718] CHIP:DMG: { - [1666940683.283130][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940683.283132][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940683.283134][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, - [1666940683.283136][9718:9718] CHIP:DMG: ListIndex = Null, - [1666940683.283138][9718:9718] CHIP:DMG: } - [1666940683.283141][9718:9718] CHIP:DMG: - [1666940683.283143][9718:9718] CHIP:DMG: Data = - [1666940683.283145][9718:9718] CHIP:DMG: { - [1666940683.283148][9718:9718] CHIP:DMG: 0x0 = "Espresso" (8 chars), - [1666940683.283150][9718:9718] CHIP:DMG: 0x1 = 7, - [1666940683.283152][9718:9718] CHIP:DMG: 0x2 = [ - [1666940683.283154][9718:9718] CHIP:DMG: - [1666940683.283157][9718:9718] CHIP:DMG: { - [1666940683.283159][9718:9718] CHIP:DMG: 0x0 = 0, - [1666940683.283161][9718:9718] CHIP:DMG: 0x1 = 0, - [1666940683.283164][9718:9718] CHIP:DMG: }, - [1666940683.283167][9718:9718] CHIP:DMG: ], - [1666940683.283169][9718:9718] CHIP:DMG: }, - [1666940683.283171][9718:9718] CHIP:DMG: }, - [1666940683.283174][9718:9718] CHIP:DMG: - [1666940683.283176][9718:9718] CHIP:DMG: }, - [1666940683.283179][9718:9718] CHIP:DMG: - [1666940683.283181][9718:9718] CHIP:DMG: ], - [1666940683.283188][9718:9718] CHIP:DMG: - [1666940683.283190][9718:9718] CHIP:DMG: SuppressResponse = true, - [1666940683.283192][9718:9718] CHIP:DMG: InteractionModelRevision = 1 + Verify the "SupportedModes response" on the TH (all-cluster-app) log: + + [1666940683.282921][9718:9718] CHIP:DMG: ReportDataMessage = + [1666940683.282923][9718:9718] CHIP:DMG: { + [1666940683.282925][9718:9718] CHIP:DMG: AttributeReportIBs = + [1666940683.282928][9718:9718] CHIP:DMG: [ + [1666940683.282929][9718:9718] CHIP:DMG: AttributeReportIB = + [1666940683.282933][9718:9718] CHIP:DMG: { + [1666940683.282935][9718:9718] CHIP:DMG: AttributeDataIB = + [1666940683.282937][9718:9718] CHIP:DMG: { + [1666940683.282939][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, + [1666940683.282941][9718:9718] CHIP:DMG: AttributePathIB = + [1666940683.282944][9718:9718] CHIP:DMG: { + [1666940683.282946][9718:9718] CHIP:DMG: Endpoint = 0x1, + [1666940683.282948][9718:9718] CHIP:DMG: Cluster = 0x50, + [1666940683.282950][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, + [1666940683.282952][9718:9718] CHIP:DMG: } + [1666940683.282955][9718:9718] CHIP:DMG: + [1666940683.282957][9718:9718] CHIP:DMG: Data = [ + [1666940683.282959][9718:9718] CHIP:DMG: + [1666940683.282962][9718:9718] CHIP:DMG: ], + [1666940683.282964][9718:9718] CHIP:DMG: }, + [1666940683.282966][9718:9718] CHIP:DMG: + [1666940683.282968][9718:9718] CHIP:DMG: }, + [1666940683.282972][9718:9718] CHIP:DMG: + [1666940683.282974][9718:9718] CHIP:DMG: AttributeReportIB = + [1666940683.282978][9718:9718] CHIP:DMG: { + [1666940683.282980][9718:9718] CHIP:DMG: AttributeDataIB = + [1666940683.282982][9718:9718] CHIP:DMG: { + [1666940683.282984][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, + [1666940683.282986][9718:9718] CHIP:DMG: AttributePathIB = + [1666940683.282988][9718:9718] CHIP:DMG: { + [1666940683.282990][9718:9718] CHIP:DMG: Endpoint = 0x1, + [1666940683.282992][9718:9718] CHIP:DMG: Cluster = 0x50, + [1666940683.282995][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, + [1666940683.282997][9718:9718] CHIP:DMG: ListIndex = Null, + [1666940683.282999][9718:9718] CHIP:DMG: } + [1666940683.283001][9718:9718] CHIP:DMG: + [1666940683.283003][9718:9718] CHIP:DMG: Data = + [1666940683.283005][9718:9718] CHIP:DMG: { + [1666940683.283008][9718:9718] CHIP:DMG: 0x0 = "Black" (5 chars), + [1666940683.283011][9718:9718] CHIP:DMG: 0x1 = 0, + [1666940683.283013][9718:9718] CHIP:DMG: 0x2 = [ + [1666940683.283015][9718:9718] CHIP:DMG: + [1666940683.283020][9718:9718] CHIP:DMG: { + [1666940683.283022][9718:9718] CHIP:DMG: 0x0 = 0, + [1666940683.283025][9718:9718] CHIP:DMG: 0x1 = 0, + [1666940683.283027][9718:9718] CHIP:DMG: }, + [1666940683.283030][9718:9718] CHIP:DMG: ], + [1666940683.283032][9718:9718] CHIP:DMG: }, + [1666940683.283034][9718:9718] CHIP:DMG: }, + [1666940683.283037][9718:9718] CHIP:DMG: + [1666940683.283039][9718:9718] CHIP:DMG: }, + [1666940683.283044][9718:9718] CHIP:DMG: + [1666940683.283046][9718:9718] CHIP:DMG: AttributeReportIB = + [1666940683.283049][9718:9718] CHIP:DMG: { + [1666940683.283051][9718:9718] CHIP:DMG: AttributeDataIB = + [1666940683.283053][9718:9718] CHIP:DMG: { + [1666940683.283055][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, + [1666940683.283057][9718:9718] CHIP:DMG: AttributePathIB = + [1666940683.283059][9718:9718] CHIP:DMG: { + [1666940683.283061][9718:9718] CHIP:DMG: Endpoint = 0x1, + [1666940683.283064][9718:9718] CHIP:DMG: Cluster = 0x50, + [1666940683.283066][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, + [1666940683.283068][9718:9718] CHIP:DMG: ListIndex = Null, + [1666940683.283070][9718:9718] CHIP:DMG: } + [1666940683.283072][9718:9718] CHIP:DMG: + [1666940683.283074][9718:9718] CHIP:DMG: Data = + [1666940683.283076][9718:9718] CHIP:DMG: { + [1666940683.283079][9718:9718] CHIP:DMG: 0x0 = "Cappuccino" (10 chars), + [1666940683.283081][9718:9718] CHIP:DMG: 0x1 = 4, + [1666940683.283084][9718:9718] CHIP:DMG: 0x2 = [ + [1666940683.283086][9718:9718] CHIP:DMG: + [1666940683.283088][9718:9718] CHIP:DMG: { + [1666940683.283091][9718:9718] CHIP:DMG: 0x0 = 0, + [1666940683.283093][9718:9718] CHIP:DMG: 0x1 = 0, + [1666940683.283095][9718:9718] CHIP:DMG: }, + [1666940683.283098][9718:9718] CHIP:DMG: ], + [1666940683.283100][9718:9718] CHIP:DMG: }, + [1666940683.283102][9718:9718] CHIP:DMG: }, + [1666940683.283105][9718:9718] CHIP:DMG: + [1666940683.283107][9718:9718] CHIP:DMG: }, + [1666940683.283112][9718:9718] CHIP:DMG: + [1666940683.283114][9718:9718] CHIP:DMG: AttributeReportIB = + [1666940683.283117][9718:9718] CHIP:DMG: { + [1666940683.283119][9718:9718] CHIP:DMG: AttributeDataIB = + [1666940683.283121][9718:9718] CHIP:DMG: { + [1666940683.283123][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, + [1666940683.283125][9718:9718] CHIP:DMG: AttributePathIB = + [1666940683.283128][9718:9718] CHIP:DMG: { + [1666940683.283130][9718:9718] CHIP:DMG: Endpoint = 0x1, + [1666940683.283132][9718:9718] CHIP:DMG: Cluster = 0x50, + [1666940683.283134][9718:9718] CHIP:DMG: Attribute = 0x0000_0002, + [1666940683.283136][9718:9718] CHIP:DMG: ListIndex = Null, + [1666940683.283138][9718:9718] CHIP:DMG: } + [1666940683.283141][9718:9718] CHIP:DMG: + [1666940683.283143][9718:9718] CHIP:DMG: Data = + [1666940683.283145][9718:9718] CHIP:DMG: { + [1666940683.283148][9718:9718] CHIP:DMG: 0x0 = "Espresso" (8 chars), + [1666940683.283150][9718:9718] CHIP:DMG: 0x1 = 7, + [1666940683.283152][9718:9718] CHIP:DMG: 0x2 = [ + [1666940683.283154][9718:9718] CHIP:DMG: + [1666940683.283157][9718:9718] CHIP:DMG: { + [1666940683.283159][9718:9718] CHIP:DMG: 0x0 = 0, + [1666940683.283161][9718:9718] CHIP:DMG: 0x1 = 0, + [1666940683.283164][9718:9718] CHIP:DMG: }, + [1666940683.283167][9718:9718] CHIP:DMG: ], + [1666940683.283169][9718:9718] CHIP:DMG: }, + [1666940683.283171][9718:9718] CHIP:DMG: }, + [1666940683.283174][9718:9718] CHIP:DMG: + [1666940683.283176][9718:9718] CHIP:DMG: }, + [1666940683.283179][9718:9718] CHIP:DMG: + [1666940683.283181][9718:9718] CHIP:DMG: ], + [1666940683.283188][9718:9718] CHIP:DMG: + [1666940683.283190][9718:9718] CHIP:DMG: SuppressResponse = true, + [1666940683.283192][9718:9718] CHIP:DMG: InteractionModelRevision = 1 + + + ./chip-tool modeselect read current-mode 1 1 + + Verify the "CurrentMode response" on the TH (all-cluster-app) log: + + [1666940720.150375][9718:9718] CHIP:DMG: ReportDataMessage = + [1666940720.150377][9718:9718] CHIP:DMG: { + [1666940720.150379][9718:9718] CHIP:DMG: AttributeReportIBs = + [1666940720.150382][9718:9718] CHIP:DMG: [ + [1666940720.150384][9718:9718] CHIP:DMG: AttributeReportIB = + [1666940720.150387][9718:9718] CHIP:DMG: { + [1666940720.150389][9718:9718] CHIP:DMG: AttributeDataIB = + [1666940720.150391][9718:9718] CHIP:DMG: { + [1666940720.150394][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, + [1666940720.150396][9718:9718] CHIP:DMG: AttributePathIB = + [1666940720.150399][9718:9718] CHIP:DMG: { + [1666940720.150402][9718:9718] CHIP:DMG: Endpoint = 0x1, + [1666940720.150404][9718:9718] CHIP:DMG: Cluster = 0x50, + [1666940720.150406][9718:9718] CHIP:DMG: Attribute = 0x0000_0003, + [1666940720.150408][9718:9718] CHIP:DMG: } + [1666940720.150411][9718:9718] CHIP:DMG: + [1666940720.150414][9718:9718] CHIP:DMG: Data = 0, + [1666940720.150416][9718:9718] CHIP:DMG: }, + [1666940720.150419][9718:9718] CHIP:DMG: + [1666940720.150421][9718:9718] CHIP:DMG: }, + [1666940720.150424][9718:9718] CHIP:DMG: + [1666940720.150426][9718:9718] CHIP:DMG: ], + [1666940720.150429][9718:9718] CHIP:DMG: + [1666940720.150431][9718:9718] CHIP:DMG: SuppressResponse = true, + [1666940720.150433][9718:9718] CHIP:DMG: InteractionModelRevision = 1 + + ./chip-tool modeselect read standard-namespace 1 1 + + Verify the "StandardNamespace response" on the TH (all-cluster-app) log: + + 1668497274.561088][9289:9289] CHIP:DMG: ReportDataMessage = + [1668497274.561091][9289:9289] CHIP:DMG: { + [1668497274.561094][9289:9289] CHIP:DMG: AttributeReportIBs = + [1668497274.561100][9289:9289] CHIP:DMG: [ + [1668497274.561103][9289:9289] CHIP:DMG: AttributeReportIB = + [1668497274.561108][9289:9289] CHIP:DMG: { + [1668497274.561111][9289:9289] CHIP:DMG: AttributeDataIB = + [1668497274.561115][9289:9289] CHIP:DMG: { + [1668497274.561119][9289:9289] CHIP:DMG: DataVersion = 0x6c775d5f, + [1668497274.561123][9289:9289] CHIP:DMG: AttributePathIB = + [1668497274.561126][9289:9289] CHIP:DMG: { + [1668497274.561129][9289:9289] CHIP:DMG: Endpoint = 0x1, + [1668497274.561133][9289:9289] CHIP:DMG: Cluster = 0x50, + [1668497274.561137][9289:9289] CHIP:DMG: Attribute = 0x0000_0001, + [1668497274.561142][9289:9289] CHIP:DMG: } + [1668497274.561147][9289:9289] CHIP:DMG: + [1668497274.561153][9289:9289] CHIP:DMG: Data = 0, + [1668497274.561157][9289:9289] CHIP:DMG: }, + [1668497274.561162][9289:9289] CHIP:DMG: + [1668497274.561165][9289:9289] CHIP:DMG: }, + [1668497274.561169][9289:9289] CHIP:DMG: + [1668497274.561172][9289:9289] CHIP:DMG: ], + [1668497274.561177][9289:9289] CHIP:DMG: + [1668497274.561180][9289:9289] CHIP:DMG: SuppressResponse = true, + [1668497274.561183][9289:9289] CHIP:DMG: InteractionModelRevision = 1 + [1668497274.561185][9289:9289] CHIP:DMG: } + + ./chip-tool modeselect read description 1 1 + + Verify the "Description response" on the TH (all-cluster-app) log: + + [1668497391.858312][9289:9289] CHIP:DMG: ReportDataMessage = + [1668497391.858315][9289:9289] CHIP:DMG: { + [1668497391.858318][9289:9289] CHIP:DMG: AttributeReportIBs = + [1668497391.858324][9289:9289] CHIP:DMG: [ + [1668497391.858327][9289:9289] CHIP:DMG: AttributeReportIB = + [1668497391.858331][9289:9289] CHIP:DMG: { + [1668497391.858334][9289:9289] CHIP:DMG: AttributeDataIB = + [1668497391.858338][9289:9289] CHIP:DMG: { + [1668497391.858342][9289:9289] CHIP:DMG: DataVersion = 0x6c775d5f, + [1668497391.858345][9289:9289] CHIP:DMG: AttributePathIB = + [1668497391.858348][9289:9289] CHIP:DMG: { + [1668497391.858352][9289:9289] CHIP:DMG: Endpoint = 0x1, + [1668497391.858355][9289:9289] CHIP:DMG: Cluster = 0x50, + [1668497391.858359][9289:9289] CHIP:DMG: Attribute = 0x0000_0000, + [1668497391.858363][9289:9289] CHIP:DMG: } + [1668497391.858368][9289:9289] CHIP:DMG: + [1668497391.858372][9289:9289] CHIP:DMG: Data = "Coffee" (6 chars), + [1668497391.858375][9289:9289] CHIP:DMG: }, + [1668497391.858380][9289:9289] CHIP:DMG: + [1668497391.858383][9289:9289] CHIP:DMG: }, + [1668497391.858387][9289:9289] CHIP:DMG: + [1668497391.858390][9289:9289] CHIP:DMG: ], + [1668497391.858395][9289:9289] CHIP:DMG: + [1668497391.858398][9289:9289] CHIP:DMG: SuppressResponse = true, + [1668497391.858403][9289:9289] CHIP:DMG: InteractionModelRevision = 1 + [1668497391.858406][9289:9289] CHIP:DMG: } disabled: true - label: @@ -158,35 +251,35 @@ tests: time in a manufacturer specific order" PICS: MOD.C.AO-READ verification: | - ./chip-tool modeselect read on-mode 1 1 + ./chip-tool modeselect read start-up-mode 1 1 - Verify the "OnMode response" on the TH (all-cluster-app) log: - - [1666940828.515256][9718:9718] CHIP:DMG: ReportDataMessage = - [1666940828.515259][9718:9718] CHIP:DMG: { - [1666940828.515261][9718:9718] CHIP:DMG: AttributeReportIBs = - [1666940828.515265][9718:9718] CHIP:DMG: [ - [1666940828.515267][9718:9718] CHIP:DMG: AttributeReportIB = - [1666940828.515272][9718:9718] CHIP:DMG: { - [1666940828.515275][9718:9718] CHIP:DMG: AttributeDataIB = - [1666940828.515277][9718:9718] CHIP:DMG: { - [1666940828.515280][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, - [1666940828.515282][9718:9718] CHIP:DMG: AttributePathIB = - [1666940828.515285][9718:9718] CHIP:DMG: { - [1666940828.515288][9718:9718] CHIP:DMG: Endpoint = 0x1, - [1666940828.515290][9718:9718] CHIP:DMG: Cluster = 0x50, - [1666940828.515293][9718:9718] CHIP:DMG: Attribute = 0x0000_0005, - [1666940828.515295][9718:9718] CHIP:DMG: } - [1666940828.515298][9718:9718] CHIP:DMG: - [1666940828.515301][9718:9718] CHIP:DMG: Data = NULL - [1666940828.515304][9718:9718] CHIP:DMG: }, - [1666940828.515307][9718:9718] CHIP:DMG: - [1666940828.515309][9718:9718] CHIP:DMG: }, - [1666940828.515312][9718:9718] CHIP:DMG: - [1666940828.515314][9718:9718] CHIP:DMG: ], - [1666940828.515317][9718:9718] CHIP:DMG: - [1666940828.515320][9718:9718] CHIP:DMG: SuppressResponse = true, - [1666940828.515322][9718:9718] CHIP:DMG: InteractionModelRevision = 1 + Verify the "StartUpMode response" on the TH (all-cluster-app) log: + + [1666940848.925393][9718:9718] CHIP:DMG: ReportDataMessage = + [1666940848.925396][9718:9718] CHIP:DMG: { + [1666940848.925397][9718:9718] CHIP:DMG: AttributeReportIBs = + [1666940848.925401][9718:9718] CHIP:DMG: [ + [1666940848.925403][9718:9718] CHIP:DMG: AttributeReportIB = + [1666940848.925407][9718:9718] CHIP:DMG: { + [1666940848.925410][9718:9718] CHIP:DMG: AttributeDataIB = + [1666940848.925414][9718:9718] CHIP:DMG: { + [1666940848.925416][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, + [1666940848.925418][9718:9718] CHIP:DMG: AttributePathIB = + [1666940848.925421][9718:9718] CHIP:DMG: { + [1666940848.925423][9718:9718] CHIP:DMG: Endpoint = 0x1, + [1666940848.925428][9718:9718] CHIP:DMG: Cluster = 0x50, + [1666940848.925431][9718:9718] CHIP:DMG: Attribute = 0x0000_0004, + [1666940848.925433][9718:9718] CHIP:DMG: } + [1666940848.925436][9718:9718] CHIP:DMG: + [1666940848.925438][9718:9718] CHIP:DMG: Data = 0, + [1666940848.925440][9718:9718] CHIP:DMG: }, + [1666940848.925443][9718:9718] CHIP:DMG: + [1666940848.925445][9718:9718] CHIP:DMG: }, + [1666940848.925448][9718:9718] CHIP:DMG: + [1666940848.925450][9718:9718] CHIP:DMG: ], + [1666940848.925454][9718:9718] CHIP:DMG: + [1666940848.925456][9718:9718] CHIP:DMG: SuppressResponse = true, + [1666940848.925458][9718:9718] CHIP:DMG: InteractionModelRevision = 1 disabled: true - label: @@ -204,31 +297,59 @@ tests: verification: | ./chip-tool modeselect write on-mode 0 1 1 - Verify the "WriteRequestMessage" on TH(all-cluster-app) log: - - WriteRequestMessage = - [1673335946.283857][10561:10561] CHIP:DMG: { - [1673335946.283866][10561:10561] CHIP:DMG: suppressResponse = false, - [1673335946.283878][10561:10561] CHIP:DMG: timedRequest = false, - [1673335946.283887][10561:10561] CHIP:DMG: AttributeDataIBs = - [1673335946.283905][10561:10561] CHIP:DMG: [ - [1673335946.283914][10561:10561] CHIP:DMG: AttributeDataIB = - [1673335946.283926][10561:10561] CHIP:DMG: { - [1673335946.283935][10561:10561] CHIP:DMG: AttributePathIB = - [1673335946.283947][10561:10561] CHIP:DMG: { - [1673335946.283959][10561:10561] CHIP:DMG: Endpoint = 0x1, - [1673335946.283971][10561:10561] CHIP:DMG: Cluster = 0x50, - [1673335946.283983][10561:10561] CHIP:DMG: Attribute = 0x0000_0005, - [1673335946.283994][10561:10561] CHIP:DMG: } - [1673335946.284008][10561:10561] CHIP:DMG: - [1673335946.284022][10561:10561] CHIP:DMG: Data = 0, - [1673335946.284032][10561:10561] CHIP:DMG: }, - [1673335946.284046][10561:10561] CHIP:DMG: - [1673335946.284055][10561:10561] CHIP:DMG: ], - [1673335946.284070][10561:10561] CHIP:DMG: - [1673335946.284081][10561:10561] CHIP:DMG: moreChunkedMessages = false, - [1673335946.284091][10561:10561] CHIP:DMG: InteractionModelRevision = 1 - [1673335946.284099][10561:10561] CHIP:DMG: }, + Verify the "WriteRequestMessage" on TH(all-cluster-app) log: + + WriteRequestMessage = + [1673335946.283857][10561:10561] CHIP:DMG: { + [1673335946.283866][10561:10561] CHIP:DMG: suppressResponse = false, + [1673335946.283878][10561:10561] CHIP:DMG: timedRequest = false, + [1673335946.283887][10561:10561] CHIP:DMG: AttributeDataIBs = + [1673335946.283905][10561:10561] CHIP:DMG: [ + [1673335946.283914][10561:10561] CHIP:DMG: AttributeDataIB = + [1673335946.283926][10561:10561] CHIP:DMG: { + [1673335946.283935][10561:10561] CHIP:DMG: AttributePathIB = + [1673335946.283947][10561:10561] CHIP:DMG: { + [1673335946.283959][10561:10561] CHIP:DMG: Endpoint = 0x1, + [1673335946.283971][10561:10561] CHIP:DMG: Cluster = 0x50, + [1673335946.283983][10561:10561] CHIP:DMG: Attribute = 0x0000_0005, + [1673335946.283994][10561:10561] CHIP:DMG: } + [1673335946.284008][10561:10561] CHIP:DMG: + [1673335946.284022][10561:10561] CHIP:DMG: Data = 0, + [1673335946.284032][10561:10561] CHIP:DMG: }, + [1673335946.284046][10561:10561] CHIP:DMG: + [1673335946.284055][10561:10561] CHIP:DMG: ], + [1673335946.284070][10561:10561] CHIP:DMG: + [1673335946.284081][10561:10561] CHIP:DMG: moreChunkedMessages = false, + [1673335946.284091][10561:10561] CHIP:DMG: InteractionModelRevision = 1 + [1673335946.284099][10561:10561] CHIP:DMG: }, + + ./chip-tool modeselect write start-up-mode 0 1 1 + + Verify the "WriteRequestMessage" on TH(all-cluster-app) log: + + WriteRequestMessage = + [1673336054.600463][10561:10561] CHIP:DMG: { + [1673336054.600470][10561:10561] CHIP:DMG: suppressResponse = false, + [1673336054.600479][10561:10561] CHIP:DMG: timedRequest = false, + [1673336054.600486][10561:10561] CHIP:DMG: AttributeDataIBs = + [1673336054.600501][10561:10561] CHIP:DMG: [ + [1673336054.600509][10561:10561] CHIP:DMG: AttributeDataIB = + [1673336054.600521][10561:10561] CHIP:DMG: { + [1673336054.600531][10561:10561] CHIP:DMG: AttributePathIB = + [1673336054.600544][10561:10561] CHIP:DMG: { + [1673336054.600557][10561:10561] CHIP:DMG: Endpoint = 0x1, + [1673336054.600569][10561:10561] CHIP:DMG: Cluster = 0x50, + [1673336054.600582][10561:10561] CHIP:DMG: Attribute = 0x0000_0004, + [1673336054.600593][10561:10561] CHIP:DMG: } + [1673336054.600608][10561:10561] CHIP:DMG: + [1673336054.600621][10561:10561] CHIP:DMG: Data = 0, + [1673336054.600631][10561:10561] CHIP:DMG: }, + [1673336054.600646][10561:10561] CHIP:DMG: + [1673336054.600656][10561:10561] CHIP:DMG: ], + [1673336054.600673][10561:10561] CHIP:DMG: + [1673336054.600683][10561:10561] CHIP:DMG: moreChunkedMessages = false, + [1673336054.600695][10561:10561] CHIP:DMG: InteractionModelRevision = 1 + [1673336054.600704][10561:10561] CHIP:DMG: }, disabled: true - label: @@ -239,36 +360,283 @@ tests: verification: | ./chip-tool modeselect read attribute-list 1 1 - Verify the "AttributeList response" on the TH (all-cluster-minimal-app) log: - - [1689750639.773775][3545:3547] CHIP:DMG: ReportDataMessage = - [1689750639.773815][3545:3547] CHIP:DMG: { - [1689750639.773846][3545:3547] CHIP:DMG: AttributeReportIBs = - [1689750639.773896][3545:3547] CHIP:DMG: [ - [1689750639.773928][3545:3547] CHIP:DMG: AttributeReportIB = - [1689750639.773980][3545:3547] CHIP:DMG: { - [1689750639.774014][3545:3547] CHIP:DMG: AttributeDataIB = - [1689750639.774052][3545:3547] CHIP:DMG: { - [1689750639.774093][3545:3547] CHIP:DMG: DataVersion = 0x346e22fd, - [1689750639.774132][3545:3547] CHIP:DMG: AttributePathIB = - [1689750639.774174][3545:3547] CHIP:DMG: { - [1689750639.774217][3545:3547] CHIP:DMG: Endpoint = 0x1, - [1689750639.774261][3545:3547] CHIP:DMG: Cluster = 0x50, - [1689750639.774304][3545:3547] CHIP:DMG: Attribute = 0x0000_FFFB, - [1689750639.774347][3545:3547] CHIP:DMG: } - [1689750639.774390][3545:3547] CHIP:DMG: - [1689750639.774430][3545:3547] CHIP:DMG: Data = [ - [1689750639.774515][3545:3547] CHIP:DMG: 0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533, - [1689750639.774565][3545:3547] CHIP:DMG: ], - [1689750639.774604][3545:3547] CHIP:DMG: }, - [1689750639.774652][3545:3547] CHIP:DMG: - [1689750639.774685][3545:3547] CHIP:DMG: }, - [1689750639.774731][3545:3547] CHIP:DMG: - [1689750639.774761][3545:3547] CHIP:DMG: ], - [1689750639.774804][3545:3547] CHIP:DMG: - [1689750639.774835][3545:3547] CHIP:DMG: SuppressResponse = true, - [1689750639.774867][3545:3547] CHIP:DMG: InteractionModelRevision = 1 - [1689750639.774896][3545:3547] CHIP:DMG: } + Verify the "AttributeList response" on the TH (all-cluster-minimal-app) log: + + [1689750639.773775][3545:3547] CHIP:DMG: ReportDataMessage = + [1689750639.773815][3545:3547] CHIP:DMG: { + [1689750639.773846][3545:3547] CHIP:DMG: AttributeReportIBs = + [1689750639.773896][3545:3547] CHIP:DMG: [ + [1689750639.773928][3545:3547] CHIP:DMG: AttributeReportIB = + [1689750639.773980][3545:3547] CHIP:DMG: { + [1689750639.774014][3545:3547] CHIP:DMG: AttributeDataIB = + [1689750639.774052][3545:3547] CHIP:DMG: { + [1689750639.774093][3545:3547] CHIP:DMG: DataVersion = 0x346e22fd, + [1689750639.774132][3545:3547] CHIP:DMG: AttributePathIB = + [1689750639.774174][3545:3547] CHIP:DMG: { + [1689750639.774217][3545:3547] CHIP:DMG: Endpoint = 0x1, + [1689750639.774261][3545:3547] CHIP:DMG: Cluster = 0x50, + [1689750639.774304][3545:3547] CHIP:DMG: Attribute = 0x0000_FFFB, + [1689750639.774347][3545:3547] CHIP:DMG: } + [1689750639.774390][3545:3547] CHIP:DMG: + [1689750639.774430][3545:3547] CHIP:DMG: Data = [ + [1689750639.774515][3545:3547] CHIP:DMG: 0, 1, 2, 3, 65528, 65529, 65530, 65531, 65532, 65533, + [1689750639.774565][3545:3547] CHIP:DMG: ], + [1689750639.774604][3545:3547] CHIP:DMG: }, + [1689750639.774652][3545:3547] CHIP:DMG: + [1689750639.774685][3545:3547] CHIP:DMG: }, + [1689750639.774731][3545:3547] CHIP:DMG: + [1689750639.774761][3545:3547] CHIP:DMG: ], + [1689750639.774804][3545:3547] CHIP:DMG: + [1689750639.774835][3545:3547] CHIP:DMG: SuppressResponse = true, + [1689750639.774867][3545:3547] CHIP:DMG: InteractionModelRevision = 1 + [1689750639.774896][3545:3547] CHIP:DMG: } + + + ./chip-tool modeselect read feature-map 1 1 + + Verify the " FeatureMap " on the TH (all-cluster-minimal-app) log: + + [1666943338.908026][12769:12769] CHIP:DMG: ReportDataMessage = + [1666943338.908028][12769:12769] CHIP:DMG: { + [1666943338.908031][12769:12769] CHIP:DMG: AttributeReportIBs = + [1666943338.908035][12769:12769] CHIP:DMG: [ + [1666943338.908038][12769:12769] CHIP:DMG: AttributeReportIB = + [1666943338.908042][12769:12769] CHIP:DMG: { + [1666943338.908045][12769:12769] CHIP:DMG: AttributeDataIB = + [1666943338.908048][12769:12769] CHIP:DMG: { + [1666943338.908051][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, + [1666943338.908054][12769:12769] CHIP:DMG: AttributePathIB = + [1666943338.908057][12769:12769] CHIP:DMG: { + [1666943338.908060][12769:12769] CHIP:DMG: Endpoint = 0x1, + [1666943338.908064][12769:12769] CHIP:DMG: Cluster = 0x50, + [1666943338.908067][12769:12769] CHIP:DMG: Attribute = 0x0000_FFFC, + [1666943338.908070][12769:12769] CHIP:DMG: } + [1666943338.908074][12769:12769] CHIP:DMG: + [1666943338.908077][12769:12769] CHIP:DMG: Data = 0, + [1666943338.908080][12769:12769] CHIP:DMG: }, + [1666943338.908084][12769:12769] CHIP:DMG: + [1666943338.908086][12769:12769] CHIP:DMG: }, + [1666943338.908090][12769:12769] CHIP:DMG: + [1666943338.908092][12769:12769] CHIP:DMG: ], + [1666943338.908096][12769:12769] CHIP:DMG: + [1666943338.908099][12769:12769] CHIP:DMG: SuppressResponse = true, + [1666943338.908102][12769:12769] CHIP:DMG: InteractionModelRevision = 1 + [1666943338.908104][12769:12769] CHIP:DMG: } + + + ./chip-tool modeselect read supported-modes 1 1 + + Verify the "SupportedModes response" on the TH (all-cluster-minimal-app) log: + + 1666943362.813636][12769:12769] CHIP:DMG: ReportDataMessage = + [1666943362.813638][12769:12769] CHIP:DMG: { + [1666943362.813640][12769:12769] CHIP:DMG: AttributeReportIBs = + [1666943362.813643][12769:12769] CHIP:DMG: [ + [1666943362.813645][12769:12769] CHIP:DMG: AttributeReportIB = + [1666943362.813650][12769:12769] CHIP:DMG: { + [1666943362.813652][12769:12769] CHIP:DMG: AttributeDataIB = + [1666943362.813655][12769:12769] CHIP:DMG: { + [1666943362.813657][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, + [1666943362.813659][12769:12769] CHIP:DMG: AttributePathIB = + [1666943362.813662][12769:12769] CHIP:DMG: { + [1666943362.813664][12769:12769] CHIP:DMG: Endpoint = 0x1, + [1666943362.813666][12769:12769] CHIP:DMG: Cluster = 0x50, + [1666943362.813669][12769:12769] CHIP:DMG: Attribute = 0x0000_0002, + [1666943362.813671][12769:12769] CHIP:DMG: } + [1666943362.813674][12769:12769] CHIP:DMG: + [1666943362.813676][12769:12769] CHIP:DMG: Data = [ + [1666943362.813679][12769:12769] CHIP:DMG: + [1666943362.813681][12769:12769] CHIP:DMG: ], + [1666943362.813683][12769:12769] CHIP:DMG: }, + [1666943362.813686][12769:12769] CHIP:DMG: + [1666943362.813688][12769:12769] CHIP:DMG: }, + [1666943362.813692][12769:12769] CHIP:DMG: + [1666943362.813694][12769:12769] CHIP:DMG: AttributeReportIB = + [1666943362.813699][12769:12769] CHIP:DMG: { + [1666943362.813701][12769:12769] CHIP:DMG: AttributeDataIB = + [1666943362.813703][12769:12769] CHIP:DMG: { + [1666943362.813705][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, + [1666943362.813707][12769:12769] CHIP:DMG: AttributePathIB = + [1666943362.813709][12769:12769] CHIP:DMG: { + [1666943362.813711][12769:12769] CHIP:DMG: Endpoint = 0x1, + [1666943362.813714][12769:12769] CHIP:DMG: Cluster = 0x50, + [1666943362.813716][12769:12769] CHIP:DMG: Attribute = 0x0000_0002, + [1666943362.813719][12769:12769] CHIP:DMG: ListIndex = Null, + [1666943362.813721][12769:12769] CHIP:DMG: } + [1666943362.813725][12769:12769] CHIP:DMG: + [1666943362.813727][12769:12769] CHIP:DMG: Data = + [1666943362.813729][12769:12769] CHIP:DMG: { + [1666943362.813732][12769:12769] CHIP:DMG: 0x0 = "Black" (5 chars), + [1666943362.813735][12769:12769] CHIP:DMG: 0x1 = 0, + [1666943362.813737][12769:12769] CHIP:DMG: 0x2 = [ + [1666943362.813740][12769:12769] CHIP:DMG: + [1666943362.813742][12769:12769] CHIP:DMG: { + [1666943362.813745][12769:12769] CHIP:DMG: 0x0 = 0, + [1666943362.813748][12769:12769] CHIP:DMG: 0x1 = 0, + [1666943362.813750][12769:12769] CHIP:DMG: }, + [1666943362.813752][12769:12769] CHIP:DMG: ], + [1666943362.813755][12769:12769] CHIP:DMG: }, + [1666943362.813756][12769:12769] CHIP:DMG: }, + [1666943362.813760][12769:12769] CHIP:DMG: + [1666943362.813762][12769:12769] CHIP:DMG: }, + [1666943362.813768][12769:12769] CHIP:DMG: + [1666943362.813770][12769:12769] CHIP:DMG: AttributeReportIB = + [1666943362.813775][12769:12769] CHIP:DMG: { + [1666943362.813776][12769:12769] CHIP:DMG: AttributeDataIB = + [1666943362.813779][12769:12769] CHIP:DMG: { + [1666943362.813781][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, + [1666943362.813783][12769:12769] CHIP:DMG: AttributePathIB = + [1666943362.813786][12769:12769] CHIP:DMG: { + [1666943362.813788][12769:12769] CHIP:DMG: Endpoint = 0x1, + [1666943362.813790][12769:12769] CHIP:DMG: Cluster = 0x50, + [1666943362.813793][12769:12769] CHIP:DMG: Attribute = 0x0000_0002, + [1666943362.813795][12769:12769] CHIP:DMG: ListIndex = Null, + [1666943362.813797][12769:12769] CHIP:DMG: } + [1666943362.813801][12769:12769] CHIP:DMG: + [1666943362.813803][12769:12769] CHIP:DMG: Data = + [1666943362.813805][12769:12769] CHIP:DMG: { + [1666943362.813807][12769:12769] CHIP:DMG: 0x0 = "Cappuccino" (10 chars), + [1666943362.813810][12769:12769] CHIP:DMG: 0x1 = 4, + [1666943362.813812][12769:12769] CHIP:DMG: 0x2 = [ + [1666943362.813814][12769:12769] CHIP:DMG: + [1666943362.813817][12769:12769] CHIP:DMG: { + [1666943362.813820][12769:12769] CHIP:DMG: 0x0 = 0, + [1666943362.813823][12769:12769] CHIP:DMG: 0x1 = 0, + [1666943362.813826][12769:12769] CHIP:DMG: }, + [1666943362.813828][12769:12769] CHIP:DMG: ], + [1666943362.813830][12769:12769] CHIP:DMG: }, + [1666943362.813832][12769:12769] CHIP:DMG: }, + [1666943362.813836][12769:12769] CHIP:DMG: + [1666943362.813838][12769:12769] CHIP:DMG: }, + [1666943362.813844][12769:12769] CHIP:DMG: + [1666943362.813846][12769:12769] CHIP:DMG: AttributeReportIB = + [1666943362.813850][12769:12769] CHIP:DMG: { + [1666943362.813852][12769:12769] CHIP:DMG: AttributeDataIB = + [1666943362.813855][12769:12769] CHIP:DMG: { + [1666943362.813857][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, + [1666943362.813860][12769:12769] CHIP:DMG: AttributePathIB = + [1666943362.813862][12769:12769] CHIP:DMG: { + [1666943362.813864][12769:12769] CHIP:DMG: Endpoint = 0x1, + [1666943362.813866][12769:12769] CHIP:DMG: Cluster = 0x50, + [1666943362.813869][12769:12769] CHIP:DMG: Attribute = 0x0000_0002, + [1666943362.813871][12769:12769] CHIP:DMG: ListIndex = Null, + [1666943362.813873][12769:12769] CHIP:DMG: } + [1666943362.813876][12769:12769] CHIP:DMG: + [1666943362.813878][12769:12769] CHIP:DMG: Data = + [1666943362.813881][12769:12769] CHIP:DMG: { + [1666943362.813883][12769:12769] CHIP:DMG: 0x0 = "Espresso" (8 chars), + [1666943362.813886][12769:12769] CHIP:DMG: 0x1 = 7, + [1666943362.813888][12769:12769] CHIP:DMG: 0x2 = [ + [1666943362.813890][12769:12769] CHIP:DMG: + [1666943362.813893][12769:12769] CHIP:DMG: { + [1666943362.813895][12769:12769] CHIP:DMG: 0x0 = 0, + [1666943362.813898][12769:12769] CHIP:DMG: 0x1 = 0, + [1666943362.813900][12769:12769] CHIP:DMG: }, + [1666943362.813903][12769:12769] CHIP:DMG: ], + [1666943362.813905][12769:12769] CHIP:DMG: }, + [1666943362.813907][12769:12769] CHIP:DMG: }, + [1666943362.813911][12769:12769] CHIP:DMG: + [1666943362.813913][12769:12769] CHIP:DMG: }, + [1666943362.813917][12769:12769] CHIP:DMG: + [1666943362.813918][12769:12769] CHIP:DMG: ], + [1666943362.813926][12769:12769] CHIP:DMG: + [1666943362.813928][12769:12769] CHIP:DMG: SuppressResponse = true, + [1666943362.813931][12769:12769] CHIP:DMG: InteractionModelRevision = 1 + [1666943362.813934][12769:12769] CHIP:DMG: } + [1666943362.813936][12769:12769] CHIP:DMG: + + + ./chip-tool modeselect read current-mode 1 1 + + Verify the "CurrentMode response" on the TH (all-cluster-minimal-app) log: + + 1666943427.104790][12769:12769] CHIP:DMG: ReportDataMessage = + [1666943427.104798][12769:12769] CHIP:DMG: { + [1666943427.104804][12769:12769] CHIP:DMG: AttributeReportIBs = + [1666943427.104814][12769:12769] CHIP:DMG: [ + [1666943427.104820][12769:12769] CHIP:DMG: AttributeReportIB = + [1666943427.104838][12769:12769] CHIP:DMG: { + [1666943427.104846][12769:12769] CHIP:DMG: AttributeDataIB = + [1666943427.104858][12769:12769] CHIP:DMG: { + [1666943427.104869][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, + [1666943427.104880][12769:12769] CHIP:DMG: AttributePathIB = + [1666943427.104891][12769:12769] CHIP:DMG: { + [1666943427.104904][12769:12769] CHIP:DMG: Endpoint = 0x1, + [1666943427.104916][12769:12769] CHIP:DMG: Cluster = 0x50, + [1666943427.104931][12769:12769] CHIP:DMG: Attribute = 0x0000_0003, + [1666943427.104939][12769:12769] CHIP:DMG: } + [1666943427.104948][12769:12769] CHIP:DMG: + [1666943427.104956][12769:12769] CHIP:DMG: Data = 0, + [1666943427.104963][12769:12769] CHIP:DMG: }, + [1666943427.104974][12769:12769] CHIP:DMG: + [1666943427.104981][12769:12769] CHIP:DMG: }, + [1666943427.104991][12769:12769] CHIP:DMG: + [1666943427.105001][12769:12769] CHIP:DMG: ], + [1666943427.105017][12769:12769] CHIP:DMG: + [1666943427.105027][12769:12769] CHIP:DMG: SuppressResponse = true, + [1666943427.105037][12769:12769] CHIP:DMG: InteractionModelRevision = 1 + [1666943427.105045][12769:12769] CHIP:DMG: } + + + ./chip-tool modeselect read standard-namespace 1 1 + + Verify the "StandardNamespace response" on the TH (all-cluster-minimal-app) log: + + [1666943453.966995][12769:12769] CHIP:DMG: ReportDataMessage = + [1666943453.966997][12769:12769] CHIP:DMG: { + [1666943453.966999][12769:12769] CHIP:DMG: AttributeReportIBs = + [1666943453.967003][12769:12769] CHIP:DMG: [ + [1666943453.967005][12769:12769] CHIP:DMG: AttributeReportIB = + [1666943453.967008][12769:12769] CHIP:DMG: { + [1666943453.967010][12769:12769] CHIP:DMG: AttributeDataIB = + [1666943453.967014][12769:12769] CHIP:DMG: { + [1666943453.967017][12769:12769] CHIP:DMG: DataVersion = 0x5fb921d0, + [1666943453.967019][12769:12769] CHIP:DMG: AttributePathIB = + [1666943453.967021][12769:12769] CHIP:DMG: { + [1666943453.967025][12769:12769] CHIP:DMG: Endpoint = 0x1, + [1666943453.967027][12769:12769] CHIP:DMG: Cluster = 0x50, + [1666943453.967029][12769:12769] CHIP:DMG: Attribute = 0x0000_0001, + [1666943453.967033][12769:12769] CHIP:DMG: } + [1666943453.967035][12769:12769] CHIP:DMG: + [1666943453.967038][12769:12769] CHIP:DMG: Data = 0, + [1666943453.967040][12769:12769] CHIP:DMG: }, + [1666943453.967043][12769:12769] CHIP:DMG: + [1666943453.967045][12769:12769] CHIP:DMG: }, + [1666943453.967047][12769:12769] CHIP:DMG: + [1666943453.967050][12769:12769] CHIP:DMG: ], + [1666943453.967053][12769:12769] CHIP:DMG: + [1666943453.967055][12769:12769] CHIP:DMG: SuppressResponse = true, + [1666943453.967057][12769:12769] CHIP:DMG: InteractionModelRevision = 1 + + ./chip-tool modeselect read description 1 1 + + Verify the "Description response" on the TH (all-cluster-minimal-app) log: + + [1666941093.845092][9718:9718] CHIP:DMG: ReportDataMessage = + [1666941093.845094][9718:9718] CHIP:DMG: { + [1666941093.845096][9718:9718] CHIP:DMG: AttributeReportIBs = + [1666941093.845099][9718:9718] CHIP:DMG: [ + [1666941093.845101][9718:9718] CHIP:DMG: AttributeReportIB = + [1666941093.845105][9718:9718] CHIP:DMG: { + [1666941093.845107][9718:9718] CHIP:DMG: AttributeDataIB = + [1666941093.845110][9718:9718] CHIP:DMG: { + [1666941093.845112][9718:9718] CHIP:DMG: DataVersion = 0xb4a9126f, + [1666941093.845115][9718:9718] CHIP:DMG: AttributePathIB = + [1666941093.845117][9718:9718] CHIP:DMG: { + [1666941093.845119][9718:9718] CHIP:DMG: Endpoint = 0x1, + [1666941093.845122][9718:9718] CHIP:DMG: Cluster = 0x50, + [1666941093.845124][9718:9718] CHIP:DMG: Attribute = 0x0000_0000, + [1666941093.845126][9718:9718] CHIP:DMG: } + [1666941093.845129][9718:9718] CHIP:DMG: + [1666941093.845132][9718:9718] CHIP:DMG: Data = "Coffee" (6 chars), + [1666941093.845134][9718:9718] CHIP:DMG: }, + [1666941093.845137][9718:9718] CHIP:DMG: + [1666941093.845139][9718:9718] CHIP:DMG: }, + [1666941093.845142][9718:9718] CHIP:DMG: + [1666941093.845144][9718:9718] CHIP:DMG: ], + [1666941093.845147][9718:9718] CHIP:DMG: + [1666941093.845149][9718:9718] CHIP:DMG: SuppressResponse = true, + [1666941093.845152][9718:9718] CHIP:DMG: InteractionModelRevision = 1 disabled: true - label: diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml index 5553de105f9de3..172635fbba8b72 100644 --- a/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_3.yaml @@ -95,7 +95,28 @@ tests: "Step 3a: Perform an OTA update on the device that requires a reboot. Allow for the DUT to update and fully reboot." verification: | - Perform an OTA update on the device that requires a reboot. Allow for the DUT to update and fully reboot.. + To perform an OTA update on Thread device follow the cmmds below: + + Step-1 :Run the below command in the path, Where we built the OTA provider app . (In this example , the path is connectedhomeip/out/debug ./chip-ota-provider-app -f ) + + ./chip-ota-provider-app -f ~/chip_repos/connectedhomeip/examples/all-clusters-app/nrfconnect/build2/zephyr/matter.ota + + Execute the command using chip-tool and verify the response as below. + + Step-2: ./chip-tool pairing onnetwork 2 20202021 + + [1659104612.593187][62366:62371] CHIP:CTL: Successfully finished commissioning step 'ReadCommissioningInfo' + + Step-3 : ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": [{"cluster": 41, "endpoint": null, "deviceType": null}]}]' 2 0 + + [1651101661960] [90832:7598169] CHIP: [DMG] status = 0x00 (SUCCESS), + + + Step-4: ./chip-tool otasoftwareupdaterequestor write default-otaproviders '[{"fabricIndex": 1, "providerNodeID": 2, "endpoint": 0}]' 1 0 + + Step-5: ./chip-tool otasoftwareupdaterequestor announce-otaprovider 2 0 0 0 1 0 + + Make sure the OTA update is succesful. Refer OTA testcases for the command & its output. . cluster: "LogCommands" command: "UserPrompt" PICS: PICS_USER_PROMPT diff --git a/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml b/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml index 887f9fb4ed4cbd..fb585c8e5c2ea2 100755 --- a/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_MOD_3_4.yaml @@ -81,6 +81,7 @@ tests: "Step 2d: Select a value from the list in step 2c with a different value than the StartUpMode value read in step 1. TH sends a write command for OnMode to the DUT with the selected value." + runIf: IsExpectedValue PICS: MOD.S.A0002 && MOD.S.C00.Rsp command: "writeAttribute" attribute: "OnMode" @@ -92,7 +93,7 @@ tests: command: "readAttribute" attribute: "OnMode" response: - value: Step2dOnModeValue + saveAs: Step3OnModeValue - label: "Step 4: TH writes 1 to StartUpOnOff attribute of the OnOff Cluster of @@ -130,4 +131,4 @@ tests: command: "readAttribute" attribute: "CurrentMode" response: - value: Step2dOnModeValue + value: Step3OnModeValue diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml index b3daa00f2aca39..14583bde4cdf79 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_1.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 22.4.1. [TC-SC-4.1] Commissionable Node Discovery [DUT as Commissionee] @@ -890,7 +889,7 @@ tests: represented as a variable length decimal number in ASCII without leading zeros" # The device type is not broadcasted by the accessory under CI. - PICS: MCORE.SC.VENDOR_SUBTYPE + PICS: MCORE.SC.DEVTYPE_SUBTYPE cluster: "DiscoveryCommands" command: "FindCommissionableByDeviceType" arguments: @@ -1201,10 +1200,19 @@ tests: - name: "value" value: deviceType + #TODO - label: "Step 10h: Check Commissioning Mode (_CM)" - PICS: MCORE.SC.EXTENDED_DISCOVERY - cluster: "DiscoveryCommands" - command: "FindCommissionableByCommissioningMode" + verification: | + subtype _CM must not be present + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_SKIP_SAMPLE_APP && MCORE.SC.EXTENDED_DISCOVERY + arguments: + values: + - name: "message" + value: "Enter 'y' after success" + - name: "expectedValue" + value: "y" # TXT Records @@ -1275,7 +1283,7 @@ tests: an unsigned integer with units of milliseconds and shall be encoded as a variable length decimal number in ASCII, omitting leading zeros. Shall not exceed 65535." - PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY + PICS: MCORE.SC.SAI_OP_DISCOVERY_KEY && MCORE.SC.EXTENDED_DISCOVERY cluster: "DiscoveryCommands" command: "FindCommissionable" response: diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_2.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_2.yaml index c375d547ca8aa0..e14ca379b0e46a 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_2.yaml @@ -27,7 +27,7 @@ tests: - label: "Note" verification: | Chip-tool command used below are an example to verify the DUT as controller test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. - disabled: true. + disabled: true - label: "Precondition" verification: | diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml index b56ec65e95334e..8521cb24bc8daa 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_3.yaml @@ -27,7 +27,7 @@ tests: - label: "Note" verification: | Chip-tool command used below are an example to verify the DUT as controller test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. - disabled: true. + disabled: true - label: "Step 1: DUT is commissioned to TH and DUT is instructed to advertise diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml index 5ee31fb6d3eec8..ec1f3d22956514 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_4.yaml @@ -27,7 +27,7 @@ tests: - label: "Note" verification: | Chip-tool command used below are an example to verify the DUT as controller test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. - disabled: true. + disabled: true - label: "Precondition" verification: | diff --git a/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml b/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml index a165c5be37518f..5acdae3fe9b499 100644 --- a/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml +++ b/src/app/tests/suites/certification/Test_TC_SC_4_6.yaml @@ -28,7 +28,7 @@ tests: - label: "Note" verification: | Chip-tool command used below are an example to verify the DUT as commissioner test cases. For certification test, we expect DUT should have a capability or way to run the equivalent command. - disabled: true. + disabled: true - label: "Precondition" verification: | diff --git a/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml b/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml index be26810aa15ea1..ffd8849ca25d08 100644 --- a/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_SWTCH_2_2.yaml @@ -183,6 +183,16 @@ tests: [1687257759.711136][17346:17348] CHIP:TOO: SwitchLatched: { [1687257759.711140][17346:17348] CHIP:TOO: NewPosition: 2 [1687257759.711141][17346:17348] CHIP:TOO: } + + In the current SDK development, Max number of positions is configured as 2, hence the current test step should fail as NewPosition reached more than the Max NumberOfPositions. + If the DUT supports more number of positions, then for the command in previous step, position should increase to the next level. Below is the sample command to execute, if the DUT supports NumberOfPositions > 2 . + + ./chip-tool switch read current-position 1 1 + + Verify CurrentPosition value is 2 On TH(chip-tool) Log and below is the sample log provided for the raspi platform: + + [1659600502.023560][4306:4311] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001 DataVersion: 391463069 + [1687847841.651568][19369:19371] CHIP:TOO: CurrentPosition: 2 disabled: true - label: @@ -214,6 +224,15 @@ tests: [1687258513.235235][17561:17563] CHIP:TOO: SwitchLatched: { [1687258513.235238][17561:17563] CHIP:TOO: NewPosition: 3 [1687258513.235239][17561:17563] CHIP:TOO: } + + In the current SDK development, Max number of positions are configured as 2, hence the current test step should fail as its reached more than the numberof position. If the DUT supports more number of positions, then for the above command, it should increase to the next level. Below is the sample command to execute , if the DUT supports more than 2 NumberOfPositions. + + ./chip-tool switch read current-position 1 1 + + Verify CurrentPosition value is 3 On TH(chip-tool) Log and below is the sample log provided for the raspi platform and below is the sample log provided for the raspi platform: + + [1659600502.023560][4306:4311] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_003B Attribute 0x0000_0001 DataVersion: 391463069 + [1687847873.385882][19378:19380] CHIP:TOO: CurrentPosition: 3 disabled: true - label: "Step 2h: Operator returns switch to first position" diff --git a/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml b/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml index b4d441dd131f98..779fbd12afe7ec 100644 --- a/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCCM_3_1.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 219.3.1. [TC-TCCM-3.1] On Mode functionality with DUT as Server @@ -21,183 +20,104 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Refrigerator And Temperature Controlled Cabinet Mode" + endpoint: 1 + #Configure newmode value + new_mode_th: + type: int8u + defaultValue: 2 + nonNull_OnMode_value: + type: int8u + defaultValue: 0 tests: - - label: "Precondition" - verification: | - 1. Refrigerator and Temperature Controlled Cabinet and OnOff clusters are available on the same endpoint - - 2. The OnMode attribute is set to a non-NULL value from the mode values indicated by the SupportedModes attribute. - - Read the SupportedModes attribute, select a value from SupportedModes and save the value as OnMode_value - - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify the list of SupportedModes and below is the sample log provided for the raspi platform: - - [1692182446.526184][3967:3969] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0000 DataVersion: 69758028 - [1692182446.526293][3967:3969] CHIP:TOO: SupportedModes: 3 entries - [1692182446.526346][3967:3969] CHIP:TOO: [1]: { - [1692182446.526371][3967:3969] CHIP:TOO: Label: Normal - [1692182446.526395][3967:3969] CHIP:TOO: Mode: 0 - [1692182446.526423][3967:3969] CHIP:TOO: ModeTags: 1 entries - [1692182446.526468][3967:3969] CHIP:TOO: [1]: { - [1692182446.526493][3967:3969] CHIP:TOO: Value: 0 - [1692182446.526516][3967:3969] CHIP:TOO: } - [1692182446.526540][3967:3969] CHIP:TOO: } - [1692182446.526572][3967:3969] CHIP:TOO: [2]: { - [1692182446.526595][3967:3969] CHIP:TOO: Label: Rapid Cool - [1692182446.526617][3967:3969] CHIP:TOO: Mode: 1 - [1692182446.526642][3967:3969] CHIP:TOO: ModeTags: 1 entries - [1692182446.526670][3967:3969] CHIP:TOO: [1]: { - [1692182446.526695][3967:3969] CHIP:TOO: Value: 16384 - [1692182446.526717][3967:3969] CHIP:TOO: } - [1692182446.526741][3967:3969] CHIP:TOO: } - [1692182446.526773][3967:3969] CHIP:TOO: [3]: { - [1692182446.526795][3967:3969] CHIP:TOO: Label: Rapid Freeze - [1692182446.526817][3967:3969] CHIP:TOO: Mode: 2 - [1692182446.526842][3967:3969] CHIP:TOO: ModeTags: 1 entries - [1692182446.526870][3967:3969] CHIP:TOO: [1]: { - [1692182446.526894][3967:3969] CHIP:TOO: Value: 16385 - [1692182446.526917][3967:3969] CHIP:TOO: } - [1692182446.526940][3967:3969] CHIP:TOO: } - - - Set the OnMode attribute value to OnMode_value - - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode write on-mode 0 1 1 - - On TH(chip-tool) log, Verify DUT responds with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1692170913.264454][3071:3073] CHIP:DMG: StatusIB = - [1692170913.264489][3071:3073] CHIP:DMG: { - [1692170913.264522][3071:3073] CHIP:DMG: status = 0x00 (SUCCESS), - [1692170913.264557][3071:3073] CHIP:DMG: }, - disabled: true + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: - "Step 1: Commission DUT to TH (can be skipped if done in a preceding - test)." - verification: | - - disabled: true - - - label: "Step 2: TH reads from the DUT the OnMode attribute." + "Preconditions: The OnMode attribute is set to a non-NULL value from + the mode values indicated by the SupportedModes attribute." PICS: TCCM.S.A0003 && TCCM.S.F00 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read on-mode 1 1 + command: "writeAttribute" + attribute: "OnMode" + arguments: + value: nonNull_OnMode_value - On TH(chip-tool), Verify that OnMode attribute value is an integer - Save the value as on_mode_dut and below is the sample log provided for the raspi platform, here OnMode value is 0 - - [1690190167.005388][16387:16389] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0003 DataVersion: 473867556 - [1690190167.005447][16387:16389] CHIP:TOO: OnMode: 0 - disabled: true + - label: "Step 2: TH reads the OnMode attribute from the DUT" + PICS: TCCM.S.A0003 && TCCM.S.F00 + command: "readAttribute" + attribute: "OnMode" + response: + saveAs: on_mode_dut - - label: "Step 3: TH reads from the DUT the CurrentMode attribute." + - label: "Step 3a: TH reads the CurrentMode attribute from the DUT" PICS: TCCM.S.A0001 && TCCM.S.F00 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute is an integer. - Save the value as old_current_mode_dut and below is the sample log provided for the raspi platform, Here CurrentMode value is 0 + command: "readAttribute" + attribute: "CurrentMode" + response: + saveAs: old_current_mode_dut - NOTE: If on_mode_dut is equal to old_current_mode_dut proceed to step 4. Else proceed to step 6. - - [1690190333.843046][16430:16432] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0001 DataVersion: 2612443001 - [1690190333.843064][16430:16432] CHIP:TOO: CurrentMode: 0 - disabled: true - - - label: "Step 4: TH reads from the DUT the SupportedModes attribute." + - label: + "Step 3b: If the OnMode and CurrentMode attributes have the same + value, proceed to step 4, Otherwise proceed to step 6" + PICS: TCCM.S.A0003 && TCCM.S.A0001 && TCCM.S.F00 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: on_mode_dut + - name: "Value2" + value: old_current_mode_dut + response: + - values: + - name: "Equals" + saveAs: IsExpectedValue + + - label: "Step 4:TH reads the SupportedModes attribute from the DUT" + runIf: IsExpectedValue PICS: TCCM.S.A0000 && TCCM.S.F00 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read supported-modes 1 1 - - On TH(chip-tool) log, Verify DUT response contains a list of ModeOptionsStruct entries - - Verify that the list has two or more entries - - Save the Mode field values as supported_modes_dut - - Select a value from supported_modes_dut different from on_mode_dut. Save the value as new_mode_th, below is the sample log provided for the raspi platform: - - [1690190348.956716][16435:16437] CHIP:DMG: } - [1690190348.956853][16435:16437] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0000 DataVersion: 2612443001 - [1690190348.956895][16435:16437] CHIP:TOO: SupportedModes: 3 entries - [1690190348.956919][16435:16437] CHIP:TOO: [1]: { - [1690190348.956924][16435:16437] CHIP:TOO: Label: Normal - [1690190348.956929][16435:16437] CHIP:TOO: Mode: 0 - [1690190348.956935][16435:16437] CHIP:TOO: ModeTags: 1 entries - [1690190348.956952][16435:16437] CHIP:TOO: [1]: { - [1690190348.956955][16435:16437] CHIP:TOO: Value: 0 - [1690190348.956958][16435:16437] CHIP:TOO: } - [1690190348.956961][16435:16437] CHIP:TOO: } - [1690190348.956967][16435:16437] CHIP:TOO: [2]: { - [1690190348.956970][16435:16437] CHIP:TOO: Label: Rapid Cool - [1690190348.956972][16435:16437] CHIP:TOO: Mode: 1 - [1690190348.956976][16435:16437] CHIP:TOO: ModeTags: 1 entries - [1690190348.956980][16435:16437] CHIP:TOO: [1]: { - [1690190348.956982][16435:16437] CHIP:TOO: Value: 16384 - [1690190348.956984][16435:16437] CHIP:TOO: } - [1690190348.956987][16435:16437] CHIP:TOO: } - [1690190348.956992][16435:16437] CHIP:TOO: [3]: { - [1690190348.956994][16435:16437] CHIP:TOO: Label: Rapid Freeze - [1690190348.956997][16435:16437] CHIP:TOO: Mode: 2 - [1690190348.957000][16435:16437] CHIP:TOO: ModeTags: 1 entries - [1690190348.957003][16435:16437] CHIP:TOO: [1]: { - [1690190348.957006][16435:16437] CHIP:TOO: Value: 16385 - [1690190348.957008][16435:16437] CHIP:TOO: } - [1690190348.957010][16435:16437] CHIP:TOO: } - disabled: true + command: "readAttribute" + attribute: "SupportedModes" + response: + constraints: + type: list + minLength: 2 - label: - "Step 5: TH sends a ChangeToMode command to the DUT with NewMode set - to new_mode_th" + "Step 5: Select a value from supported_modes_dut different from + on_mode_dut. Save the value as new_mode_th. TH sends a ChangeToMode + command to the DUT with NewMode set to new_mode_th" + runIf: IsExpectedValue PICS: TCCM.S.C00.Rsp && TCCM.S.F00 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode change-to-mode 2 1 1 - - Verify on TH(chip-tool) log, DUT responds contains a ChangeToModeResponse command with a SUCCESS (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1690190379.801241][16449:16451] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Command 0x0000_0001 - [1690190379.801256][16449:16451] CHIP:TOO: ChangeToModeResponse: { - [1690190379.801260][16449:16451] CHIP:TOO: status: 0 - [1690190379.801263][16449:16451] CHIP:TOO: } - disabled: true - - - label: "Step 6: TH sends a Off command to the DUT" + command: "ChangeToMode" + arguments: + values: + - name: "NewMode" + value: new_mode_th + response: + values: + - name: "Status" + value: 0x00 + + - label: "Step 6: TH sends an Off command to the DUT" PICS: OO.S.C00.Rsp && TCCM.S.F00 - verification: | - ./chip-tool onoff off 1 1 + cluster: "On/Off" + command: "Off" - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931101.118656][20709:20711] CHIP:DMG: StatusIB = - [1684931101.118659][20709:20711] CHIP:DMG: { - [1684931101.118663][20709:20711] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931101.118665][20709:20711] CHIP:DMG: }, - disabled: true - - - label: "Step 7: TH sends a On command to the DUT" + - label: "Step 7: TH sends an On command to the DUT" PICS: OO.S.C01.Rsp && TCCM.S.F00 - verification: | - ./chip-tool onoff on 1 1 - - On TH(chip-tool) log, Verify that DUT responds with a successful (value 0x00) status response and below is the sample log provided for the raspi platform: - - [1684931217.055514][20729:20731] CHIP:DMG: StatusIB = - [1684931217.055517][20729:20731] CHIP:DMG: { - [1684931217.055520][20729:20731] CHIP:DMG: status = 0x00 (SUCCESS), - [1684931217.055523][20729:20731] CHIP:DMG: }, - disabled: true + cluster: "On/Off" + command: "On" - - label: "Step 8: TH reads from the DUT the CurrentMode attribute." + - label: "Step 8: TH reads the CurrentMode attribute from the DUT" PICS: TCCM.S.A0001 && TCCM.S.F00 - verification: | - ./chip-tool refrigeratorandtemperaturecontrolledcabinetmode read current-mode 1 1 - - On TH(chip-tool), Verify that CurrentMode attribute value is an integer value and equal to on_mode_dut, below is the sample log provided for the raspi platform, here CurrentMode attribute value is 0 - - - [1690190401.931156][16461:16463] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0052 Attribute 0x0000_0001 DataVersion: 2612443003 - [1690190401.931176][16461:16463] CHIP:TOO: CurrentMode: 0 - disabled: true + command: "readAttribute" + attribute: "CurrentMode" + response: + value: on_mode_dut diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_2_1.yaml index 4496be8836d46d..737113bfcdb1e4 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_2_1.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 178.2.1. [TC-TCTL-2.1] Attributes with DUT as Server @@ -22,76 +21,86 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Temperature Control" + endpoint: 1 tests: - - label: "Note" - verification: | - This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. - disabled: true - - - label: "Step 1: Commission DUT to TH" - verification: | - - disabled: true + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the MinTemperature attribute" PICS: TCTL.S.A0001 - verification: | - ./chip-tool temperaturecontrol read min-temperature 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperature with value less than TCTL.S.A0002(MaxTemperature). - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0001 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: min-temperature: 0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "MinTemperature" + response: + saveAs: MinTemperatureValue + constraints: + type: temperature - label: "Step 3: TH reads from the DUT the MaxTemperature attribute" PICS: TCTL.S.A0002 - verification: | - ./chip-tool temperaturecontrol read max-temperature 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperature with value greater than TCTL.S.A0001(MinTemperature). - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0002 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: max-temperature :0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "MaxTemperature" + response: + saveAs: MaxTemperatureValue + constraints: + type: temperature - label: "Step 4: TH reads from the DUT the Step attribute" PICS: TCTL.S.A0003 - verification: | - ./chip-tool temperaturecontrol read step 1 1 - - On TH(chip-tool), Verify that the DUT response contains a temperature value <= TCTL.S.A0002(MaxTemperature) - TCTL.S.A0001(MinTemperature) - and (TCTL.S.A0002(MaxTemperature) - TCTL.S.A0001(MinTemperature)) % DUT response == 0 - - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0003 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: step: 0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "Step" + response: + saveAs: StepValue + constraints: + type: temperature + maxValue: MaxTemperatureValue - MinTemperatureValue + + - label: + "Verify that the DUT response (maxTemperature - minTemperature) % the + received value of the Step attribute == 0." + PICS: TCTL.S.A0003 && TCTL.S.A0002 && TCTL.S.A0001 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: ( MaxTemperatureValue - MinTemperatureValue ) % StepValue + - name: "Value2" + value: 0 + response: + - values: + - name: "Equals" + value: true - label: "Step 5: TH reads from the DUT the TemperatureSetpoint attribute" PICS: TCTL.S.A0000 - verification: | - ./chip-tool temperaturecontrol read temperature-setpoint 1 1 - On TH(chip-tool), Verify that the DUT response contains a temperature with value between minTemperature and maxTemperature inclusive. - and and (temperature value - minTemperature) % the received value of the Step attribute from step 4 == 0. - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "TemperatureSetpoint" + response: + saveAs: temperatureValue + constraints: + minValue: MinTemperatureValue + maxValue: MaxTemperatureValue + + - label: + "Verify that the DUT response (temperature value - minTemperature) % + the received value of the Step attribute from step 4 == 0." + PICS: TCTL.S.A0000 && TCTL.S.A0001 + cluster: "EqualityCommands" + command: "UnsignedNumberEquals" + arguments: + values: + - name: "Value1" + value: ( temperatureValue - MinTemperatureValue ) % StepValue + - name: "Value2" + value: 0 + response: + - values: + - name: "Equals" + value: true diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml index bcdb79209c7a36..a776b6901065ba 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_2_2.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 178.2.2. [TC-TCTL-2.2] Optional Temperature number attributes with DUT as @@ -23,61 +22,43 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Temperature Control" + endpoint: 1 tests: - - label: "Note" - verification: | - Note: This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. - disabled: true - - - label: "Step 1: Commission DUT to TH" - verification: | - - disabled: true + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the MinTemperature attribute" PICS: TCTL.S.A0001 - verification: | - ./chip-tool temperaturecontrol read min-temperature 1 1 - - On TH(chip-tool), Verify that the DUT response contains a temperature with value less than TCTL.S.A0002(MaxTemperature). - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0001 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: MinTemperature: 0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "MinTemperature" + response: + saveAs: MinTemperatureValue + constraints: + type: temperature - label: "Step 3: TH reads from the DUT the MaxTemperature attribute" PICS: TCTL.S.A0002 - verification: | - ./chip-tool temperaturecontrol read max-temperature 1 1 - - On TH(chip-tool), Verify that the DUT response contains a temperature with value greater than TCTL.S.A0001(MinTemperature). - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0002 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: MaxTemperature: 0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "MaxTemperature" + response: + saveAs: MaxTemperatureValue + constraints: + type: temperature + minValue: MinTemperatureValue - label: "Step 4: TH reads from the DUT the TemperatureSetpoint attribute" PICS: TCTL.S.A0000 - verification: | - ./chip-tool temperaturecontrol read temperature-setpoint 1 1 - - On TH(chip-tool), Verify that the DUT response contains a temperature with value between MinTemperature and TCTL.S.A0002(MaxTemperature) inclusive. - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0000 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: TemperatureSetpoint : 0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - disabled: true + command: "readAttribute" + attribute: "TemperatureSetpoint" + response: + saveAs: temperatureValue + constraints: + minValue: MinTemperatureValue + maxValue: MaxTemperatureValue diff --git a/src/app/tests/suites/certification/Test_TC_TCTL_2_3.yaml b/src/app/tests/suites/certification/Test_TC_TCTL_2_3.yaml index ba8136173dcc58..4da6e592c3b245 100644 --- a/src/app/tests/suites/certification/Test_TC_TCTL_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_TCTL_2_3.yaml @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# Auto-generated scripts for harness use only, please review before automation. The endpoints and cluster names are currently set to default name: 178.2.3. [TC-TCTL-2.3] Optional temperature level attributes with DUT as @@ -23,54 +22,51 @@ PICS: config: nodeId: 0x12344321 - cluster: "Basic Information" - endpoint: 0 + cluster: "Temperature Control" + endpoint: 1 tests: - - label: "Note" - verification: | - While verifying below test case we will get 0 and null value for few attributes, as per spec 0 and null value is default for those attributes. - disabled: true - - - label: "Step 1: Commission DUT to TH" - verification: | - - disabled: true + - label: "Step 1: Wait for the commissioned device to be retrieved" + cluster: "DelayCommands" + command: "WaitForCommissionee" + arguments: + values: + - name: "nodeId" + value: nodeId - label: "Step 2: TH reads from the DUT the SelectedTemperatureLevel attribute" PICS: TCTL.S.A0004 - verification: | - ./chip-tool temperaturecontrol read selected-temperature-level 1 1 - On TH(chip-tool), Verify that the DUT response contains a uint8 with value between 0 and 31 inclusive. - - [1689770673.417838][9280:9282] CHIP:DMG: SuppressResponse = true, - [1689770673.417845][9280:9282] CHIP:DMG: InteractionModelRevision = 1 - [1689770673.417851][9280:9282] CHIP:DMG: } - [1689770673.417920][9280:9282] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0004 DataVersion: 2844459846 - [1689770673.417946][9280:9282] CHIP:TOO: SelectedTemperatureLevel: 0 - [1689770673.418017][9280:9282] CHIP:EM: <<< [E:21789i S:28147 M:181187483 (Ack:172880761)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689770673.418031][9280:9282] CHIP:IN: (S) Sending msg 181187483 on secure session with LSID: 28147 - [1689770673.418076][9280:9282] CHIP:EM: Flushed pending ack for MessageCounter:172880761 on exchange 21789i - [1689770673.418170][9280:9280] CHIP:CTL: Shutting down the commissioner - disabled: true + command: "readAttribute" + attribute: "SelectedTemperatureLevel" + response: + constraints: + type: int8u + minValue: 0 + maxValue: 31 - label: "Step 3: TH reads from the DUT the SupportedTemperatureLevels attribute" PICS: TCTL.S.A0005 + command: "readAttribute" + attribute: "SupportedTemperatureLevels" + response: + constraints: + type: list + maxLength: 32 + + - label: + "Verify that the DUT response contains a list of strings with each + string length not exceeding 16 characters." verification: | - ./chip-tool temperaturecontrol read supported-temperature-levels 1 1 - On TH(chip-tool), Verify that the DUT response contains a list of up to 32 strings with each string length not exceeding 16 characters. - [1689770716.974439][9291:9293] CHIP:DMG: SuppressResponse = true, - [1689770716.974446][9291:9293] CHIP:DMG: InteractionModelRevision = 1 - [1689770716.974451][9291:9293] CHIP:DMG: } - [1689770716.974558][9291:9293] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0056 Attribute 0x0000_0005 DataVersion: 2844459846 - [1689770716.974594][9291:9293] CHIP:TOO: SupportedTemperatureLevels: 3 entries - [1689770716.974607][9291:9293] CHIP:TOO: [1]: Hot - [1689770716.974614][9291:9293] CHIP:TOO: [2]: Warm - [1689770716.974620][9291:9293] CHIP:TOO: [3]: Freezing - [1689770716.974685][9291:9293] CHIP:EM: <<< [E:59031i S:44407 M:101895658 (Ack:80765321)] (S) Msg TX to 1:0000000000000001 [9CA1] --- Type 0000:10 (SecureChannel:StandaloneAck) - [1689770716.974699][9291:9293] CHIP:IN: (S) Sending msg 101895658 on secure session with LSID: 44407 - [1689770716.974728][9291:9293] CHIP:EM: Flushed pending ack for MessageCounter:80765321 on exchange 59031i - disabled: true + On TH(chip-tool), Verify that the DUT response contains a list of strings with each string length not exceeding 16 characters. + cluster: "LogCommands" + command: "UserPrompt" + PICS: PICS_USER_PROMPT && TCTL.S.A0005 + arguments: + values: + - name: "message" + value: "Please enter 'y' after success" + - name: "expectedValue" + value: "y" diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml index bd9f9f31819b5f..36b535a024f6c0 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_2_1.yaml @@ -335,7 +335,7 @@ tests: maxValue: 3000 - label: "Step 17a: Reads attribute from DUT: MinHeatSetpointLimit" - PICS: TSTAT.S.A0015 && TSTAT.S.F05 && TSTAT.S.A0017 && TSTAT.S.A0003 + PICS: TSTAT.S.A0015 && TSTAT.S.F05 && TSTAT.S.A0017 && TSTAT.S.A0019 command: "readAttribute" attribute: "MinHeatSetpointLimit" response: @@ -362,7 +362,7 @@ tests: verifies that the value is within range" command: "readAttribute" attribute: "MinHeatSetpointLimit" - PICS: TSTAT.S.A0003 && !TSTAT.S.A0015 && !TSTAT.S.A0016 && !TSTAT.S.F05 + PICS: TSTAT.S.A0015 && !TSTAT.S.A0003 && !TSTAT.S.F05 response: constraints: type: int16s diff --git a/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml b/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml index 69ee9268a40a00..574725b5c06b84 100644 --- a/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_TSTAT_2_2.yaml @@ -1577,7 +1577,7 @@ tests: "Step 10a: Writes (sets back) default value of MinHeatSetpointLimit" command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: TSTAT.S.F01 && TSTAT.S.A0015 && TSTAT.S.A0003 + PICS: TSTAT.S.F00 && TSTAT.S.A0015 && TSTAT.S.A0003 arguments: value: AbsMinHeatSetpointLimitValue @@ -1585,21 +1585,21 @@ tests: "Step 10a: Writes (sets back) default value of MinHeatSetpointLimit" command: "writeAttribute" attribute: "MinHeatSetpointLimit" - PICS: TSTAT.S.F01 && TSTAT.S.A0015 && !TSTAT.S.A0003 + PICS: TSTAT.S.F00 && TSTAT.S.A0015 && !TSTAT.S.A0003 arguments: value: 700 - label: "Step 10a: Writes (sets back)default value of MaxHeatSetpointLimit" command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.F01 && TSTAT.S.A0016 && !TSTAT.S.F05 && TSTAT.S.A0004 + PICS: TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05 && TSTAT.S.A0004 arguments: value: AbsMaxHeatSetpointLimitValue - label: "Step 10a: Writes (sets back)default value of MaxHeatSetpointLimit" command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.F01 && TSTAT.S.A0016 && !TSTAT.S.F05 && !TSTAT.S.A0004 + PICS: TSTAT.S.F00 && TSTAT.S.A0016 && !TSTAT.S.F05 && !TSTAT.S.A0004 arguments: value: 3000 @@ -1607,7 +1607,7 @@ tests: "Step 10a: Writes MaxHeatSetpointLimit That meets the deadband of 2.5C" command: "writeAttribute" attribute: "MaxHeatSetpointLimit" - PICS: TSTAT.S.F01 && TSTAT.S.A0016 && TSTAT.S.F05 + PICS: TSTAT.S.F00 && TSTAT.S.A0016 && TSTAT.S.F05 arguments: value: 2950 diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml index bddc895d325ed8..e05c0653ff5c94 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_3_1.yaml @@ -26,6 +26,22 @@ config: cluster: "Window Covering" endpoint: 1 + Step1bWaitTime: + type: int16u + defaultValue: 10000 + Step2bWaitTime: + type: int16u + defaultValue: 500 + Step2eWaitTime: + type: int16u + defaultValue: 1000 + Step4bWaitTime: + type: int16u + defaultValue: 1000 + Step5aWaitTime: + type: int16u + defaultValue: 500 + tests: - label: "Step 0: Wait for the commissioned device to be retrieved" cluster: "DelayCommands" @@ -44,13 +60,13 @@ tests: PICS: WNCV.S.C01.Rsp command: "DownOrClose" - - label: "Step 1b: TH Waits for 10 seconds movement(s) on the device" + - label: "Step 1b: TH Waits for 5 - 15 seconds movement(s) on the device" cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 10000 + value: Step1bWaitTime ### ### Mandatory Depends on the FeatureMap @@ -120,7 +136,7 @@ tests: arguments: values: - name: "ms" - value: 100 + value: Step2bWaitTime ### Mandatory Depends on the FeatureMap - label: @@ -142,13 +158,13 @@ tests: response: value: 0 - - label: "Step 2e: TH leave the device moving for 2 seconds" + - label: "Step 2e: TH leave the device moving for 1-5 seconds" cluster: "DelayCommands" command: "WaitForMs" arguments: values: - name: "ms" - value: 2000 + value: Step2eWaitTime ######## UpOrOpen Reports ####### ### Step 3x -> Check UpOrOpen Mid term effects @@ -302,7 +318,7 @@ tests: arguments: values: - name: "ms" - value: 3000 + value: Step4bWaitTime ### Must Be ZERO # The value of bit 0..1 must be 00b & if (LF) value of bit 2..3 must be 00b & if (TL) value of bit 4..5 must be 00b @@ -322,7 +338,7 @@ tests: arguments: values: - name: "ms" - value: 1000 + value: Step5aWaitTime ### Mandatory Depends on the FeatureMap shall be tested as equals CurrentPositionLiftPercent100ths - label: diff --git a/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml b/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml index ed3873b6ae10bc..4b292d89fad9fb 100644 --- a/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_WNCV_3_2.yaml @@ -26,6 +26,22 @@ config: cluster: "Window Covering" endpoint: 1 + Step1bWaitTime: + type: int16u + defaultValue: 10000 + Step2bWaitTime: + type: int16u + defaultValue: 500 + Step2eWaitTime: + type: int16u + defaultValue: 1000 + Step4bWaitTime: + type: int16u + defaultValue: 1000 + Step5aWaitTime: + type: int16u + defaultValue: 500 + tests: - label: "Step 0: Wait for the commissioned device to be retrieved" cluster: "DelayCommands" @@ -50,7 +66,7 @@ tests: arguments: values: - name: "ms" - value: 10000 + value: Step1bWaitTime ### ### Mandatory Depends on the FeatureMap @@ -120,7 +136,7 @@ tests: arguments: values: - name: "ms" - value: 100 + value: Step2bWaitTime ### Mandatory Depends on the FeatureMap - label: @@ -148,7 +164,7 @@ tests: arguments: values: - name: "ms" - value: 2000 + value: Step2eWaitTime ######## DownOrClose Reports ####### ### Step 3x -> Check DownOrClose Mid term effects @@ -302,7 +318,7 @@ tests: arguments: values: - name: "ms" - value: 3000 + value: Step4bWaitTime ### Must Be ZERO # The value of bit 0..1 must be 00b & if (LF) value of bit 2..3 must be 00b & if (TL) value of bit 4..5 must be 00b @@ -322,7 +338,7 @@ tests: arguments: values: - name: "ms" - value: 1000 + value: Step5aWaitTime ### Mandatory Depends on the FeatureMap shall be tested as equals CurrentPositionLiftPercent100ths - label: diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index d709e8f55d907b..509c37ed6fd293 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -624,10 +624,10 @@ GRPKEY.S.A0003=1 GRPKEY.S.C00.Rsp=1 GRPKEY.S.C01.Rsp=1 -GRPKEY.S.C02.Rsp=1 +GRPKEY.S.C02.Tx=1 GRPKEY.S.C03.Rsp=1 GRPKEY.S.C04.Rsp=1 -GRPKEY.S.C05.Rsp=1 +GRPKEY.S.C05.Tx=1 GRPKEY.C=1 GRPKEY.C.A0000=1 @@ -763,8 +763,8 @@ LTIME.S.A0000=1 LTIME.S.A0001=1 LTIME.S.A0002=1 -LTIME.S.A0000.12HR=1 -LTIME.S.A0000.24HR=1 +LTIME.S.M.12HR=1 +LTIME.S.M.24HR=1 LTIME.C=1 LTIME.C.A0000=1 @@ -2620,10 +2620,10 @@ TCTL.C=1 TCTL.S.F00=0 TCTL.S.F01=1 TCTL.S.F02=0 -TCTL.S.A0000=1 -TCTL.S.A0001=1 -TCTL.S.A0002=1 -TCTL.S.A0003=1 +TCTL.S.A0000=0 +TCTL.S.A0001=0 +TCTL.S.A0002=0 +TCTL.S.A0003=0 TCTL.S.A0004=1 TCTL.S.A0005=1 TCC.M.ManuallyControlledTemperature=1 diff --git a/src/app/tests/suites/ciTests.json b/src/app/tests/suites/ciTests.json index 12fc67440426e6..1f2d48eae8f5d5 100644 --- a/src/app/tests/suites/ciTests.json +++ b/src/app/tests/suites/ciTests.json @@ -197,8 +197,16 @@ "Test_TC_SMOKECO_2_6" ], "Switch": ["Test_TC_SWTCH_1_1", "Test_TC_SWTCH_2_1"], - "TemperatureControlledCabinetMode": ["Test_TC_TCCM_1_1"], - "TemperatureControl": ["Test_TC_TCTL_1_1"], + "TemperatureControlledCabinetMode": [ + "Test_TC_TCCM_1_1", + "Test_TC_TCCM_3_1" + ], + "TemperatureControl": [ + "Test_TC_TCTL_1_1", + "Test_TC_TCTL_2_1", + "Test_TC_TCTL_2_2", + "Test_TC_TCTL_2_3" + ], "TemperatureMeasurement": ["Test_TC_TMP_1_1", "Test_TC_TMP_2_1"], "Thermostat": ["Test_TC_TSTAT_1_1", "Test_TC_TSTAT_2_1"], "ThermostatUserConfiguration": [ diff --git a/src/app/tests/suites/manualTests.json b/src/app/tests/suites/manualTests.json index e797e989ad3f53..b6a4f38f9c90d2 100644 --- a/src/app/tests/suites/manualTests.json +++ b/src/app/tests/suites/manualTests.json @@ -246,6 +246,7 @@ "WiFiNetworkDiagnostics": ["Test_TC_DGWIFI_2_2"], "WindowCovering": [], "FlowMeasurement": ["Test_TC_FLW_2_2"], + "GroupKeyManagement": ["Test_TC_GRPKEY_5_4"], "OccupancySensing": ["Test_TC_OCC_3_1"], "PowerSource": ["Test_TC_PS_2_2", "Test_TC_PS_3_1"], "BooleanState": ["Test_TC_BOOL_2_2"], @@ -259,7 +260,11 @@ "DoorLock": ["Test_TC_DRLK_2_10", "Test_TC_DRLK_3_2"], "LocalizationConfiguration": [], "LevelControl": [], - "LaundryWasherMode": ["Test_TC_LWM_1_2", "Test_TC_LWM_3_2"], + "LaundryWasherMode": [ + "Test_TC_LWM_1_2", + "Test_TC_LWM_3_2", + "Test_TC_LWM_3_3" + ], "OnOff": ["Test_TC_OO_2_3"], "OperationalState": ["Test_TC_OPSTATE_2_2"], "RelativeHumidityMeasurement": ["Test_TC_RH_2_2"], @@ -275,18 +280,11 @@ "TemperatureControlledCabinetMode": [ "Test_TC_TCCM_1_2", "Test_TC_TCCM_2_1", - "Test_TC_TCCM_3_1", "Test_TC_TCCM_3_2", "Test_TC_TCCM_3_3" ], "Switch": ["Test_TC_SWTCH_2_2", "Test_TC_SWTCH_3_2"], - "TemperatureControl": [ - "Test_TC_TCTL_2_1", - "Test_TC_TCTL_2_2", - "Test_TC_TCTL_2_3", - "Test_TC_TCTL_3_2", - "Test_TC_TCTL_3_3" - ], + "TemperatureControl": ["Test_TC_TCTL_3_2", "Test_TC_TCTL_3_3"], "TemperatureMeasurement": ["Test_TC_TMP_2_2"], "Thermostat": ["Test_TC_TSTAT_3_2"], "ThermostatUserConfiguration": [], @@ -341,6 +339,7 @@ "WiFiNetworkDiagnostics", "WindowCovering", "FlowMeasurement", + "GroupKeyManagement", "OccupancySensing", "PowerSource", "BooleanState", diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index 1f549307744223..a9fee22507a367 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -206,6 +206,8 @@ class TestList : public Command { printf("Test_TC_SWTCH_1_1\n"); printf("Test_TC_TCCM_1_1\n"); printf("Test_TC_TCTL_1_1\n"); + printf("Test_TC_TCTL_2_2\n"); + printf("Test_TC_TCTL_2_3\n"); printf("Test_TC_TMP_1_1\n"); printf("Test_TC_TMP_2_1\n"); printf("Test_TC_TSTAT_1_1\n"); @@ -47075,122 +47077,94 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { err = TestStep4aReadPacketRxCountAttributeConstraints_3(); break; case 4: - ChipLogProgress(chipTool, - " ***** Test Step 4 : Step 4b: Read PacketRxCount value from DUT and verify the number of packets received on " - "ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0002")) { + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4b: Reboot target device\n"); + if (ShouldSkip("PICS_SDK_CI_ONLY")) { NextTest(); return; } - err = TestStep4bReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4(); + err = TestStep4bRebootTargetDevice_4(); break; case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 5a: Read PacketTxCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0003")) { + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4c: Reboot target device(DUT)\n"); + if (ShouldSkip("PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestStep5aReadPacketTxCountAttributeConstraints_5(); + err = TestStep4cRebootTargetDeviceDUT_5(); break; case 6: - ChipLogProgress(chipTool, - " ***** Test Step 6 : Step 5b: Read PacketTxCount value from DUT and verify the number of packets received on " - "ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0003")) { - NextTest(); - return; - } - err = TestStep5bReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6(); + ChipLogProgress(chipTool, " ***** Test Step 6 : Wait for the commissioned device to be retrieved\n"); + err = TestWaitForTheCommissionedDeviceToBeRetrieved_6(); break; case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 6a: Read TxErrCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0004")) { + ChipLogProgress( + chipTool, " ***** Test Step 7 : Step 4d: Upon a node reboot, PacketRxCount attribute value will be reset to 0\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0002")) { NextTest(); return; } - err = TestStep6aReadTxErrCountAttributeConstraints_7(); + err = TestStep4dUponANodeRebootPacketRxCountAttributeValueWillBeResetTo0_7(); break; case 8: - ChipLogProgress(chipTool, - " ***** Test Step 8 : Step 6b: Read TxErrCount value from DUT and verify value indicates the number of failed " - "packet transmission on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0004")) { + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 5a: Read PacketTxCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0003")) { NextTest(); return; } - err = TestStep6bReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8(); + err = TestStep5aReadPacketTxCountAttributeConstraints_8(); break; case 9: - ChipLogProgress(chipTool, " ***** Test Step 9 : Step 7a: Read CollisionCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0005")) { + ChipLogProgress(chipTool, + " ***** Test Step 9 : Step 5b: Read PacketTxCount attribute constraints, Upon a node reboot, the value will be " + "reset to 0\n"); + if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0003")) { NextTest(); return; } - err = TestStep7aReadCollisionCountAttributeConstraints_9(); + err = TestStep5bReadPacketTxCountAttributeConstraintsUponANodeRebootTheValueWillBeResetTo0_9(); break; case 10: ChipLogProgress(chipTool, - " ***** Test Step 10 : Step 7b: Read CollisionCount value from DUT and verify value indicates the number of " - "collision occurred while transmitting packets on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0005")) { + " ***** Test Step 10 : Step 6: Read TxErrCount attribute constraints, Upon a node reboot, the value will be reset " + "to 0\n"); + if (ShouldSkip("DGETH.S.A0004")) { NextTest(); return; } - err = TestStep7bReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10(); + err = TestStep6ReadTxErrCountAttributeConstraintsUponANodeRebootTheValueWillBeResetTo0_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Step 8a: Read OverrunCount attribute constraints\n"); - if (ShouldSkip("DGETH.S.A0006")) { + ChipLogProgress(chipTool, + " ***** Test Step 11 : Step 7: Read CollisionCount attribute , Upon a node reboot, the value will be reset to 0\n"); + if (ShouldSkip("DGETH.S.A0005")) { NextTest(); return; } - err = TestStep8aReadOverrunCountAttributeConstraints_11(); + err = TestStep7ReadCollisionCountAttributeUponANodeRebootTheValueWillBeResetTo0_11(); break; case 12: - ChipLogProgress(chipTool, - " ***** Test Step 12 : Step 8b: Read OverrunCount value from DUT and verify value indicates the number of packets " - "dropped due to lack of buffer memory on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0006")) { + ChipLogProgress(chipTool, " ***** Test Step 12 : Step 8: Read OverrunCount attribute constraints\n"); + if (ShouldSkip("DGETH.S.A0006")) { NextTest(); return; } - err = TestStep8bReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12(); + err = TestStep8ReadOverrunCountAttributeConstraints_12(); break; case 13: - ChipLogProgress(chipTool, " ***** Test Step 13 : Step 9a: Read CarrierDetect attribute constraints\n"); + ChipLogProgress(chipTool, " ***** Test Step 13 : Step 9: Read CarrierDetect attribute constraints\n"); if (ShouldSkip("DGETH.S.A0007")) { NextTest(); return; } - err = TestStep9aReadCarrierDetectAttributeConstraints_13(); + err = TestStep9ReadCarrierDetectAttributeConstraints_13(); break; case 14: - ChipLogProgress(chipTool, - " ***** Test Step 14 : Step 9b: Read CarrierDetect value from DUT and verify value indicates the presence of " - "carrier detect control signal on ethernet network interface\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0007")) { - NextTest(); - return; - } - err = TestStep9bReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14(); - break; - case 15: - ChipLogProgress(chipTool, " ***** Test Step 15 : Step 10a: Read TimeSinceReset attribute constraints\n"); + ChipLogProgress(chipTool, " ***** Test Step 14 : Step 10: Read TimeSinceReset attribute constraints\n"); if (ShouldSkip("DGETH.S.A0008")) { NextTest(); return; } - err = TestStep10aReadTimeSinceResetAttributeConstraints_15(); - break; - case 16: - ChipLogProgress(chipTool, - " ***** Test Step 16 : Step 10b: Read TimeSinceReset value from DUT and verify the value indicates the duration of " - "time, in minutes\n"); - if (ShouldSkip("PICS_USER_PROMPT && DGETH.S.A0008")) { - NextTest(); - return; - } - err = TestStep10bReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16(); + err = TestStep10ReadTimeSinceResetAttributeConstraints_14(); break; } @@ -47248,12 +47222,6 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 15: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; - case 16: - VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - break; } // Go on to the next test. @@ -47267,7 +47235,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { private: std::atomic_uint16_t mTestIndex; - const uint16_t mTestCount = 17; + const uint16_t mTestCount = 15; chip::Optional mNodeId; chip::Optional mCluster; @@ -47299,8 +47267,6 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { if (value != nil) { VerifyOrReturn(CheckConstraintType("PHYRate", "enum8", "enum8")); - VerifyOrReturn(CheckConstraintMinValue("PHYRate", [value unsignedCharValue], 0U)); - VerifyOrReturn(CheckConstraintMaxValue("PHYRate", [value unsignedCharValue], 9U)); } NextTest(); @@ -47349,13 +47315,43 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("packetRxCount", "int64u", "int64u")); + VerifyOrReturn(CheckConstraintMinValue("packetRxCount", [value unsignedLongLongValue], 0ULL)); + VerifyOrReturn( + CheckConstraintMaxValue("packetRxCount", [value unsignedLongLongValue], 18446744073709551615ULL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep4bReadPacketRxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_4() + CHIP_ERROR TestStep4bRebootTargetDevice_4() + { + + chip::app::Clusters::SystemCommands::Commands::Reboot::Type value; + return Reboot("alpha", value); + } + + CHIP_ERROR TestStep4cRebootTargetDeviceDUT_5() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message + = chip::Span("Please reboot the DUT and enter 'y' after DUT startsgarbage: not in length on purpose", 52); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } + + CHIP_ERROR TestWaitForTheCommissionedDeviceToBeRetrieved_6() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep4dUponANodeRebootPacketRxCountAttributeValueWillBeResetTo0_7() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -47365,7 +47361,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return UserPrompt("alpha", value); } - CHIP_ERROR TestStep5aReadPacketTxCountAttributeConstraints_5() + CHIP_ERROR TestStep5aReadPacketTxCountAttributeConstraints_8() { MTRBaseDevice * device = GetDevice("alpha"); @@ -47380,13 +47376,17 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("packetTxCount", "int64u", "int64u")); + VerifyOrReturn(CheckConstraintMinValue("packetTxCount", [value unsignedLongLongValue], 0ULL)); + VerifyOrReturn( + CheckConstraintMaxValue("packetTxCount", [value unsignedLongLongValue], 18446744073709551615ULL)); + NextTest(); }]; return CHIP_NO_ERROR; } - CHIP_ERROR TestStep5bReadPacketTxCountValueFromDutAndVerifyTheNumberOfPacketsReceivedOnEthernetNetworkInterface_6() + CHIP_ERROR TestStep5bReadPacketTxCountAttributeConstraintsUponANodeRebootTheValueWillBeResetTo0_9() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -47396,7 +47396,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return UserPrompt("alpha", value); } - CHIP_ERROR TestStep6aReadTxErrCountAttributeConstraints_7() + CHIP_ERROR TestStep6ReadTxErrCountAttributeConstraintsUponANodeRebootTheValueWillBeResetTo0_10() { MTRBaseDevice * device = GetDevice("alpha"); @@ -47406,10 +47406,16 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeTxErrCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 6a: Read TxErrCount attribute constraints Error: %@", err); + NSLog( + @"Step 6: Read TxErrCount attribute constraints, Upon a node reboot, the value will be reset to 0 Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("TxErrCount", actualValue, 0ULL)); + } + VerifyOrReturn(CheckConstraintType("txErrCount", "int64u", "int64u")); NextTest(); }]; @@ -47417,18 +47423,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestStep6bReadTxErrCountValueFromDutAndVerifyValueIndicatesTheNumberOfFailedPacketTransmissionOnEthernetNetworkInterface_8() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep7aReadCollisionCountAttributeConstraints_9() + CHIP_ERROR TestStep7ReadCollisionCountAttributeUponANodeRebootTheValueWillBeResetTo0_11() { MTRBaseDevice * device = GetDevice("alpha"); @@ -47438,10 +47433,15 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCollisionCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 7a: Read CollisionCount attribute constraints Error: %@", err); + NSLog(@"Step 7: Read CollisionCount attribute , Upon a node reboot, the value will be reset to 0 Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("CollisionCount", actualValue, 0ULL)); + } + VerifyOrReturn(CheckConstraintType("collisionCount", "int64u", "int64u")); NextTest(); }]; @@ -47449,18 +47449,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestStep7bReadCollisionCountValueFromDutAndVerifyValueIndicatesTheNumberOfCollisionOccurredWhileTransmittingPacketsOnEthernetNetworkInterface_10() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep8aReadOverrunCountAttributeConstraints_11() + CHIP_ERROR TestStep8ReadOverrunCountAttributeConstraints_12() { MTRBaseDevice * device = GetDevice("alpha"); @@ -47470,10 +47459,15 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeOverrunCountWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 8a: Read OverrunCount attribute constraints Error: %@", err); + NSLog(@"Step 8: Read OverrunCount attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + { + id actualValue = value; + VerifyOrReturn(CheckValue("OverrunCount", actualValue, 0ULL)); + } + VerifyOrReturn(CheckConstraintType("overrunCount", "int64u", "int64u")); NextTest(); }]; @@ -47481,18 +47475,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestStep8bReadOverrunCountValueFromDutAndVerifyValueIndicatesTheNumberOfPacketsDroppedDueToLackOfBufferMemoryOnEthernetNetworkInterface_12() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep9aReadCarrierDetectAttributeConstraints_13() + CHIP_ERROR TestStep9ReadCarrierDetectAttributeConstraints_13() { MTRBaseDevice * device = GetDevice("alpha"); @@ -47502,7 +47485,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeCarrierDetectWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 9a: Read CarrierDetect attribute constraints Error: %@", err); + NSLog(@"Step 9: Read CarrierDetect attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); @@ -47517,18 +47500,7 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR - TestStep9bReadCarrierDetectValueFromDutAndVerifyValueIndicatesThePresenceOfCarrierDetectControlSignalOnEthernetNetworkInterface_14() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } - - CHIP_ERROR TestStep10aReadTimeSinceResetAttributeConstraints_15() + CHIP_ERROR TestStep10ReadTimeSinceResetAttributeConstraints_14() { MTRBaseDevice * device = GetDevice("alpha"); @@ -47538,26 +47510,20 @@ class Test_TC_DGETH_2_1 : public TestCommandBridge { VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); [cluster readAttributeTimeSinceResetWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { - NSLog(@"Step 10a: Read TimeSinceReset attribute constraints Error: %@", err); + NSLog(@"Step 10: Read TimeSinceReset attribute constraints Error: %@", err); VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); VerifyOrReturn(CheckConstraintType("timeSinceReset", "int64u", "int64u")); + VerifyOrReturn(CheckConstraintMinValue("timeSinceReset", [value unsignedLongLongValue], 0ULL)); + VerifyOrReturn( + CheckConstraintMaxValue("timeSinceReset", [value unsignedLongLongValue], 18446744073709551615ULL)); + NextTest(); }]; return CHIP_NO_ERROR; } - - CHIP_ERROR TestStep10bReadTimeSinceResetValueFromDutAndVerifyTheValueIndicatesTheDurationOfTimeInMinutes_16() - { - - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); - } }; class Test_TC_DGETH_2_2 : public TestCommandBridge { @@ -53204,7 +53170,7 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 3 : Step 3: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as " "0x01a\n"); - if (ShouldSkip("GRPKEY.S.C01.Rsp")) { + if (ShouldSkip("GRPKEY.S.C01.Rsp && GRPKEY.S.C02.Tx")) { NextTest(); return; } @@ -53426,7 +53392,7 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { ChipLogProgress(chipTool, " ***** Test Step 26 : Step 18: TH sends KeySetRead command to GroupKeyManagement cluster with GroupKeySetID as " "0x01a\n"); - if (ShouldSkip("GRPKEY.S.C01.Rsp")) { + if (ShouldSkip("GRPKEY.S.C01.Rsp && GRPKEY.S.C02.Tx")) { NextTest(); return; } @@ -53465,42 +53431,42 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { break; case 30: ChipLogProgress(chipTool, - " ***** Test Step 30 : Step 23: TH again sends KeySetWrite command to DUT with any other GroupKeySetID not used " + " ***** Test Step 30 : Step 22: TH again sends KeySetWrite command to DUT with any other GroupKeySetID not used " "yet.\n"); if (ShouldSkip("GRPKEY.S.C00.Rsp && PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestStep23ThAgainSendsKeySetWriteCommandToDutWithAnyOtherGroupKeySetIDNotUsedYet_30(); + err = TestStep22ThAgainSendsKeySetWriteCommandToDutWithAnyOtherGroupKeySetIDNotUsedYet_30(); break; case 31: - ChipLogProgress(chipTool, " ***** Test Step 31 : Step 24: TH sends KeySetReadAllIndices command to DUT.\n"); - if (ShouldSkip("GRPKEY.S.C05.Rsp && PICS_SKIP_SAMPLE_APP")) { + ChipLogProgress(chipTool, " ***** Test Step 31 : Step 23: TH sends KeySetReadAllIndices command to DUT.\n"); + if (ShouldSkip("GRPKEY.S.C04.Rsp && GRPKEY.S.C05.Tx && PICS_SKIP_SAMPLE_APP")) { NextTest(); return; } - err = TestStep24ThSendsKeySetReadAllIndicesCommandToDut_31(); + err = TestStep23ThSendsKeySetReadAllIndicesCommandToDut_31(); break; case 32: ChipLogProgress(chipTool, - " ***** Test Step 32 : Step 22: TH removes the Group key set that was added by sending a KeySetRemove command to " + " ***** Test Step 32 : Step 24: TH removes the Group key set that was added by sending a KeySetRemove command to " "the GroupKeyManagement cluster with the GroupKeySetID field set to 0x0\n"); if (ShouldSkip("GRPKEY.S.C03.Rsp")) { NextTest(); return; } - err = TestStep22ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x0_32(); + err = TestStep24ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x0_32(); break; case 33: ChipLogProgress(chipTool, - " ***** Test Step 33 : Step 23: TH removes the Group key set that was added by sending a KeySetRemove command to " + " ***** Test Step 33 : Step 25: TH removes the Group key set that was added by sending a KeySetRemove command to " "the GroupKeyManagement cluster with the GroupKeySetID field set to 0x01b that does not exist in the GroupKeyMap " "attribute list.\n"); if (ShouldSkip("GRPKEY.S.C03.Rsp")) { NextTest(); return; } - err = TestStep23ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01bThatDoesNotExistInTheGroupKeyMapAttributeList_33(); + err = TestStep25ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01bThatDoesNotExistInTheGroupKeyMapAttributeList_33(); break; } @@ -54850,7 +54816,7 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { return UserPrompt("alpha", value); } - CHIP_ERROR TestStep23ThAgainSendsKeySetWriteCommandToDutWithAnyOtherGroupKeySetIDNotUsedYet_30() + CHIP_ERROR TestStep22ThAgainSendsKeySetWriteCommandToDutWithAnyOtherGroupKeySetIDNotUsedYet_30() { MTRBaseDevice * device = GetDevice("alpha"); @@ -54881,7 +54847,7 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { [cluster keySetWriteWithParams:params completion:^(NSError * _Nullable err) { - NSLog(@"Step 23: TH again sends KeySetWrite command to DUT with any other GroupKeySetID not used yet. " + NSLog(@"Step 22: TH again sends KeySetWrite command to DUT with any other GroupKeySetID not used yet. " @"Error: %@", err); @@ -54895,7 +54861,7 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep24ThSendsKeySetReadAllIndicesCommandToDut_31() + CHIP_ERROR TestStep23ThSendsKeySetReadAllIndicesCommandToDut_31() { chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; @@ -54906,7 +54872,7 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { } CHIP_ERROR - TestStep22ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x0_32() + TestStep24ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x0_32() { MTRBaseDevice * device = GetDevice("alpha"); @@ -54920,7 +54886,7 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { [cluster keySetRemoveWithParams:params completion:^(NSError * _Nullable err) { - NSLog(@"Step 22: TH removes the Group key set that was added by sending a KeySetRemove command to the " + NSLog(@"Step 24: TH removes the Group key set that was added by sending a KeySetRemove command to the " @"GroupKeyManagement cluster with the GroupKeySetID field set to 0x0 Error: %@", err); @@ -54935,7 +54901,7 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { } CHIP_ERROR - TestStep23ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01bThatDoesNotExistInTheGroupKeyMapAttributeList_33() + TestStep25ThRemovesTheGroupKeySetThatWasAddedBySendingAKeySetRemoveCommandToTheGroupKeyManagementClusterWithTheGroupKeySetIDFieldSetTo0x01bThatDoesNotExistInTheGroupKeyMapAttributeList_33() { MTRBaseDevice * device = GetDevice("alpha"); @@ -54949,7 +54915,7 @@ class Test_TC_GRPKEY_2_2 : public TestCommandBridge { [cluster keySetRemoveWithParams:params completion:^(NSError * _Nullable err) { - NSLog(@"Step 23: TH removes the Group key set that was added by sending a KeySetRemove command to the " + NSLog(@"Step 25: TH removes the Group key set that was added by sending a KeySetRemove command to the " @"GroupKeyManagement cluster with the GroupKeySetID field set to 0x01b that does not exist in " @"the GroupKeyMap attribute list. Error: %@", err); @@ -66328,7 +66294,7 @@ class Test_TC_LTIME_3_1 : public TestCommandBridge { break; case 2: ChipLogProgress(chipTool, " ***** Test Step 2 : Step 2: If (LTIME.S.A0000.12HR) TH writes 0 to HourFormat attribute\n"); - if (ShouldSkip("LTIME.S.A0000.12HR")) { + if (ShouldSkip("LTIME.S.M.12HR")) { NextTest(); return; } @@ -66344,7 +66310,7 @@ class Test_TC_LTIME_3_1 : public TestCommandBridge { break; case 4: ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4: If (LTIME.S.A0000.24HR) TH writes 1 to HourFormat attribute\n"); - if (ShouldSkip("LTIME.S.A0000.24HR")) { + if (ShouldSkip("LTIME.S.M.24HR")) { NextTest(); return; } @@ -77125,7 +77091,7 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { break; case 5: ChipLogProgress(chipTool, " ***** Test Step 5 : Step 3: TH reads the StartTime attribute from the DUT\n"); - if (ShouldSkip("MEDIAPLAYBACK.S.A0001 && PICS_USER_PROMPT")) { + if (ShouldSkip("MEDIAPLAYBACK.S.A0001")) { NextTest(); return; } @@ -77133,7 +77099,7 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { break; case 6: ChipLogProgress(chipTool, " ***** Test Step 6 : Step 4: TH reads the SeekRangeEnd attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0005")) { + if (ShouldSkip("MEDIAPLAYBACK.S.A0005")) { NextTest(); return; } @@ -77141,7 +77107,7 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { break; case 7: ChipLogProgress(chipTool, " ***** Test Step 7 : Step 5: TH reads the SeekRangeStart attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0006")) { + if (ShouldSkip("MEDIAPLAYBACK.S.A0006")) { NextTest(); return; } @@ -77149,7 +77115,7 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { break; case 8: ChipLogProgress(chipTool, " ***** Test Step 8 : Step 6: TH reads the Duration attribute from the DUT\n"); - if (ShouldSkip("PICS_USER_PROMPT && MEDIAPLAYBACK.S.A0002")) { + if (ShouldSkip("MEDIAPLAYBACK.S.A0002")) { NextTest(); return; } @@ -77337,41 +77303,103 @@ class Test_TC_MEDIAPLAYBACK_6_3 : public TestCommandBridge { CHIP_ERROR TestStep3ThReadsTheStartTimeAttributeFromTheDut_5() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeStartTimeWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads the StartTime attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("startTime", "epoch_us", "epoch_us")); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestStep4ThReadsTheSeekRangeEndAttributeFromTheDut_6() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSeekRangeEndWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4: TH reads the SeekRangeEnd attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("seekRangeEnd", "int64u", "int64u")); + VerifyOrReturn(CheckConstraintMinValue("seekRangeEnd", [value unsignedLongLongValue], 0ULL)); + VerifyOrReturn( + CheckConstraintMaxValue("seekRangeEnd", [value unsignedLongLongValue], 18446744073709551615ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestStep5ThReadsTheSeekRangeStartAttributeFromTheDut_7() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSeekRangeStartWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 5: TH reads the SeekRangeStart attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("seekRangeStart", "int64u", "int64u")); + VerifyOrReturn(CheckConstraintMinValue("seekRangeStart", [value unsignedLongLongValue], 0ULL)); + VerifyOrReturn( + CheckConstraintMaxValue("seekRangeStart", [value unsignedLongLongValue], 18446744073709551615ULL)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestStep6ThReadsTheDurationAttributeFromTheDut_8() { - chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; - value.message = chip::Span("Please enter 'y' for successgarbage: not in length on purpose", 28); - value.expectedValue.Emplace(); - value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); - return UserPrompt("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterMediaPlayback alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeDurationWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 6: TH reads the Duration attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + if (value != nil) { + + VerifyOrReturn(CheckConstraintType("duration", "int64u", "int64u")); + VerifyOrReturn(CheckConstraintMinValue("duration", [value unsignedLongLongValue], 0ULL)); + VerifyOrReturn( + CheckConstraintMaxValue("duration", [value unsignedLongLongValue], 18446744073709551615ULL)); + } + VerifyOrReturn(CheckConstraintNotValue("duration", value, 0ULL)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestStep7ThSendsASeekCommandToTheDutWithAPositionValueBeyondTheFurthestValidPositionExBeyondTheDurationOfTheMedia_9() @@ -97690,11 +97718,11 @@ class Test_TC_TCTL_1_1 : public TestCommandBridge { } }; -class Test_TC_TMP_1_1 : public TestCommandBridge { +class Test_TC_TCTL_2_2 : public TestCommandBridge { public: // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced - Test_TC_TMP_1_1() - : TestCommandBridge("Test_TC_TMP_1_1") + Test_TC_TCTL_2_2() + : TestCommandBridge("Test_TC_TCTL_2_2") , mTestIndex(0) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); @@ -97704,7 +97732,7 @@ class Test_TC_TMP_1_1 : public TestCommandBridge { } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) - ~Test_TC_TMP_1_1() {} + ~Test_TC_TCTL_2_2() {} /////////// TestCommand Interface ///////// void NextTest() override @@ -97712,11 +97740,11 @@ class Test_TC_TMP_1_1 : public TestCommandBridge { CHIP_ERROR err = CHIP_NO_ERROR; if (0 == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Start: Test_TC_TMP_1_1\n"); + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TCTL_2_2\n"); } if (mTestCount == mTestIndex) { - ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TMP_1_1\n"); + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TCTL_2_2\n"); SetCommandExitStatus(CHIP_NO_ERROR); return; } @@ -97733,53 +97761,429 @@ class Test_TC_TMP_1_1 : public TestCommandBridge { err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); break; case 1: - ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: Read ClusterRevision attribute from the DUT\n"); - err = TestStep2ReadClusterRevisionAttributeFromTheDut_1(); - break; - case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: Read FeatureMap attribute from the DUT\n"); - err = TestStep3ReadFeatureMapAttributeFromTheDut_2(); - break; - case 3: - ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4a: Read the global attribute: AttributeList\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the MinTemperature attribute\n"); + if (ShouldSkip("TCTL.S.A0001")) { NextTest(); return; } - err = TestStep4aReadTheGlobalAttributeAttributeList_3(); + err = TestStep2ThReadsFromTheDutTheMinTemperatureAttribute_1(); break; - case 4: - ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: Read the global attribute: AttributeList\n"); - if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the MaxTemperature attribute\n"); + if (ShouldSkip("TCTL.S.A0002")) { NextTest(); return; } - err = TestStep4aReadTheGlobalAttributeAttributeList_4(); + err = TestStep3ThReadsFromTheDutTheMaxTemperatureAttribute_2(); break; - case 5: - ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4b: Read the optional attribute(Tolerance) in AttributeList\n"); - if (ShouldSkip("TMP.S.A0003")) { + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4: TH reads from the DUT the TemperatureSetpoint attribute\n"); + if (ShouldSkip("TCTL.S.A0000")) { NextTest(); return; } - err = TestStep4bReadTheOptionalAttributeToleranceInAttributeList_5(); - break; - case 6: - ChipLogProgress(chipTool, " ***** Test Step 6 : Step 5: Read AcceptedCommandList attribute from the DUT\n"); - err = TestStep5ReadAcceptedCommandListAttributeFromTheDut_6(); - break; - case 7: - ChipLogProgress(chipTool, " ***** Test Step 7 : Step 6: Read GeneratedCommandList attribute from the DUT\n"); - err = TestStep6ReadGeneratedCommandListAttributeFromTheDut_7(); + err = TestStep4ThReadsFromTheDutTheTemperatureSetpointAttribute_3(); break; - case 8: - ChipLogProgress(chipTool, " ***** Test Step 8 : Step 7: Read EventList attribute from the DUT.\n"); - if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { - NextTest(); - return; - } - NextTest(); - return; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + NSNumber * _Nonnull MinTemperatureValue; + + CHIP_ERROR TestStep2ThReadsFromTheDutTheMinTemperatureAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMinTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads from the DUT the MinTemperature attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("minTemperature", "temperature", "temperature")); + { + MinTemperatureValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull MaxTemperatureValue; + + CHIP_ERROR TestStep3ThReadsFromTheDutTheMaxTemperatureAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeMaxTemperatureWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the MaxTemperature attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("maxTemperature", "temperature", "temperature")); + VerifyOrReturn(CheckConstraintMinValue("maxTemperature", [value shortValue], MinTemperatureValue)); + { + MaxTemperatureValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + NSNumber * _Nonnull temperatureValue; + + CHIP_ERROR TestStep4ThReadsFromTheDutTheTemperatureSetpointAttribute_3() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeTemperatureSetpointWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 4: TH reads from the DUT the TemperatureSetpoint attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintMinValue("temperatureSetpoint", [value shortValue], MinTemperatureValue)); + VerifyOrReturn(CheckConstraintMaxValue("temperatureSetpoint", [value shortValue], MaxTemperatureValue)); + { + temperatureValue = value; + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } +}; + +class Test_TC_TCTL_2_3 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TCTL_2_3() + : TestCommandBridge("Test_TC_TCTL_2_3") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TCTL_2_3() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TCTL_2_3\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TCTL_2_3\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress( + chipTool, " ***** Test Step 1 : Step 2: TH reads from the DUT the SelectedTemperatureLevel attribute\n"); + if (ShouldSkip("TCTL.S.A0004")) { + NextTest(); + return; + } + err = TestStep2ThReadsFromTheDutTheSelectedTemperatureLevelAttribute_1(); + break; + case 2: + ChipLogProgress( + chipTool, " ***** Test Step 2 : Step 3: TH reads from the DUT the SupportedTemperatureLevels attribute\n"); + if (ShouldSkip("TCTL.S.A0005")) { + NextTest(); + return; + } + err = TestStep3ThReadsFromTheDutTheSupportedTemperatureLevelsAttribute_2(); + break; + case 3: + ChipLogProgress(chipTool, + " ***** Test Step 3 : Verify that the DUT response contains a list of strings with each string length not " + "exceeding 16 characters.\n"); + if (ShouldSkip("PICS_USER_PROMPT && TCTL.S.A0005")) { + NextTest(); + return; + } + err = TestVerifyThatTheDutResponseContainsAListOfStringsWithEachStringLengthNotExceeding16Characters_3(); + break; + } + + if (CHIP_NO_ERROR != err) { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + + void OnStatusUpdate(const chip::app::StatusIB & status) override + { + switch (mTestIndex - 1) { + case 0: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 1: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 2: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + case 3: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + break; + } + + // Go on to the next test. + ContinueOnChipMainThread(CHIP_NO_ERROR); + } + + chip::System::Clock::Timeout GetWaitDuration() const override + { + return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds)); + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 4; + + chip::Optional mNodeId; + chip::Optional mCluster; + chip::Optional mEndpoint; + chip::Optional mTimeout; + + CHIP_ERROR TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0() + { + + chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; + value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; + return WaitForCommissionee("alpha", value); + } + + CHIP_ERROR TestStep2ThReadsFromTheDutTheSelectedTemperatureLevelAttribute_1() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSelectedTemperatureLevelWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 2: TH reads from the DUT the SelectedTemperatureLevel attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("selectedTemperatureLevel", "int8u", "int8u")); + VerifyOrReturn(CheckConstraintMinValue("selectedTemperatureLevel", [value unsignedCharValue], 0U)); + VerifyOrReturn(CheckConstraintMaxValue("selectedTemperatureLevel", [value unsignedCharValue], 31U)); + + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestStep3ThReadsFromTheDutTheSupportedTemperatureLevelsAttribute_2() + { + + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterTemperatureControl alloc] initWithDevice:device + endpointID:@(1) + queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeSupportedTemperatureLevelsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable err) { + NSLog(@"Step 3: TH reads from the DUT the SupportedTemperatureLevels attribute Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + VerifyOrReturn(CheckConstraintType("supportedTemperatureLevels", "list", "list")); + VerifyOrReturn(CheckConstraintMaxLength("supportedTemperatureLevels", value, 32)); + NextTest(); + }]; + + return CHIP_NO_ERROR; + } + + CHIP_ERROR TestVerifyThatTheDutResponseContainsAListOfStringsWithEachStringLengthNotExceeding16Characters_3() + { + + chip::app::Clusters::LogCommands::Commands::UserPrompt::Type value; + value.message = chip::Span("Please enter 'y' after successgarbage: not in length on purpose", 30); + value.expectedValue.Emplace(); + value.expectedValue.Value() = chip::Span("ygarbage: not in length on purpose", 1); + return UserPrompt("alpha", value); + } +}; + +class Test_TC_TMP_1_1 : public TestCommandBridge { +public: + // NOLINTBEGIN(clang-analyzer-nullability.NullPassedToNonnull): Test constructor nullability not enforced + Test_TC_TMP_1_1() + : TestCommandBridge("Test_TC_TMP_1_1") + , mTestIndex(0) + { + AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); + AddArgument("cluster", &mCluster); + AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("timeout", 0, UINT16_MAX, &mTimeout); + } + // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) + + ~Test_TC_TMP_1_1() {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_TMP_1_1\n"); + } + + if (mTestCount == mTestIndex) { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_TMP_1_1\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) { + case 0: + ChipLogProgress(chipTool, " ***** Test Step 0 : Step 1: Wait for the commissioned device to be retrieved\n"); + err = TestStep1WaitForTheCommissionedDeviceToBeRetrieved_0(); + break; + case 1: + ChipLogProgress(chipTool, " ***** Test Step 1 : Step 2: Read ClusterRevision attribute from the DUT\n"); + err = TestStep2ReadClusterRevisionAttributeFromTheDut_1(); + break; + case 2: + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 3: Read FeatureMap attribute from the DUT\n"); + err = TestStep3ReadFeatureMapAttributeFromTheDut_2(); + break; + case 3: + ChipLogProgress(chipTool, " ***** Test Step 3 : Step 4a: Read the global attribute: AttributeList\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aReadTheGlobalAttributeAttributeList_3(); + break; + case 4: + ChipLogProgress(chipTool, " ***** Test Step 4 : Step 4a: Read the global attribute: AttributeList\n"); + if (ShouldSkip("!PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + err = TestStep4aReadTheGlobalAttributeAttributeList_4(); + break; + case 5: + ChipLogProgress(chipTool, " ***** Test Step 5 : Step 4b: Read the optional attribute(Tolerance) in AttributeList\n"); + if (ShouldSkip("TMP.S.A0003")) { + NextTest(); + return; + } + err = TestStep4bReadTheOptionalAttributeToleranceInAttributeList_5(); + break; + case 6: + ChipLogProgress(chipTool, " ***** Test Step 6 : Step 5: Read AcceptedCommandList attribute from the DUT\n"); + err = TestStep5ReadAcceptedCommandListAttributeFromTheDut_6(); + break; + case 7: + ChipLogProgress(chipTool, " ***** Test Step 7 : Step 6: Read GeneratedCommandList attribute from the DUT\n"); + err = TestStep6ReadGeneratedCommandListAttributeFromTheDut_7(); + break; + case 8: + ChipLogProgress(chipTool, " ***** Test Step 8 : Step 7: Read EventList attribute from the DUT.\n"); + if (ShouldSkip("PICS_EVENT_LIST_ENABLED")) { + NextTest(); + return; + } + NextTest(); + return; } if (CHIP_NO_ERROR != err) { @@ -109475,6 +109879,11 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("Step1bWaitTime", 0, UINT16_MAX, &mStep1bWaitTime); + AddArgument("Step2bWaitTime", 0, UINT16_MAX, &mStep2bWaitTime); + AddArgument("Step2eWaitTime", 0, UINT16_MAX, &mStep2eWaitTime); + AddArgument("Step4bWaitTime", 0, UINT16_MAX, &mStep4bWaitTime); + AddArgument("Step5aWaitTime", 0, UINT16_MAX, &mStep5aWaitTime); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) @@ -109517,8 +109926,8 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { err = TestStep1aThSendsDownOrCloseCommandToPrepositionTheDutInTheOppositeDirection_1(); break; case 2: - ChipLogProgress(chipTool, " ***** Test Step 2 : Step 1b: TH Waits for 10 seconds movement(s) on the device\n"); - err = TestStep1bThWaitsFor10SecondsMovementsOnTheDevice_2(); + ChipLogProgress(chipTool, " ***** Test Step 2 : Step 1b: TH Waits for 5 - 15 seconds movement(s) on the device\n"); + err = TestStep1bThWaitsFor515SecondsMovementsOnTheDevice_2(); break; case 3: ChipLogProgress(chipTool, @@ -109587,8 +109996,8 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { err = TestStep2dIfPaTlThReadsTargetPositionTiltPercent100thsAttributeFromDut_10(); break; case 11: - ChipLogProgress(chipTool, " ***** Test Step 11 : Step 2e: TH leave the device moving for 2 seconds\n"); - err = TestStep2eThLeaveTheDeviceMovingFor2Seconds_11(); + ChipLogProgress(chipTool, " ***** Test Step 11 : Step 2e: TH leave the device moving for 1-5 seconds\n"); + err = TestStep2eThLeaveTheDeviceMovingFor15Seconds_11(); break; case 12: ChipLogProgress(chipTool, " ***** Test Step 12 : Step 3a1: TH reads OperationalStatus attribute's bit 0..1\n"); @@ -109844,6 +110253,11 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mStep1bWaitTime; + chip::Optional mStep2bWaitTime; + chip::Optional mStep2eWaitTime; + chip::Optional mStep4bWaitTime; + chip::Optional mStep5aWaitTime; chip::Optional mTimeout; CHIP_ERROR TestStep0WaitForTheCommissionedDeviceToBeRetrieved_0() @@ -109872,11 +110286,11 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep1bThWaitsFor10SecondsMovementsOnTheDevice_2() + CHIP_ERROR TestStep1bThWaitsFor515SecondsMovementsOnTheDevice_2() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; + value.ms = mStep1bWaitTime.HasValue() ? mStep1bWaitTime.Value() : 10000UL; return WaitForMs("alpha", value); } @@ -110012,7 +110426,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; + value.ms = mStep2bWaitTime.HasValue() ? mStep2bWaitTime.Value() : 500UL; return WaitForMs("alpha", value); } @@ -110064,11 +110478,11 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestStep2eThLeaveTheDeviceMovingFor2Seconds_11() + CHIP_ERROR TestStep2eThLeaveTheDeviceMovingFor15Seconds_11() { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 2000UL; + value.ms = mStep2eWaitTime.HasValue() ? mStep2eWaitTime.Value() : 1000UL; return WaitForMs("alpha", value); } NSNumber * _Nonnull OperationalStatusValue; @@ -110355,7 +110769,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 3000UL; + value.ms = mStep4bWaitTime.HasValue() ? mStep4bWaitTime.Value() : 1000UL; return WaitForMs("alpha", value); } @@ -110386,7 +110800,7 @@ class Test_TC_WNCV_3_1 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 1000UL; + value.ms = mStep5aWaitTime.HasValue() ? mStep5aWaitTime.Value() : 500UL; return WaitForMs("alpha", value); } @@ -110455,6 +110869,11 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); + AddArgument("Step1bWaitTime", 0, UINT16_MAX, &mStep1bWaitTime); + AddArgument("Step2bWaitTime", 0, UINT16_MAX, &mStep2bWaitTime); + AddArgument("Step2eWaitTime", 0, UINT16_MAX, &mStep2eWaitTime); + AddArgument("Step4bWaitTime", 0, UINT16_MAX, &mStep4bWaitTime); + AddArgument("Step5aWaitTime", 0, UINT16_MAX, &mStep5aWaitTime); AddArgument("timeout", 0, UINT16_MAX, &mTimeout); } // NOLINTEND(clang-analyzer-nullability.NullPassedToNonnull) @@ -110824,6 +111243,11 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { chip::Optional mNodeId; chip::Optional mCluster; chip::Optional mEndpoint; + chip::Optional mStep1bWaitTime; + chip::Optional mStep2bWaitTime; + chip::Optional mStep2eWaitTime; + chip::Optional mStep4bWaitTime; + chip::Optional mStep5aWaitTime; chip::Optional mTimeout; CHIP_ERROR TestStep0WaitForTheCommissionedDeviceToBeRetrieved_0() @@ -110856,7 +111280,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10000UL; + value.ms = mStep1bWaitTime.HasValue() ? mStep1bWaitTime.Value() : 10000UL; return WaitForMs("alpha", value); } @@ -110992,7 +111416,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 100UL; + value.ms = mStep2bWaitTime.HasValue() ? mStep2bWaitTime.Value() : 500UL; return WaitForMs("alpha", value); } @@ -111048,7 +111472,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 2000UL; + value.ms = mStep2eWaitTime.HasValue() ? mStep2eWaitTime.Value() : 1000UL; return WaitForMs("alpha", value); } NSNumber * _Nonnull OperationalStatusValue; @@ -111335,7 +111759,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 3000UL; + value.ms = mStep4bWaitTime.HasValue() ? mStep4bWaitTime.Value() : 1000UL; return WaitForMs("alpha", value); } @@ -111366,7 +111790,7 @@ class Test_TC_WNCV_3_2 : public TestCommandBridge { { chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 1000UL; + value.ms = mStep5aWaitTime.HasValue() ? mStep5aWaitTime.Value() : 500UL; return WaitForMs("alpha", value); } @@ -179858,6 +180282,8 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(), From 2ce5864f652eed2824eceb2121a107efc7254d96 Mon Sep 17 00:00:00 2001 From: srningap <107042150+srningap@users.noreply.github.com> Date: Thu, 14 Sep 2023 19:10:47 +0530 Subject: [PATCH 095/134] [Silabs] updated GNI for B0 2.0 board (#29055) * Updated gni for B0 2.0 common flash * updated matter_support * moved board defines to SiWx917_sdk.gni --- third_party/silabs/SiWx917_sdk.gni | 26 +++++++++++++++++--------- third_party/silabs/matter_support | 2 +- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index a3164a636bef0d..79fbf8516347c6 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -25,6 +25,12 @@ import("silabs_board.gni") declare_args() { wifi_sdk_root = "${chip_root}/third_party/silabs/wifi_sdk" examples_plat_dir = "${chip_root}/examples/platform/silabs/SiWx917" + + if (silabs_board == "BRD4338A") { + sdk_support_board = "BRD4338A" + } else { + sdk_support_board = "BRD4325x" + } } # Defines an siwx917 SDK build target. @@ -46,13 +52,13 @@ template("siwx917_sdk") { _include_dirs = [ "${chip_root}", "${chip_root}/examples/platform/silabs/SiWx917/SiWx917", - "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/support/hal", + "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal", "${efr32_sdk_root}/platform/emdrv/nvm3/inc", "${efr32_sdk_root}/platform/emdrv/common/inc", "${efr32_sdk_root}/platform/service/device_init/inc", "${sdk_support_root}/matter/mbedtls/tinycrypt/inc", - "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/autogen", - "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/config", + "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/autogen", + "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/config", "${chip_root}/third_party/mbedtls/repo/include", "${chip_root}/third_party/mbedtls/repo/library", @@ -67,6 +73,7 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/si91x/sl_net/inc", # siwx917_soc component + "${wifi_sdk_root}/components/siwx917_soc/core/config", "${wifi_sdk_root}/components/siwx917_soc/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/config", @@ -106,7 +113,7 @@ template("siwx917_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/include", "${wifi_sdk_root}/components/protocol/wifi/si91x", "${efr32_sdk_root}/util/third_party/freertos/kernel/portable/GCC/ARM_CM4F", - "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/support/inc", + "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/inc", ] # Note that we're setting the mbedTLS and PSA configuration files through a @@ -322,6 +329,7 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/siwx917_soc/boards/brd4325x/src/rsi_board.c", "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/rsi_deepsleep_soc.c", "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/system_si91x.c", + "${wifi_sdk_root}/components/siwx917_soc/core/config/src/rsi_nvic_priorities_config.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/UDMA.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/USART.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/ipmu/ipmu_apis.c", @@ -361,9 +369,9 @@ template("siwx917_sdk") { "${efr32_sdk_root}/util/third_party/freertos/kernel/stream_buffer.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/tasks.c", "${efr32_sdk_root}/util/third_party/freertos/kernel/timers.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/autogen/sl_event_handler.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/support/hal/rsi_hal_mcu_m4.c", - "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/support/hal/rsi_hal_mcu_platform_init.c", + "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/autogen/sl_event_handler.c", + "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal/rsi_hal_mcu_m4.c", + "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal/rsi_hal_mcu_platform_init.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_nvm3_hal_flash.c", # mbedtls @@ -406,14 +414,14 @@ template("siwx917_sdk") { # nvm3 ans startup if (silabs_board == "BRD4325B") { sources += [ - "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/support/src/startup_RS1xxxx.c", + "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_RS1xxxx.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_dual_flash_intf.c", ] } if (wifi_soc_common_flash) { sources += [ - "${sdk_support_root}/matter/si91x/siwx917/BRD4325x/support/src/startup_common_RS1xxxx.c", + "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_common_RS1xxxx.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_common_flash_intf.c", ] } diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index 130270901b4d37..32535c94e815b6 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit 130270901b4d377950a47b1ceddde300d9eea981 +Subproject commit 32535c94e815b60b9efd594abc20372850526c0b From 3a4b9fa2c9f143a9fb051d6300e160414265df92 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Thu, 14 Sep 2023 15:03:18 +0100 Subject: [PATCH 096/134] [clang-tidy] Fix a bunch of stylie warnings (#29242) NULL -> nullptr, else after return --- src/inet/IPAddress.cpp | 2 +- src/inet/InetInterface.cpp | 21 ++++++++------------- src/inet/UDPEndPointImplLwIP.cpp | 19 +++++-------------- src/lib/support/ErrorStr.cpp | 2 +- src/system/SystemError.cpp | 13 +++++-------- 5 files changed, 20 insertions(+), 37 deletions(-) diff --git a/src/inet/IPAddress.cpp b/src/inet/IPAddress.cpp index 66ff7486846a7d..0fc8cd9d2284a9 100644 --- a/src/inet/IPAddress.cpp +++ b/src/inet/IPAddress.cpp @@ -108,7 +108,7 @@ ip4_addr_t IPAddress::ToIPv4() const #endif // INET_CONFIG_ENABLE_IPV4 -ip_addr_t IPAddress::ToLwIPAddr(void) const +ip_addr_t IPAddress::ToLwIPAddr() const { ip_addr_t ret; diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp index 8560dd605346ae..3bc54093ff7d94 100644 --- a/src/inet/InetInterface.cpp +++ b/src/inet/InetInterface.cpp @@ -216,7 +216,7 @@ bool InterfaceIterator::Next() #if defined(NETIF_FOREACH) NETIF_FOREACH(mCurNetif) #else - for (mCurNetif = netif_list; mCurNetif != NULL; mCurNetif = mCurNetif->next) + for (mCurNetif = netif_list; mCurNetif != nullptr; mCurNetif = mCurNetif->next) #endif { if (mCurNetif == prevNetif) @@ -229,7 +229,7 @@ bool InterfaceIterator::Next() // Unlock LwIP stack UNLOCK_TCPIP_CORE(); - return mCurNetif != NULL; + return mCurNetif != nullptr; } CHIP_ERROR InterfaceIterator::GetInterfaceName(char * nameBuf, size_t nameBufSize) @@ -322,13 +322,11 @@ CHIP_ERROR InterfaceAddressIterator::GetAddress(IPAddress & outIPAddress) return CHIP_NO_ERROR; } #if INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 - else - { - outIPAddress = IPAddress(*netif_ip4_addr(curIntf)); - return CHIP_NO_ERROR; - } -#endif // INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 + outIPAddress = IPAddress(*netif_ip4_addr(curIntf)); + return CHIP_NO_ERROR; +#else return CHIP_ERROR_INTERNAL; +#endif // INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 } uint8_t InterfaceAddressIterator::GetPrefixLength() @@ -340,11 +338,8 @@ uint8_t InterfaceAddressIterator::GetPrefixLength() return 64; } #if INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 - else - { - struct netif * curIntf = mIntfIter.GetInterfaceId().GetPlatformInterface(); - return NetmaskToPrefixLength((const uint8_t *) netif_ip4_netmask(curIntf), 4); - } + struct netif * curIntf = mIntfIter.GetInterfaceId().GetPlatformInterface(); + return NetmaskToPrefixLength((const uint8_t *) netif_ip4_netmask(curIntf), 4); #endif // INET_CONFIG_ENABLE_IPV4 && LWIP_IPV4 } return 0; diff --git a/src/inet/UDPEndPointImplLwIP.cpp b/src/inet/UDPEndPointImplLwIP.cpp index f808bf5ed9bb1c..5078d750a05059 100755 --- a/src/inet/UDPEndPointImplLwIP.cpp +++ b/src/inet/UDPEndPointImplLwIP.cpp @@ -195,10 +195,7 @@ CHIP_ERROR UDPEndPointImplLwIP::SendMsgImpl(const IPPacketInfo * pktInfo, System return udp_sendto_if(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort, intfId.GetPlatformInterface()); } - else - { - return udp_sendto(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort); - } + return udp_sendto(mUDP, System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(msg), &lwipDestAddr, destPort); }); ip_addr_copy(mUDP->local_ip, boundAddr); @@ -461,11 +458,8 @@ CHIP_ERROR UDPEndPointImplLwIP::IPv4JoinLeaveMulticastGroupImpl(InterfaceId aInt return join ? igmp_joingroup_netif(lNetif, &lIPv4Address) // : igmp_leavegroup_netif(lNetif, &lIPv4Address); } - else - { - return join ? igmp_joingroup(IP4_ADDR_ANY4, &lIPv4Address) // - : igmp_leavegroup(IP4_ADDR_ANY4, &lIPv4Address); - } + return join ? igmp_joingroup(IP4_ADDR_ANY4, &lIPv4Address) // + : igmp_leavegroup(IP4_ADDR_ANY4, &lIPv4Address); }); if (lStatus == ERR_MEM) @@ -496,11 +490,8 @@ CHIP_ERROR UDPEndPointImplLwIP::IPv6JoinLeaveMulticastGroupImpl(InterfaceId aInt return join ? mld6_joingroup_netif(lNetif, &lIPv6Address) // : mld6_leavegroup_netif(lNetif, &lIPv6Address); } - else - { - return join ? mld6_joingroup(IP6_ADDR_ANY6, &lIPv6Address) // - : mld6_leavegroup(IP6_ADDR_ANY6, &lIPv6Address); - } + return join ? mld6_joingroup(IP6_ADDR_ANY6, &lIPv6Address) // + : mld6_leavegroup(IP6_ADDR_ANY6, &lIPv6Address); }); if (lStatus == ERR_MEM) diff --git a/src/lib/support/ErrorStr.cpp b/src/lib/support/ErrorStr.cpp index 440bc001c213bc..6caf319c5e6b6a 100644 --- a/src/lib/support/ErrorStr.cpp +++ b/src/lib/support/ErrorStr.cpp @@ -167,7 +167,7 @@ DLL_EXPORT void FormatError(char * buf, uint16_t bufSize, const char * subsys, C { #if CHIP_CONFIG_SHORT_ERROR_STR - if (subsys == NULL) + if (subsys == nullptr) { (void) snprintf(buf, bufSize, "Error " CHIP_CONFIG_SHORT_FORM_ERROR_VALUE_FORMAT, err.AsInteger()); } diff --git a/src/system/SystemError.cpp b/src/system/SystemError.cpp index 356c697e15c996..2a5680168a3194 100644 --- a/src/system/SystemError.cpp +++ b/src/system/SystemError.cpp @@ -108,7 +108,7 @@ bool FormatPOSIXError(char * buf, uint16_t bufSize, CHIP_ERROR err) { const char * desc = #if CHIP_CONFIG_SHORT_ERROR_STR - NULL; + nullptr; #else DescribeErrorPOSIX(err); #endif @@ -178,9 +178,9 @@ DLL_EXPORT const char * DescribeErrorLwIP(CHIP_ERROR aError) /** * Register a text error formatter for LwIP errors. */ -void RegisterLwIPErrorFormatter(void) +void RegisterLwIPErrorFormatter() { - static ErrorFormatter sLwIPErrorFormatter = { FormatLwIPError, NULL }; + static ErrorFormatter sLwIPErrorFormatter = { FormatLwIPError, nullptr }; RegisterErrorFormatter(&sLwIPErrorFormatter); } @@ -203,17 +203,14 @@ bool FormatLwIPError(char * buf, uint16_t bufSize, CHIP_ERROR err) { const char * desc = #if CHIP_CONFIG_SHORT_ERROR_STR - NULL; + nullptr; #else DescribeErrorLwIP(err); #endif chip::FormatError(buf, bufSize, "LwIP", err, desc); return true; } - else - { - return false; - } + return false; } #endif // CHIP_SYSTEM_CONFIG_USE_LWIP From aa688c49ff823393184d8e17287267e9d146d1d6 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 10:06:55 -0400 Subject: [PATCH 097/134] Ensure CHIP_EXCHANGE_HOLDER_DETAIL_LOGGING is always defined. (#29228) Possibly as 0. --- src/messaging/ExchangeHolder.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/messaging/ExchangeHolder.h b/src/messaging/ExchangeHolder.h index 379a836f6a5e90..50a90f42b99ba3 100644 --- a/src/messaging/ExchangeHolder.h +++ b/src/messaging/ExchangeHolder.h @@ -20,6 +20,10 @@ #include #include +#ifndef CHIP_EXCHANGE_HOLDER_DETAIL_LOGGING +#define CHIP_EXCHANGE_HOLDER_DETAIL_LOGGING 0 +#endif // CHIP_EXCHANGE_HOLDER_DETAIL_LOGGING + namespace chip { namespace Messaging { From 669dff492f5d848c4d153e7bd915575328eb0b69 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 10:08:01 -0400 Subject: [PATCH 098/134] Fix -Wundef issues in Linux example code. (#29227) * Make sure to include CHIPDeviceConfig.h in Options.h, because it's testing some config vars that device config defines. * Ensure the CHIP_APP_MAIN_HAS_*_DRIVER macros are always defined to a value. --- examples/platform/linux/AppMain.cpp | 12 ++++++++++++ examples/platform/linux/Options.h | 1 + 2 files changed, 13 insertions(+) diff --git a/examples/platform/linux/AppMain.cpp b/examples/platform/linux/AppMain.cpp index 84bb1135b99089..56e6edd44687f2 100644 --- a/examples/platform/linux/AppMain.cpp +++ b/examples/platform/linux/AppMain.cpp @@ -137,6 +137,18 @@ DeviceLayer::NetworkCommissioning::DarwinWiFiDriver sWiFiDriver; DeviceLayer::NetworkCommissioning::DarwinEthernetDriver sEthernetDriver; #endif // CHIP_DEVICE_LAYER_TARGET_DARWIN +#ifndef CHIP_APP_MAIN_HAS_THREAD_DRIVER +#define CHIP_APP_MAIN_HAS_THREAD_DRIVER 0 +#endif // CHIP_APP_MAIN_HAS_THREAD_DRIVER + +#ifndef CHIP_APP_MAIN_HAS_WIFI_DRIVER +#define CHIP_APP_MAIN_HAS_WIFI_DRIVER 0 +#endif // CHIP_APP_MAIN_HAS_WIFI_DRIVER + +#ifndef CHIP_APP_MAIN_HAS_ETHERNET_DRIVER +#define CHIP_APP_MAIN_HAS_ETHERNET_DRIVER 0 +#endif // CHIP_APP_MAIN_HAS_ETHERNET_DRIVER + #if CHIP_APP_MAIN_HAS_THREAD_DRIVER app::Clusters::NetworkCommissioning::Instance sThreadNetworkCommissioningInstance(kRootEndpointId, &sThreadDriver); #endif // CHIP_APP_MAIN_HAS_THREAD_DRIVER diff --git a/examples/platform/linux/Options.h b/examples/platform/linux/Options.h index b03da07cb5b929..8a080680cefbcf 100644 --- a/examples/platform/linux/Options.h +++ b/examples/platform/linux/Options.h @@ -32,6 +32,7 @@ #include #include #include +#include #include #include From 2e9ba6c350c92d5d14736053dfee4dcbb5924890 Mon Sep 17 00:00:00 2001 From: wyhong <30567533+wy-hh@users.noreply.github.com> Date: Thu, 14 Sep 2023 22:09:14 +0800 Subject: [PATCH 099/134] [Bouffalolab] Add more build options and add zap & matter file for ethernet (#28982) * update build options * fix compile error * add ethernet.zap & ethernet.matter for bl706 ethernet device * update frame pointer for backtrack debug * fix restyle * fix error on lighting-app-ethernet.matter * update zap & matter files and add check before memcpy * fix restyle * updates according review comments * add one more room for mScanSSID * add comments * put default connectivity for each chip at one place * fix compile error and lint code * remove duplicate settings for ethernet and wifi connectivities * fix lint code to remove trail whitespace --- .github/workflows/examples-bouffalolab.yaml | 12 +- .../lighting-app/bouffalolab/bl602/BUILD.gn | 79 +- .../bouffalolab/bl602/CHIPProjectConfig.h | 2 - .../bouffalolab/bl602/{board.h => mboard.h} | 2 +- .../lighting-app/bouffalolab/bl702/BUILD.gn | 162 +- .../bouffalolab/bl702/{board.h => mboard.h} | 0 .../lighting-app/bouffalolab/bl702l/BUILD.gn | 152 +- .../bouffalolab/bl702l/{board.h => mboard.h} | 0 .../bouffalolab/common/AppTask.cpp | 32 +- .../lighting-app/bouffalolab/common/AppTask.h | 9 +- .../data_model/lighting-app-ethernet.matter | 1964 ++++ .../data_model/lighting-app-ethernet.zap | 8384 +++++++++++++++++ .../data_model/lighting-app-thread.matter | 103 - .../data_model/lighting-app-thread.zap | 6 +- .../data_model/lighting-app-wifi.matter | 103 - .../data_model/lighting-app-wifi.zap | 6 +- .../bl602/flash_config/factory_data.dts | 361 - .../bl602/flash_config/partition_cfg_2M.toml | 107 - .../bl702/ldscripts/psram_flash.ld | 18 + .../bl702l/ldscripts/psram_flash_rom.ld | 2 - .../common/{plat => iot_sdk}/aos_task.c | 0 .../common/{plat => iot_sdk}/demo_pwm.c | 14 +- .../common/iot_sdk/platform_port.c | 405 + .../common/{plat => iot_sdk}/uart.c | 41 +- .../bouffalolab/common/iot_sdk/uart.h | 37 + .../bouffalolab/common/plat/LEDWidget.cpp | 50 +- .../bouffalolab/common/plat/LEDWidget.h | 21 +- .../bouffalolab/common/plat/demo_pwm.h | 9 +- .../platform/bouffalolab/common/plat/main.cpp | 400 +- .../platform/bouffalolab/common/plat/plat.h | 6 + .../bouffalolab/common/plat/platform.cpp | 40 +- .../common/route_hook/bl_route_hook.c | 20 +- integrations/cloudbuild/build-all.yaml | 2 +- scripts/build/build/targets.py | 16 +- scripts/build/builders/bouffalolab.py | 126 +- .../build/testdata/all_targets_linux_x64.txt | 2 +- src/lib/shell/streamer_bouffalolab.cpp | 21 +- src/lwip/BUILD.gn | 2 - .../BL602/DiagnosticDataProviderImpl.cpp | 10 +- .../BL602/NetworkCommissioningDriver.cpp | 191 +- .../BL602/NetworkCommissioningDriver.h | 11 +- .../bouffalolab/BL602/PlatformManagerImpl.cpp | 81 +- src/platform/bouffalolab/BL602/args.gni | 2 - .../bouffalolab/BL602/lwip_default_hooks.h | 17 - .../bouffalolab/BL602/wifi_mgmr_portable.c | 23 +- .../bouffalolab/BL602/wifi_mgmr_portable.h | 4 + src/platform/bouffalolab/BL702/BUILD.gn | 15 +- .../BL702/ConfigurationManagerImpl.cpp | 14 +- .../BL702/ConnectivityManagerImpl.cpp | 40 +- .../BL702/DiagnosticDataProviderImpl.cpp | 32 +- .../bouffalolab/BL702/EthernetInterface.c | 25 +- .../bouffalolab/BL702/EthernetInterface.h | 2 + .../BL702/NetworkCommissioningDriver.cpp | 164 +- .../BL702/NetworkCommissioningDriver.h | 19 +- .../bouffalolab/BL702/PlatformManagerImpl.cpp | 31 +- src/platform/bouffalolab/BL702/args.gni | 4 +- .../BL702/bl702-openthread-core-bl-config.h | 7 +- .../bouffalolab/BL702/lwip_default_hooks.h | 17 - .../{WiFiInterface.c => wifi_mgmr_portable.c} | 96 +- .../{WiFiInterface.h => wifi_mgmr_portable.h} | 10 +- .../BL702L/PlatformManagerImpl.cpp | 3 - src/platform/bouffalolab/BL702L/args.gni | 3 +- .../BL702L/bl702l-openthread-core-bl-config.h | 4 +- .../bouffalolab/common/BLEManagerImpl.cpp | 4 +- .../common/CHIPDevicePlatformEvent.h | 8 + .../bouffalolab/common/CHIPPlatformConfig.h | 8 +- .../common/ConfigurationManagerImpl.cpp | 7 +- .../common/ConfigurationManagerImpl.h | 2 +- .../common/ConnectivityManagerImpl.cpp | 15 +- .../common/ConnectivityManagerImpl.h | 21 +- src/platform/bouffalolab/common/Logging.cpp | 46 + .../common/OTAImageProcessorImpl.cpp | 8 +- .../common/PlatformManagerImpl.cpp | 16 + .../bouffalolab/common/PlatformManagerImpl.h | 10 +- .../bouffalolab/common/SystemPlatformConfig.h | 3 + src/platform/bouffalolab/common/args.gni | 2 + src/platform/device.gni | 15 +- third_party/bouffalolab/bl602/bl_iot_sdk.gni | 33 +- third_party/bouffalolab/bl702/bl_iot_sdk.gni | 50 +- third_party/bouffalolab/bl702l/bl_iot_sdk.gni | 18 +- .../common/bouffalolab_executable.gni | 16 +- third_party/bouffalolab/common/rsicv.gni | 4 + 82 files changed, 11984 insertions(+), 1843 deletions(-) rename examples/lighting-app/bouffalolab/bl602/{board.h => mboard.h} (95%) rename examples/lighting-app/bouffalolab/bl702/{board.h => mboard.h} (100%) rename examples/lighting-app/bouffalolab/bl702l/{board.h => mboard.h} (100%) create mode 100644 examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter create mode 100644 examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap delete mode 100644 examples/platform/bouffalolab/bl602/flash_config/factory_data.dts delete mode 100644 examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml rename examples/platform/bouffalolab/common/{plat => iot_sdk}/aos_task.c (100%) rename examples/platform/bouffalolab/common/{plat => iot_sdk}/demo_pwm.c (94%) create mode 100644 examples/platform/bouffalolab/common/iot_sdk/platform_port.c rename examples/platform/bouffalolab/common/{plat => iot_sdk}/uart.c (79%) create mode 100644 examples/platform/bouffalolab/common/iot_sdk/uart.h delete mode 100644 src/platform/bouffalolab/BL602/lwip_default_hooks.h delete mode 100644 src/platform/bouffalolab/BL702/lwip_default_hooks.h rename src/platform/bouffalolab/BL702/{WiFiInterface.c => wifi_mgmr_portable.c} (57%) rename src/platform/bouffalolab/BL702/{WiFiInterface.h => wifi_mgmr_portable.h} (83%) diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 89ce34049850a6..86861abbf6d950 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -78,8 +78,8 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --target bouffalolab-bl706-night-light-light \ - --target bouffalolab-bl706-eth-light \ - --target bouffalolab-bl706-wifi-light \ + --target bouffalolab-bl706dk-light-ethernet \ + --target bouffalolab-bl706dk-light-wifi-fp \ --target bouffalolab-xt-zb6-devkit-light-115200-rpc \ build \ --copy-artifacts-to out/artifacts \ @@ -92,11 +92,11 @@ jobs: /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ bl702 bl706-eth lighting-app \ - out/artifacts/bouffalolab-bl706-eth-light/chip-bl702-lighting-example.out \ + out/artifacts/bouffalolab-bl706dk-light-ethernet/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ bl702 bl706-wifi lighting-app \ - out/artifacts/bouffalolab-bl706-wifi-light/chip-bl702-lighting-example.out \ + out/artifacts/bouffalolab-bl706dk-light-wifi-fp/chip-bl702-lighting-example.out \ /tmp/bloat_reports/ .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ bl702 bl702+rpc lighting-app \ @@ -110,7 +110,7 @@ jobs: run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ - --target bouffalolab-bl704l-dvk-light \ + --target bouffalolab-bl704ldk-light \ build \ --copy-artifacts-to out/artifacts \ " @@ -118,7 +118,7 @@ jobs: run: | .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ bl702l bl702l lighting-app \ - out/artifacts/bouffalolab-bl704l-dvk-light/chip-bl702l-lighting-example.out \ + out/artifacts/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.out \ /tmp/bloat_reports/ - name: Clean out build output run: rm -rf ./out diff --git a/examples/lighting-app/bouffalolab/bl602/BUILD.gn b/examples/lighting-app/bouffalolab/bl602/BUILD.gn index 3470110722b5fe..aba8c463ac7ade 100644 --- a/examples/lighting-app/bouffalolab/bl602/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl602/BUILD.gn @@ -32,10 +32,8 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -example_common_dir = "${chip_root}/examples/lighting-app/bouffalolab/common" -example_dir = "${chip_root}/examples/lighting-app/bouffalolab/bl602" -examples_plat_common_dir = "${chip_root}/examples/platform/bouffalolab/common" -examples_plat_dir = "${chip_root}/examples/platform/bouffalolab/bl602" +example_dir = "${chip_root}/examples/lighting-app/bouffalolab" +examples_plat_dir = "${chip_root}/examples/platform/bouffalolab" declare_args() { # Dump memory usage at link time. @@ -60,12 +58,15 @@ declare_args() { bl_iot_sdk("sdk") { include_dirs = [ + "${example_dir}/bl602", + "${examples_plat_dir}/bl602", + "${examples_plat_dir}/bl602/lwipopts", + "${examples_plat_dir}/common/route_hook", "${chip_root}/src/platform/bouffalolab/BL602", - "${example_dir}", - "${example_dir}/include", + "${chip_root}/src/platform/bouffalolab/common", ] - freertos_config = "${examples_plat_dir}/FreeRTOSConfig.h" + freertos_config = "${examples_plat_dir}/bl602/FreeRTOSConfig.h" defines = [ "INCLUDE_xSemaphoreGetMutexHolder=1", @@ -75,19 +76,20 @@ bl_iot_sdk("sdk") { "OTA_AUTO_REBOOT_DELAY=${ota_auto_reboot_delay_seconds}", "CHIP_UART_BAUDRATE=${baudrate}", "SYS_AOS_LOOP_ENABLE", + "CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE=48", ] if (chip_enable_pw_rpc) { - include_dirs += [ "${examples_plat_common_dir}/rpc" ] + include_dirs += [ "${examples_plat_dir}/common/rpc" ] defines += [ "PW_RPC_ENABLED=1" ] defines += [ "DISABLE_PRINT=1" ] } else if (chip_build_libshell) { - include_dirs += [ "${examples_plat_common_dir}/plat" ] + include_dirs += [ "${examples_plat_dir}/common/plat" ] } } chip_data_model("bouffalolab-lighting") { - zap_file = "${example_dir}/../data_model/lighting-app-wifi.zap" + zap_file = "${example_dir}/data_model/lighting-app-wifi.zap" zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true @@ -99,19 +101,31 @@ bouffalolab_executable("lighting_app") { defines = [ "APP_TASK_STACK_SIZE=2044", "CHIP_UART_BAUDRATE=${baudrate}", - "BL602_ENABLE", + "BL602_ENABLE=1", "START_ENTRY=bfl_main", "SYS_AOS_LOOP_ENABLE", ] + if (enable_debug_frame_ptr) { + defines += [ "CONF_ENABLE_FRAME_PTR=1" ] + } + if (false == enable_reset_counter) { defines += [ "BOOT_PIN_RESET=8" ] } + if (chip_enable_factory_data) { + defines += [ "CONFIG_BOUFFALOLAB_FACTORY_DATA_ENABLE" ] + } + + if (chip_enable_factory_data_test) { + defines += [ "CONFIG_BOUFFALOLAB_FACTORY_DATA_TEST" ] + } + bl_plat_name = "bl602" sources = [ - "${examples_plat_common_dir}/route_hook/bl_route_hook.c", - "${examples_plat_common_dir}/route_hook/bl_route_table.c", + "${examples_plat_dir}/common/route_hook/bl_route_hook.c", + "${examples_plat_dir}/common/route_hook/bl_route_table.c", ] if ("BL602-IoT-Matter-V1" == board) { @@ -122,15 +136,16 @@ bouffalolab_executable("lighting_app") { sources += [ "${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp", - "${example_common_dir}/AppTask.cpp", - "${example_common_dir}/ZclCallbacks.cpp", - "${examples_plat_common_dir}/plat/LEDWidget.cpp", - "${examples_plat_common_dir}/plat/OTAConfig.cpp", - "${examples_plat_common_dir}/plat/aos_task.c", - "${examples_plat_common_dir}/plat/demo_pwm.c", - "${examples_plat_common_dir}/plat/main.cpp", - "${examples_plat_common_dir}/plat/platform.cpp", - "${examples_plat_common_dir}/plat/uart.c", + "${example_dir}/common/AppTask.cpp", + "${example_dir}/common/ZclCallbacks.cpp", + "${examples_plat_dir}/common/iot_sdk/aos_task.c", + "${examples_plat_dir}/common/iot_sdk/demo_pwm.c", + "${examples_plat_dir}/common/iot_sdk/platform_port.c", + "${examples_plat_dir}/common/iot_sdk/uart.c", + "${examples_plat_dir}/common/plat/LEDWidget.cpp", + "${examples_plat_dir}/common/plat/OTAConfig.cpp", + "${examples_plat_dir}/common/plat/main.cpp", + "${examples_plat_dir}/common/plat/platform.cpp", ] deps = [ @@ -144,10 +159,12 @@ bouffalolab_executable("lighting_app") { include_dirs = [ "${chip_root}/src/platform/bouffalolab/BL602", - "${example_common_dir}", - "${examples_plat_common_dir}/route_hook", - "${examples_plat_common_dir}/plat", - "${examples_plat_dir}", + "${example_dir}/common", + "${example_dir}/bl602", + "${examples_plat_dir}/bl602/lwipopts", + "${examples_plat_dir}/common/route_hook", + "${examples_plat_dir}/common/plat", + "${examples_plat_dir}/common/iot_sdk", ] if (chip_enable_pw_rpc) { @@ -165,8 +182,8 @@ bouffalolab_executable("lighting_app") { sources += [ "${chip_root}/examples/common/pigweed/RpcService.cpp", "${chip_root}/examples/common/pigweed/bouffalolab/PigweedLoggerMutex.cpp", - "${examples_plat_common_dir}/rpc/PigweedLogger.cpp", - "${examples_plat_common_dir}/rpc/Rpc.cpp", + "${examples_plat_dir}/common/rpc/PigweedLogger.cpp", + "${examples_plat_dir}/common/rpc/Rpc.cpp", ] deps += [ @@ -184,7 +201,7 @@ bouffalolab_executable("lighting_app") { "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${examples_plat_common_dir}/rpc/pw_sys_io:pw_sys_io", + "${examples_plat_dir}/common/rpc/pw_sys_io:pw_sys_io", ] public_deps = [ @@ -210,12 +227,12 @@ bouffalolab_executable("lighting_app") { } if (enable_heap_monitoring) { - sources += [ "${examples_plat_common_dir}/plat/MemMonitoring.cpp" ] + sources += [ "${examples_plat_dir}/common/plat/MemMonitoring.cpp" ] defines += [ "HEAP_MONITORING=1" ] } cflags_c = [ "-Wno-sign-compare" ] - ldscript = "${examples_plat_dir}/ldscripts/flash_rom.ld" + ldscript = "${examples_plat_dir}/bl602/ldscripts/flash_rom.ld" ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] diff --git a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h index d265e16693b9b2..51430ca4e69d92 100644 --- a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h +++ b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h @@ -113,6 +113,4 @@ #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 -#define CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE 128 - #define CHIP_BLE_DEVICE_NAME "MatterLight" diff --git a/examples/lighting-app/bouffalolab/bl602/board.h b/examples/lighting-app/bouffalolab/bl602/mboard.h similarity index 95% rename from examples/lighting-app/bouffalolab/bl602/board.h rename to examples/lighting-app/bouffalolab/bl602/mboard.h index 4e98b267f9acf9..9698dd83769601 100644 --- a/examples/lighting-app/bouffalolab/bl602/board.h +++ b/examples/lighting-app/bouffalolab/bl602/mboard.h @@ -60,4 +60,4 @@ #endif #define CHIP_UART_PIN_RX 7 -#define CHIP_UART_PIN_TX 16 +#define CHIP_UART_PIN_TX 16 \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/bl702/BUILD.gn b/examples/lighting-app/bouffalolab/bl702/BUILD.gn index 47ba339669ca8e..bed6db25db81fd 100644 --- a/examples/lighting-app/bouffalolab/bl702/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702/BUILD.gn @@ -20,6 +20,7 @@ import("${bouffalolab_iot_sdk_build_root}/bl702/bl_iot_sdk.gni") import("${bouffalolab_iot_sdk_build_root}/common/bouffalolab_executable.gni") import("${build_root}/config/defaults.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") +import("${chip_root}/src/platform/bouffalolab/common/args.gni") import("${chip_root}/src/platform/device.gni") import("${chip_root}/src/app/chip_data_model.gni") @@ -31,10 +32,8 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -example_common_dir = "${chip_root}/examples/lighting-app/bouffalolab/common" -example_dir = "${chip_root}/examples/lighting-app/bouffalolab/bl702" -examples_plat_common_dir = "${chip_root}/examples/platform/bouffalolab/common" -examples_plat_dir = "${chip_root}/examples/platform/bouffalolab/bl702" +example_dir = "${chip_root}/examples/lighting-app/bouffalolab" +examples_plat_dir = "${chip_root}/examples/platform/bouffalolab" declare_args() { # Dump memory usage at link time. @@ -46,29 +45,33 @@ declare_args() { # reboot delay in seconds to apply new OTA image ota_auto_reboot_delay_seconds = 5 - config_cache_size = 8192 - enable_heap_monitoring = false enable_reset_counter = false - enable_cdc_module = false setupPinCode = 20202021 setupDiscriminator = 3840 board = "XT-ZB6-DevKit" module_type = "BL706C-22" - enable_psram = true baudrate = 2000000 + + enable_cdc_module = false + config_cache_size = 16384 + enable_psram = true } bl_iot_sdk("sdk") { include_dirs = [ + "${example_dir}/bl702", + "${example_dir}/bl702/include", + "${examples_plat_dir}", + "${examples_plat_dir}/common/iot_sdk", + "${examples_plat_dir}/common/route_hook", "${chip_root}/src/platform/bouffalolab/BL702", - "${example_dir}", - "${example_common_dir}", + "${chip_root}/src/platform/bouffalolab/common", ] - freertos_config = "${examples_plat_dir}/FreeRTOSConfig.h" + freertos_config = "${examples_plat_dir}/bl702/FreeRTOSConfig.h" defines = [ "INCLUDE_xSemaphoreGetMutexHolder=1", @@ -79,33 +82,41 @@ bl_iot_sdk("sdk") { "PRINT_DEBUG=0", ] - if (chip_enable_openthread) { - defines += [ "OPENTHREAD_CONFIG_PLATFORM_XTAL_ACCURACY=40" ] + if (chip_enable_pw_rpc) { + include_dirs += [ "${examples_plat_dir}/common/rpc" ] + defines += [ "PW_RPC_ENABLED=1" ] + defines += [ "DISABLE_PRINT=1" ] + } else if (chip_build_libshell) { + include_dirs += [ "${examples_plat_dir}/common/plat" ] } - if ("BL706C-22" == module_type) { - defines += [ "CFG_PSRAM_DUAL_BANK=1" ] + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_ETHERNET=${chip_enable_ethernet}" ] + + if (chip_enable_ethernet) { + defines += [ "CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE=48" ] } if (enable_psram) { defines += [ "CFG_USE_PSRAM=1" ] } - if (defined(enable_cdc_module) && enable_cdc_module) { - defines += [ "CFG_USB_CDC_ENABLE" ] + if ("BL706C-22" == module_type) { + defines += [ "CFG_PSRAM_DUAL_BANK=1" ] } - if (chip_enable_pw_rpc) { - include_dirs += [ "${examples_plat_common_dir}/rpc" ] - defines += [ "PW_RPC_ENABLED=1" ] - defines += [ "DISABLE_PRINT=1" ] - } else if (chip_build_libshell) { - include_dirs += [ "${examples_plat_common_dir}/plat" ] + if (defined(enable_cdc_module) && enable_cdc_module) { + defines += [ "CFG_USB_CDC_ENABLE" ] } } chip_data_model("bouffalolab-lighting") { - zap_file = "${example_dir}/../data_model/lighting-app-thread.zap" + if (chip_enable_openthread) { + zap_file = "${example_dir}/data_model/lighting-app-thread.zap" + } else if (chip_enable_wifi) { + zap_file = "${example_dir}/data_model/lighting-app-wifi.zap" + } else { + zap_file = "${example_dir}/data_model/lighting-app-ethernet.zap" + } zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true @@ -116,43 +127,41 @@ bouffalolab_executable("lighting_app") { bl_plat_name = "bl702" defines = [ - "APP_TASK_STACK_SIZE=2044", + "APP_TASK_STACK_SIZE=2048", "CHIP_UART_BAUDRATE=${baudrate}", - "BL702_ENABLE", + "BL702_ENABLE=1", "START_ENTRY=bl702_main", ] - if (false == enable_reset_counter) { - defines += [ "BOOT_PIN_RESET=31" ] + if (enable_debug_frame_ptr) { + defines += [ "CONF_ENABLE_FRAME_PTR=1" ] } - if (enable_psram) { - defines += [ "CFG_USE_PSRAM=1" ] + if (chip_config_network_layer_ble) { + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=1" ] + } + + if (false == enable_reset_counter) { + defines += [ "BOOT_PIN_RESET=31" ] } if ("XT-ZB6-DevKit" == board) { defines += [ "XT_ZB6_DevKit" ] } else if ("BL706-NIGHT-LIGHT" == board) { defines += [ "BL706_NIGHT_LIGHT" ] - } else if ("BL706-ETH" == board) { - defines += [ "BL706_ETHERNET" ] - } else if ("BL706-WIFI" == board) { - defines += [ "BL706_WIFI" ] - } - - if (defined(enable_cdc_module) && enable_cdc_module) { - defines += [ "CFG_USB_CDC_ENABLE" ] } sources = [ - "${example_common_dir}/AppTask.cpp", - "${example_common_dir}/ZclCallbacks.cpp", - "${examples_plat_common_dir}/plat/LEDWidget.cpp", - "${examples_plat_common_dir}/plat/OTAConfig.cpp", - "${examples_plat_common_dir}/plat/demo_pwm.c", - "${examples_plat_common_dir}/plat/main.cpp", - "${examples_plat_common_dir}/plat/platform.cpp", - "${examples_plat_common_dir}/plat/uart.c", + "${example_dir}/common/AppTask.cpp", + "${example_dir}/common/ZclCallbacks.cpp", + "${examples_plat_dir}/common/iot_sdk/aos_task.c", + "${examples_plat_dir}/common/iot_sdk/demo_pwm.c", + "${examples_plat_dir}/common/iot_sdk/platform_port.c", + "${examples_plat_dir}/common/iot_sdk/uart.c", + "${examples_plat_dir}/common/plat/LEDWidget.cpp", + "${examples_plat_dir}/common/plat/OTAConfig.cpp", + "${examples_plat_dir}/common/plat/main.cpp", + "${examples_plat_dir}/common/plat/platform.cpp", ] deps = [ @@ -163,6 +172,39 @@ bouffalolab_executable("lighting_app") { "${chip_root}/src/setup_payload", ] + include_dirs = [ + "${chip_root}/src/platform/bouffalolab/BL702", + "${example_dir}/common", + "${example_dir}/bl702", + "${examples_plat_dir}/common/plat", + "${examples_plat_dir}/common/iot_sdk", + ] + + if (chip_enable_wifi || chip_enable_ethernet) { + include_dirs += [ "${examples_plat_dir}/bl702/lwipopts" ] + } + + if (enable_psram) { + defines += [ "CFG_USE_PSRAM=1" ] + } + + if (defined(enable_cdc_module) && enable_cdc_module) { + defines += [ "CFG_USB_CDC_ENABLE" ] + } + + if (chip_enable_wifi || chip_enable_ethernet) { + include_dirs += [ "${examples_plat_dir}/common/route_hook" ] + + if (chip_enable_wifi) { + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_WIFI" ] + } + + sources += [ + "${examples_plat_dir}/common/route_hook/bl_route_hook.c", + "${examples_plat_dir}/common/route_hook/bl_route_table.c", + ] + } + if (chip_enable_openthread) { deps += [ "${chip_root}/third_party/openthread/platforms:libopenthread-platform", @@ -182,20 +224,8 @@ bouffalolab_executable("lighting_app") { "${chip_root}/third_party/openthread/repo:libopenthread-mtd", ] } - } else { - sources += [ - "${examples_plat_common_dir}/route_hook/bl_route_hook.c", - "${examples_plat_common_dir}/route_hook/bl_route_table.c", - ] } - include_dirs = [ - "${chip_root}/src/platform/bouffalolab/BL702", - "${example_common_dir}", - "${examples_plat_common_dir}/route_hook", - "${examples_plat_common_dir}/plat", - ] - if (chip_enable_pw_rpc) { defines += [ "PW_RPC_ENABLED=1", @@ -214,8 +244,8 @@ bouffalolab_executable("lighting_app") { sources += [ "${chip_root}/examples/common/pigweed/RpcService.cpp", "${chip_root}/examples/common/pigweed/bouffalolab/PigweedLoggerMutex.cpp", - "${examples_plat_common_dir}/rpc/PigweedLogger.cpp", - "${examples_plat_common_dir}/rpc/Rpc.cpp", + "${examples_plat_dir}/common/rpc/PigweedLogger.cpp", + "${examples_plat_dir}/common/rpc/Rpc.cpp", ] deps += [ @@ -231,7 +261,7 @@ bouffalolab_executable("lighting_app") { "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${examples_plat_common_dir}/rpc/pw_sys_io:pw_sys_io", + "${examples_plat_dir}/common/rpc/pw_sys_io:pw_sys_io", ] if (chip_enable_openthread) { @@ -250,23 +280,23 @@ bouffalolab_executable("lighting_app") { } else if (chip_build_libshell) { defines += [ "CONFIG_ENABLE_CHIP_SHELL=${chip_build_libshell}" ] - deps += [ "${chip_root}/examples/shell/shell_common:shell_common" ] - include_dirs += [ "${chip_root}/src/lib/shell", "${chip_root}/examples/shell/shell_common/include", ] + + deps += [ "${chip_root}/examples/shell/shell_common:shell_common" ] } if (enable_heap_monitoring) { - sources += [ "${examples_plat_common_dir}/plat/MemMonitoring.cpp" ] + sources += [ "${examples_plat_dir}/common/plat/MemMonitoring.cpp" ] defines += [ "HEAP_MONITORING=1" ] } if (enable_psram) { - ldscript = "${examples_plat_dir}/ldscripts/psram_flash.ld" + ldscript = "${examples_plat_dir}/bl702/ldscripts/psram_flash.ld" } else { - ldscript = "${examples_plat_dir}/ldscripts/flash.ld" + ldscript = "${examples_plat_dir}/bl702/ldscripts/flash.ld" } inputs = [ ldscript ] diff --git a/examples/lighting-app/bouffalolab/bl702/board.h b/examples/lighting-app/bouffalolab/bl702/mboard.h similarity index 100% rename from examples/lighting-app/bouffalolab/bl702/board.h rename to examples/lighting-app/bouffalolab/bl702/mboard.h diff --git a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn index 621416e5bb3deb..86655fe708bb9d 100644 --- a/examples/lighting-app/bouffalolab/bl702l/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702l/BUILD.gn @@ -31,10 +31,8 @@ if (chip_enable_pw_rpc) { assert(current_os == "freertos") -example_common_dir = "${chip_root}/examples/lighting-app/bouffalolab/common" -example_dir = "${chip_root}/examples/lighting-app/bouffalolab/bl702l" -examples_plat_common_dir = "${chip_root}/examples/platform/bouffalolab/common" -examples_plat_dir = "${chip_root}/examples/platform/bouffalolab/bl702l" +example_dir = "${chip_root}/examples/lighting-app/bouffalolab" +examples_plat_dir = "${chip_root}/examples/platform/bouffalolab" declare_args() { # Dump memory usage at link time. @@ -46,8 +44,6 @@ declare_args() { # reboot delay in seconds to apply new OTA image ota_auto_reboot_delay_seconds = 5 - config_cache_size = 8192 - enable_heap_monitoring = false enable_reset_counter = false @@ -56,18 +52,23 @@ declare_args() { board = "BL704L-EVB" module_type = "BL704L" - enable_psram = true baudrate = 2000000 + + config_cache_size = 8192 + enable_psram = true } bl_iot_sdk("sdk") { include_dirs = [ + "${example_dir}/bl702l", + "${example_dir}/bl702l/include", + "${examples_plat_dir}", + "${examples_plat_dir}/common/route_hook", "${chip_root}/src/platform/bouffalolab/BL702L", - "${example_dir}", - "${example_common_dir}", + "${chip_root}/src/platform/bouffalolab/common", ] - freertos_config = "${examples_plat_dir}/FreeRTOSConfig.h" + freertos_config = "${examples_plat_dir}/bl702l/FreeRTOSConfig.h" defines = [ "INCLUDE_xSemaphoreGetMutexHolder=1", @@ -75,25 +76,28 @@ bl_iot_sdk("sdk") { "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setupDiscriminator}", "OTA_PERIODIC_TIMEOUT=${ota_periodic_query_timeout_seconds}", "OTA_AUTO_REBOOT_DELAY=${ota_auto_reboot_delay_seconds}", - "OPENTHREAD_CONFIG_PLATFORM_XTAL_ACCURACY=40", "PRINT_DEBUG=0", ] - if (enable_psram) { - defines += [ "CFG_USE_PSRAM=1" ] - } - if (chip_enable_pw_rpc) { - include_dirs += [ "${examples_plat_common_dir}/rpc" ] + include_dirs += [ "${examples_plat_dir}/common/rpc" ] defines += [ "PW_RPC_ENABLED=1" ] defines += [ "DISABLE_PRINT=1" ] } else if (chip_build_libshell) { - include_dirs += [ "${examples_plat_common_dir}/plat" ] + include_dirs += [ "${examples_plat_dir}/common/plat" ] + } + + if (chip_enable_openthread) { + defines += [ "OPENTHREAD_CONFIG_PLATFORM_XTAL_ACCURACY=40" ] + } + + if (enable_psram) { + defines += [ "CFG_USE_PSRAM=1" ] } } chip_data_model("bouffalolab-lighting") { - zap_file = "${example_dir}/../data_model/lighting-app-thread.zap" + zap_file = "${example_dir}/data_model/lighting-app-wifi.zap" zap_pregenerated_dir = "${chip_root}/zzz_generated/lighting-app/zap-generated" is_server = true @@ -104,35 +108,39 @@ bouffalolab_executable("lighting_app") { bl_plat_name = "bl702l" defines = [ - "APP_TASK_STACK_SIZE=2044", + "APP_TASK_STACK_SIZE=2048", "CHIP_UART_BAUDRATE=${baudrate}", - "BL702L_ENABLE", + "BL702L_ENABLE=1", "START_ENTRY=bl702_main", ] + if (enable_debug_frame_ptr) { + defines += [ "CONF_ENABLE_FRAME_PTR=1" ] + } + + if (chip_config_network_layer_ble) { + defines += [ "CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE=1" ] + } + if (false == enable_reset_counter) { defines += [ "BOOT_PIN_RESET=16" ] } - defines += [ "CFG_USE_PSRAM=1" ] - - if ("BL704L" == board) { + if ("BL704LDK" == board) { defines += [ "XT_ZB6_DevKit" ] - } else if ("BL706-NIGHT-LIGHT" == board) { - defines += [ "BL706_NIGHT_LIGHT" ] - } else if ("BL702-IoT-DVK" == board || "BL706-IoT-DVK" == board) { - defines += [ "BL706_IOT_DVK" ] } sources = [ - "${example_common_dir}/AppTask.cpp", - "${example_common_dir}/ZclCallbacks.cpp", - "${examples_plat_common_dir}/plat/LEDWidget.cpp", - "${examples_plat_common_dir}/plat/OTAConfig.cpp", - "${examples_plat_common_dir}/plat/demo_pwm.c", - "${examples_plat_common_dir}/plat/main.cpp", - "${examples_plat_common_dir}/plat/platform.cpp", - "${examples_plat_common_dir}/plat/uart.c", + "${example_dir}/common/AppTask.cpp", + "${example_dir}/common/ZclCallbacks.cpp", + "${examples_plat_dir}/common/iot_sdk/aos_task.c", + "${examples_plat_dir}/common/iot_sdk/demo_pwm.c", + "${examples_plat_dir}/common/iot_sdk/platform_port.c", + "${examples_plat_dir}/common/iot_sdk/uart.c", + "${examples_plat_dir}/common/plat/LEDWidget.cpp", + "${examples_plat_dir}/common/plat/OTAConfig.cpp", + "${examples_plat_dir}/common/plat/main.cpp", + "${examples_plat_dir}/common/plat/platform.cpp", ] deps = [ @@ -141,29 +149,48 @@ bouffalolab_executable("lighting_app") { "${chip_root}/examples/providers:device_info_provider", "${chip_root}/src/lib", "${chip_root}/src/setup_payload", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform", - "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] - if (chip_openthread_ftd) { - defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=1" ] - deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", - "${chip_root}/third_party/openthread/repo:libopenthread-ftd", - ] - } else { - defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=0" ] + include_dirs = [ + "${chip_root}/src/platform/bouffalolab/BL702L", + "${example_dir}/common", + "${example_dir}/bl702l", + "${examples_plat_dir}/common/plat", + "${examples_plat_dir}/common/iot_sdk", + ] + + if (enable_psram) { + defines += [ "CFG_USE_PSRAM=1" ] + } + + if (chip_enable_openthread) { deps += [ - "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", - "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform", + "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", ] + + if (chip_openthread_ftd) { + defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=1" ] + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd", + "${chip_root}/third_party/openthread/repo:libopenthread-ftd", + ] + } else { + defines += [ "CHIP_DEVICE_CONFIG_THREAD_FTD=0" ] + deps += [ + "${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd", + "${chip_root}/third_party/openthread/repo:libopenthread-mtd", + ] + } } - include_dirs = [ - "${chip_root}/src/platform/bouffalolab/BL702L", - "${example_common_dir}", - "${examples_plat_common_dir}/plat", - ] + if (chip_enable_wifi) { + include_dirs += [ "${examples_plat_dir}/common/route_hook" ] + sources += [ + "${examples_plat_dir}/common/route_hook/bl_route_hook.c", + "${examples_plat_dir}/common/route_hook/bl_route_table.c", + ] + } if (chip_enable_pw_rpc) { defines += [ @@ -183,8 +210,8 @@ bouffalolab_executable("lighting_app") { sources += [ "${chip_root}/examples/common/pigweed/RpcService.cpp", "${chip_root}/examples/common/pigweed/bouffalolab/PigweedLoggerMutex.cpp", - "${examples_plat_common_dir}/rpc/PigweedLogger.cpp", - "${examples_plat_common_dir}/rpc/Rpc.cpp", + "${examples_plat_dir}/common/rpc/PigweedLogger.cpp", + "${examples_plat_dir}/common/rpc/Rpc.cpp", ] deps += [ @@ -200,11 +227,16 @@ bouffalolab_executable("lighting_app") { "${chip_root}/examples/common/pigweed:descriptor_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:device_service.nanopb_rpc", "${chip_root}/examples/common/pigweed:lighting_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", - "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", - "${examples_plat_common_dir}/rpc/pw_sys_io:pw_sys_io", + "${examples_plat_dir}/common/rpc/pw_sys_io:pw_sys_io", ] + if (chip_enable_openthread) { + deps += [ + "${chip_root}/examples/common/pigweed:ot_cli_service.nanopb_rpc", + "${chip_root}/examples/common/pigweed:thread_service.nanopb_rpc", + ] + } + deps += pw_build_LINK_DEPS include_dirs += [ @@ -223,14 +255,14 @@ bouffalolab_executable("lighting_app") { } if (enable_heap_monitoring) { - sources += [ "${examples_plat_common_dir}/plat/MemMonitoring.cpp" ] + sources += [ "${examples_plat_dir}/common/plat/MemMonitoring.cpp" ] defines += [ "HEAP_MONITORING=1" ] } if (enable_psram) { - ldscript = "${examples_plat_dir}/ldscripts/psram_flash_rom.ld" + ldscript = "${examples_plat_dir}/bl702l/ldscripts/psram_flash_rom.ld" } else { - ldscript = "${examples_plat_dir}/ldscripts/flash_rom.ld" + ldscript = "${examples_plat_dir}/bl702l/ldscripts/flash_rom.ld" } inputs = [ ldscript ] diff --git a/examples/lighting-app/bouffalolab/bl702l/board.h b/examples/lighting-app/bouffalolab/bl702l/mboard.h similarity index 100% rename from examples/lighting-app/bouffalolab/bl702l/board.h rename to examples/lighting-app/bouffalolab/bl702l/mboard.h diff --git a/examples/lighting-app/bouffalolab/common/AppTask.cpp b/examples/lighting-app/bouffalolab/common/AppTask.cpp index 3171341a9b49ba..f38ae87a61c340 100644 --- a/examples/lighting-app/bouffalolab/common/AppTask.cpp +++ b/examples/lighting-app/bouffalolab/common/AppTask.cpp @@ -45,15 +45,16 @@ #include #include +#include + extern "C" { -#include "board.h" #include -#include #include #include } #include "AppTask.h" +#include "mboard.h" using namespace ::chip; using namespace ::chip::app; @@ -134,7 +135,7 @@ void AppTask::AppTaskMain(void * pvParameter) app_event_t appEvent; bool onoff = false; -#ifndef BL706_ETHERNET +#if !(BL702_ENABLE && CHIP_DEVICE_CONFIG_ENABLE_ETHERNET) sLightLED.Init(); #endif @@ -212,6 +213,13 @@ void AppTask::AppTaskMain(void * pvParameter) } } +#ifdef BOOT_PIN_RESET + if (APP_EVENT_BTN_LONG & appEvent) + { + /** Turn off light to indicate button long press for factory reset is confirmed */ + sLightLED.SetOnoff(false); + } +#endif if (APP_EVENT_IDENTIFY_MASK & appEvent) { IdentifyHandleOp(appEvent); @@ -271,7 +279,6 @@ void AppTask::LightingUpdate(app_event_t status) { if (v.IsNull()) { - // Just pick something. v.SetNonNull(254); } #if defined(BL706_NIGHT_LIGHT) || defined(BL602_NIGHT_LIGHT) @@ -330,7 +337,12 @@ void AppTask::TimerEventHandler(app_event_t event) if (GetAppTask().mButtonPressedTime) { #ifdef BOOT_PIN_RESET - if (System::SystemClock().GetMonotonicMilliseconds64().count() - GetAppTask().mButtonPressedTime >= APP_BUTTON_PRESS_SHORT) + if (System::SystemClock().GetMonotonicMilliseconds64().count() - GetAppTask().mButtonPressedTime > APP_BUTTON_PRESS_LONG) + { + GetAppTask().PostEvent(APP_EVENT_BTN_LONG); + } + else if (System::SystemClock().GetMonotonicMilliseconds64().count() - GetAppTask().mButtonPressedTime >= + APP_BUTTON_PRESS_SHORT) { #if defined(BL602_NIGHT_LIGHT) || defined(BL706_NIGHT_LIGHT) /** change color to indicate to wait factory reset confirm */ @@ -403,7 +415,7 @@ void AppTask::ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction) } #ifdef BOOT_PIN_RESET -hosal_gpio_dev_t gpio_key = { .port = BOOT_PIN_RESET, .config = INPUT_HIGH_IMPEDANCE, .priv = NULL }; +static hosal_gpio_dev_t gpio_key = { .port = BOOT_PIN_RESET, .config = INPUT_HIGH_IMPEDANCE, .priv = NULL }; void AppTask::ButtonInit(void) { @@ -416,16 +428,19 @@ void AppTask::ButtonInit(void) bool AppTask::ButtonPressed(void) { uint8_t val = 1; + hosal_gpio_input_get(&gpio_key, &val); + return val == 1; } void AppTask::ButtonEventHandler(void * arg) { uint32_t presstime; + if (ButtonPressed()) { -#ifdef BL702L_ENABLE +#if BL702L_ENABLE bl_set_gpio_intmod(gpio_key.port, HOSAL_IRQ_TRIG_NEG_LEVEL); #else bl_set_gpio_intmod(gpio_key.port, 1, HOSAL_IRQ_TRIG_NEG_LEVEL); @@ -436,11 +451,12 @@ void AppTask::ButtonEventHandler(void * arg) } else { -#ifdef BL702L_ENABLE +#if BL702L_ENABLE bl_set_gpio_intmod(gpio_key.port, HOSAL_IRQ_TRIG_POS_PULSE); #else bl_set_gpio_intmod(gpio_key.port, 1, HOSAL_IRQ_TRIG_POS_PULSE); #endif + if (GetAppTask().mButtonPressedTime) { presstime = System::SystemClock().GetMonotonicMilliseconds64().count() - GetAppTask().mButtonPressedTime; diff --git a/examples/lighting-app/bouffalolab/common/AppTask.h b/examples/lighting-app/bouffalolab/common/AppTask.h index 3c32ee7311cd65..638ad9e9f71b58 100644 --- a/examples/lighting-app/bouffalolab/common/AppTask.h +++ b/examples/lighting-app/bouffalolab/common/AppTask.h @@ -23,6 +23,7 @@ #include "FreeRTOS.h" #include "timers.h" + #include using namespace ::chip; @@ -58,6 +59,7 @@ class AppTask APP_EVENT_TIMER = 0x00000010, APP_EVENT_BTN_SHORT = 0x00000020, APP_EVENT_FACTORY_RESET = 0x00000040, + APP_EVENT_BTN_LONG = 0x00000080, APP_EVENT_LIGHTING_ONOFF = 0x00010000, APP_EVENT_LIGHTING_LEVEL = 0x00020000, @@ -69,7 +71,8 @@ class AppTask APP_EVENT_IDENTIFY_STOP = 0x04000000, APP_EVENT_IDENTIFY_MASK = APP_EVENT_IDENTIFY_START | APP_EVENT_IDENTIFY_IDENTIFY | APP_EVENT_IDENTIFY_STOP, - APP_EVENT_ALL_MASK = APP_EVENT_LIGHTING_MASK | APP_EVENT_TIMER | APP_EVENT_BTN_SHORT | APP_EVENT_IDENTIFY_MASK, + APP_EVENT_ALL_MASK = + APP_EVENT_LIGHTING_MASK | APP_EVENT_TIMER | APP_EVENT_BTN_SHORT | APP_EVENT_BTN_LONG | APP_EVENT_IDENTIFY_MASK, }; void SetEndpointId(EndpointId endpointId) @@ -81,6 +84,9 @@ class AppTask EndpointId GetEndpointId(void) { return mEndpointId; } void PostEvent(app_event_t event); void ButtonEventHandler(uint8_t btnIdx, uint8_t btnAction); +#ifdef BOOT_PIN_RESET + static void ButtonEventHandler(void * arg); +#endif static void IdentifyStartHandler(Identify *); static void IdentifyStopHandler(Identify *); @@ -106,7 +112,6 @@ class AppTask #ifdef BOOT_PIN_RESET static void ButtonInit(void); static bool ButtonPressed(void); - static void ButtonEventHandler(void * arg); #endif static void ScheduleInit(intptr_t arg); diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter new file mode 100644 index 00000000000000..9cf2e7bc80bbe2 --- /dev/null +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -0,0 +1,1964 @@ +// This IDL was generated automatically by ZAP. +// It is for view/code review purposes only. + +struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; +} + +struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; +} + +struct ApplicationStruct { + int16u catalogVendorID = 0; + char_string applicationID = 1; +} + +struct ErrorStateStruct { + enum8 errorStateID = 0; + optional char_string<64> errorStateLabel = 1; + optional char_string<64> errorStateDetails = 2; +} + +struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; +} + +struct OperationalStateStruct { + enum8 operationalStateID = 0; + optional char_string<64> operationalStateLabel = 1; +} + +/** Attributes and commands for putting a device into Identification mode (e.g. flashing a light). */ +server cluster Identify = 3 { + enum EffectIdentifierEnum : ENUM8 { + kBlink = 0; + kBreathe = 1; + kOkay = 2; + kChannelChange = 11; + kFinishEffect = 254; + kStopEffect = 255; + } + + enum EffectVariantEnum : ENUM8 { + kDefault = 0; + } + + enum IdentifyTypeEnum : ENUM8 { + kNone = 0; + kLightOutput = 1; + kVisibleIndicator = 2; + kAudibleBeep = 3; + kDisplay = 4; + kActuator = 5; + } + + attribute int16u identifyTime = 0; + readonly attribute IdentifyTypeEnum identifyType = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct IdentifyRequest { + INT16U identifyTime = 0; + } + + request struct TriggerEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + EffectVariantEnum effectVariant = 1; + } + + command access(invoke: manage) Identify(IdentifyRequest): DefaultSuccess = 0; + command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; +} + +/** Attributes and commands for group configuration and manipulation. */ +server cluster Groups = 4 { + bitmap Feature : BITMAP32 { + kGroupNames = 0x1; + } + + bitmap NameSupportBitmap : BITMAP8 { + kGroupNames = 0x80; + } + + readonly attribute NameSupportBitmap nameSupport = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AddGroupRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + request struct ViewGroupRequest { + group_id groupID = 0; + } + + request struct GetGroupMembershipRequest { + group_id groupList[] = 0; + } + + request struct RemoveGroupRequest { + group_id groupID = 0; + } + + request struct AddGroupIfIdentifyingRequest { + group_id groupID = 0; + CHAR_STRING groupName = 1; + } + + response struct AddGroupResponse = 0 { + ENUM8 status = 0; + group_id groupID = 1; + } + + response struct ViewGroupResponse = 1 { + ENUM8 status = 0; + group_id groupID = 1; + CHAR_STRING groupName = 2; + } + + response struct GetGroupMembershipResponse = 2 { + nullable INT8U capacity = 0; + group_id groupList[] = 1; + } + + response struct RemoveGroupResponse = 3 { + ENUM8 status = 0; + group_id groupID = 1; + } + + fabric command access(invoke: manage) AddGroup(AddGroupRequest): AddGroupResponse = 0; + fabric command ViewGroup(ViewGroupRequest): ViewGroupResponse = 1; + fabric command GetGroupMembership(GetGroupMembershipRequest): GetGroupMembershipResponse = 2; + fabric command access(invoke: manage) RemoveGroup(RemoveGroupRequest): RemoveGroupResponse = 3; + fabric command access(invoke: manage) RemoveAllGroups(): DefaultSuccess = 4; + fabric command access(invoke: manage) AddGroupIfIdentifying(AddGroupIfIdentifyingRequest): DefaultSuccess = 5; +} + +/** Attributes and commands for switching devices between 'On' and 'Off' states. */ +server cluster OnOff = 6 { + enum OnOffDelayedAllOffEffectVariant : ENUM8 { + kFadeToOffIn0p8Seconds = 0; + kNoFade = 1; + k50PercentDimDownIn0p8SecondsThenFadeToOffIn12Seconds = 2; + } + + enum OnOffDyingLightEffectVariant : ENUM8 { + k20PercenterDimUpIn0p5SecondsThenFadeToOffIn1Second = 0; + } + + enum OnOffEffectIdentifier : ENUM8 { + kDelayedAllOff = 0; + kDyingLight = 1; + } + + enum OnOffStartUpOnOff : ENUM8 { + kOff = 0; + kOn = 1; + kTogglePreviousOnOff = 2; + } + + bitmap Feature : BITMAP32 { + kLighting = 0x1; + kDeadFront = 0x2; + } + + bitmap OnOffControl : BITMAP8 { + kAcceptOnlyWhenOn = 0x1; + } + + readonly attribute boolean onOff = 0; + readonly attribute boolean globalSceneControl = 16384; + attribute int16u onTime = 16385; + attribute int16u offWaitTime = 16386; + attribute access(write: manage) nullable OnOffStartUpOnOff startUpOnOff = 16387; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OffWithEffectRequest { + OnOffEffectIdentifier effectIdentifier = 0; + int8u effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControl onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + + command Off(): DefaultSuccess = 0; + command On(): DefaultSuccess = 1; + command Toggle(): DefaultSuccess = 2; + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; +} + +/** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ +server cluster LevelControl = 8 { + enum MoveMode : ENUM8 { + kUp = 0; + kDown = 1; + } + + enum StepMode : ENUM8 { + kUp = 0; + kDown = 1; + } + + bitmap Feature : BITMAP32 { + kOnOff = 0x1; + kLighting = 0x2; + kFrequency = 0x4; + } + + bitmap LevelControlOptions : BITMAP8 { + kExecuteIfOff = 0x1; + kCoupleColorTempToLevel = 0x2; + } + + readonly attribute nullable int8u currentLevel = 0; + readonly attribute int16u remainingTime = 1; + readonly attribute int8u minLevel = 2; + readonly attribute int8u maxLevel = 3; + readonly attribute int16u currentFrequency = 4; + readonly attribute int16u minFrequency = 5; + readonly attribute int16u maxFrequency = 6; + attribute LevelControlOptions options = 15; + attribute int16u onOffTransitionTime = 16; + attribute nullable int8u onLevel = 17; + attribute nullable int16u onTransitionTime = 18; + attribute nullable int16u offTransitionTime = 19; + attribute nullable int8u defaultMoveRate = 20; + attribute access(write: manage) nullable int8u startUpCurrentLevel = 16384; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct MoveToLevelRequest { + INT8U level = 0; + nullable INT16U transitionTime = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct MoveRequest { + MoveMode moveMode = 0; + nullable INT8U rate = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct StepRequest { + StepMode stepMode = 0; + INT8U stepSize = 1; + nullable INT16U transitionTime = 2; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; + } + + request struct StopRequest { + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; + } + + request struct MoveToLevelWithOnOffRequest { + INT8U level = 0; + nullable INT16U transitionTime = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct MoveWithOnOffRequest { + MoveMode moveMode = 0; + nullable INT8U rate = 1; + LevelControlOptions optionsMask = 2; + LevelControlOptions optionsOverride = 3; + } + + request struct StepWithOnOffRequest { + StepMode stepMode = 0; + INT8U stepSize = 1; + nullable INT16U transitionTime = 2; + LevelControlOptions optionsMask = 3; + LevelControlOptions optionsOverride = 4; + } + + request struct StopWithOnOffRequest { + LevelControlOptions optionsMask = 0; + LevelControlOptions optionsOverride = 1; + } + + command MoveToLevel(MoveToLevelRequest): DefaultSuccess = 0; + command Move(MoveRequest): DefaultSuccess = 1; + command Step(StepRequest): DefaultSuccess = 2; + command Stop(StopRequest): DefaultSuccess = 3; + command MoveToLevelWithOnOff(MoveToLevelWithOnOffRequest): DefaultSuccess = 4; + command MoveWithOnOff(MoveWithOnOffRequest): DefaultSuccess = 5; + command StepWithOnOff(StepWithOnOffRequest): DefaultSuccess = 6; + command StopWithOnOff(StopWithOnOffRequest): DefaultSuccess = 7; +} + +/** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ +server cluster Descriptor = 29 { + bitmap Feature : BITMAP32 { + kTagList = 0x1; + } + + struct DeviceTypeStruct { + devtype_id deviceType = 0; + int16u revision = 1; + } + + struct SemanticTagStruct { + nullable vendor_id mfgCode = 0; + enum8 namespaceID = 1; + enum8 tag = 2; + optional nullable char_string label = 3; + } + + readonly attribute DeviceTypeStruct deviceTypeList[] = 0; + readonly attribute CLUSTER_ID serverList[] = 1; + readonly attribute CLUSTER_ID clientList[] = 2; + readonly attribute ENDPOINT_NO partsList[] = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The Access Control Cluster exposes a data model view of a + Node's Access Control List (ACL), which codifies the rules used to manage + and enforce Access Control for the Node's endpoints and their associated + cluster instances. */ +server cluster AccessControl = 31 { + enum AccessControlEntryAuthModeEnum : ENUM8 { + kPASE = 1; + kCASE = 2; + kGroup = 3; + } + + enum AccessControlEntryPrivilegeEnum : ENUM8 { + kView = 1; + kProxyView = 2; + kOperate = 3; + kManage = 4; + kAdminister = 5; + } + + enum ChangeTypeEnum : ENUM8 { + kChanged = 0; + kAdded = 1; + kRemoved = 2; + } + + struct AccessControlTargetStruct { + nullable cluster_id cluster = 0; + nullable endpoint_no endpoint = 1; + nullable devtype_id deviceType = 2; + } + + fabric_scoped struct AccessControlEntryStruct { + fabric_sensitive AccessControlEntryPrivilegeEnum privilege = 1; + fabric_sensitive AccessControlEntryAuthModeEnum authMode = 2; + nullable fabric_sensitive int64u subjects[] = 3; + nullable fabric_sensitive AccessControlTargetStruct targets[] = 4; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct AccessControlExtensionStruct { + fabric_sensitive octet_string<128> data = 1; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlEntryChanged = 0 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlEntryStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + fabric_sensitive info event access(read: administer) AccessControlExtensionChanged = 1 { + nullable node_id adminNodeID = 1; + nullable INT16U adminPasscodeID = 2; + ChangeTypeEnum changeType = 3; + nullable AccessControlExtensionStruct latestValue = 4; + fabric_idx fabricIndex = 254; + } + + attribute access(read: administer, write: administer) AccessControlEntryStruct acl[] = 0; + attribute access(read: administer, write: administer) AccessControlExtensionStruct extension[] = 1; + readonly attribute int16u subjectsPerAccessControlEntry = 2; + readonly attribute int16u targetsPerAccessControlEntry = 3; + readonly attribute int16u accessControlEntriesPerFabric = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster provides attributes and events for determining basic information about Nodes, which supports both + Commissioning and operational determination of Node characteristics, such as Vendor ID, Product ID and serial number, + which apply to the whole Node. Also allows setting user device information such as location. */ +server cluster BasicInformation = 40 { + enum ColorEnum : ENUM8 { + kBlack = 0; + kNavy = 1; + kGreen = 2; + kTeal = 3; + kMaroon = 4; + kPurple = 5; + kOlive = 6; + kGray = 7; + kBlue = 8; + kLime = 9; + kAqua = 10; + kRed = 11; + kFuchsia = 12; + kYellow = 13; + kWhite = 14; + kNickel = 15; + kChrome = 16; + kBrass = 17; + kCopper = 18; + kSilver = 19; + kGold = 20; + } + + enum ProductFinishEnum : ENUM8 { + kOther = 0; + kMatte = 1; + kSatin = 2; + kPolished = 3; + kRugged = 4; + kFabric = 5; + } + + struct CapabilityMinimaStruct { + int16u caseSessionsPerFabric = 0; + int16u subscriptionsPerFabric = 1; + } + + struct ProductAppearanceStruct { + ProductFinishEnum finish = 0; + nullable ColorEnum primaryColor = 1; + } + + critical event StartUp = 0 { + INT32U softwareVersion = 0; + } + + critical event ShutDown = 1 { + } + + info event Leave = 2 { + fabric_idx fabricIndex = 0; + } + + info event ReachableChanged = 3 { + boolean reachableNewValue = 0; + } + + readonly attribute int16u dataModelRevision = 0; + readonly attribute char_string<32> vendorName = 1; + readonly attribute vendor_id vendorID = 2; + readonly attribute char_string<32> productName = 3; + readonly attribute int16u productID = 4; + attribute access(write: manage) char_string<32> nodeLabel = 5; + attribute access(write: administer) char_string<2> location = 6; + readonly attribute int16u hardwareVersion = 7; + readonly attribute char_string<64> hardwareVersionString = 8; + readonly attribute int32u softwareVersion = 9; + readonly attribute char_string<64> softwareVersionString = 10; + readonly attribute char_string<16> manufacturingDate = 11; + readonly attribute char_string<32> partNumber = 12; + readonly attribute long_char_string<256> productURL = 13; + readonly attribute char_string<64> productLabel = 14; + readonly attribute char_string<32> serialNumber = 15; + attribute access(write: manage) boolean localConfigDisabled = 16; + readonly attribute char_string<32> uniqueID = 18; + readonly attribute CapabilityMinimaStruct capabilityMinima = 19; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Provides an interface for providing OTA software updates */ +client cluster OtaSoftwareUpdateProvider = 41 { + enum OTAApplyUpdateAction : ENUM8 { + kProceed = 0; + kAwaitNextAction = 1; + kDiscontinue = 2; + } + + enum OTADownloadProtocol : ENUM8 { + kBDXSynchronous = 0; + kBDXAsynchronous = 1; + kHTTPS = 2; + kVendorSpecific = 3; + } + + enum OTAQueryStatus : ENUM8 { + kUpdateAvailable = 0; + kBusy = 1; + kNotAvailable = 2; + kDownloadProtocolNotSupported = 3; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct QueryImageRequest { + vendor_id vendorID = 0; + INT16U productID = 1; + INT32U softwareVersion = 2; + OTADownloadProtocol protocolsSupported[] = 3; + optional INT16U hardwareVersion = 4; + optional CHAR_STRING<2> location = 5; + optional BOOLEAN requestorCanConsent = 6; + optional OCTET_STRING<512> metadataForProvider = 7; + } + + response struct QueryImageResponse = 1 { + OTAQueryStatus status = 0; + optional INT32U delayedActionTime = 1; + optional CHAR_STRING<256> imageURI = 2; + optional INT32U softwareVersion = 3; + optional CHAR_STRING<64> softwareVersionString = 4; + optional OCTET_STRING<32> updateToken = 5; + optional BOOLEAN userConsentNeeded = 6; + optional OCTET_STRING<512> metadataForRequestor = 7; + } + + request struct ApplyUpdateRequestRequest { + OCTET_STRING<32> updateToken = 0; + INT32U newVersion = 1; + } + + response struct ApplyUpdateResponse = 3 { + OTAApplyUpdateAction action = 0; + INT32U delayedActionTime = 1; + } + + request struct NotifyUpdateAppliedRequest { + OCTET_STRING<32> updateToken = 0; + INT32U softwareVersion = 1; + } + + /** Determine availability of a new Software Image */ + command QueryImage(QueryImageRequest): QueryImageResponse = 0; + /** Determine next action to take for a downloaded Software Image */ + command ApplyUpdateRequest(ApplyUpdateRequestRequest): ApplyUpdateResponse = 2; + /** Notify OTA Provider that an update was applied */ + command NotifyUpdateApplied(NotifyUpdateAppliedRequest): DefaultSuccess = 4; +} + +/** Provides an interface for downloading and applying OTA software updates */ +server cluster OtaSoftwareUpdateRequestor = 42 { + enum OTAAnnouncementReason : ENUM8 { + kSimpleAnnouncement = 0; + kUpdateAvailable = 1; + kUrgentUpdateAvailable = 2; + } + + enum OTAChangeReasonEnum : ENUM8 { + kUnknown = 0; + kSuccess = 1; + kFailure = 2; + kTimeOut = 3; + kDelayByProvider = 4; + } + + enum OTAUpdateStateEnum : ENUM8 { + kUnknown = 0; + kIdle = 1; + kQuerying = 2; + kDelayedOnQuery = 3; + kDownloading = 4; + kApplying = 5; + kDelayedOnApply = 6; + kRollingBack = 7; + kDelayedOnUserConsent = 8; + } + + fabric_scoped struct ProviderLocation { + node_id providerNodeID = 1; + endpoint_no endpoint = 2; + fabric_idx fabricIndex = 254; + } + + info event StateTransition = 0 { + OTAUpdateStateEnum previousState = 0; + OTAUpdateStateEnum newState = 1; + OTAChangeReasonEnum reason = 2; + nullable INT32U targetSoftwareVersion = 3; + } + + critical event VersionApplied = 1 { + INT32U softwareVersion = 0; + INT16U productID = 1; + } + + info event DownloadError = 2 { + INT32U softwareVersion = 0; + INT64U bytesDownloaded = 1; + nullable INT8U progressPercent = 2; + nullable INT64S platformCode = 3; + } + + attribute ProviderLocation defaultOTAProviders[] = 0; + readonly attribute boolean updatePossible = 1; + readonly attribute OTAUpdateStateEnum updateState = 2; + readonly attribute nullable int8u updateStateProgress = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AnnounceOTAProviderRequest { + node_id providerNodeID = 0; + vendor_id vendorID = 1; + OTAAnnouncementReason announcementReason = 2; + optional OCTET_STRING<512> metadataForNode = 3; + endpoint_no endpoint = 4; + } + + command AnnounceOTAProvider(AnnounceOTAProviderRequest): DefaultSuccess = 0; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +server cluster LocalizationConfiguration = 43 { + attribute char_string<35> activeLocale = 0; + readonly attribute CHAR_STRING supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing preferences for how dates and times are conveyed. As such, Nodes that visually + or audibly convey time information need a mechanism by which they can be configured to use a + user’s preferred format. */ +server cluster TimeFormatLocalization = 44 { + enum CalendarTypeEnum : ENUM8 { + kBuddhist = 0; + kChinese = 1; + kCoptic = 2; + kEthiopian = 3; + kGregorian = 4; + kHebrew = 5; + kIndian = 6; + kIslamic = 7; + kJapanese = 8; + kKorean = 9; + kPersian = 10; + kTaiwanese = 11; + } + + enum HourFormatEnum : ENUM8 { + k12hr = 0; + k24hr = 1; + } + + bitmap Feature : BITMAP32 { + kCalendarFormat = 0x1; + } + + attribute HourFormatEnum hourFormat = 0; + attribute CalendarTypeEnum activeCalendarType = 1; + readonly attribute CalendarTypeEnum supportedCalendarTypes[] = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** This cluster is used to manage global aspects of the Commissioning flow. */ +server cluster GeneralCommissioning = 48 { + enum CommissioningErrorEnum : ENUM8 { + kOK = 0; + kValueOutsideRange = 1; + kInvalidAuthentication = 2; + kNoFailSafe = 3; + kBusyWithOtherAdmin = 4; + } + + enum RegulatoryLocationTypeEnum : ENUM8 { + kIndoor = 0; + kOutdoor = 1; + kIndoorOutdoor = 2; + } + + struct BasicCommissioningInfo { + int16u failSafeExpiryLengthSeconds = 0; + int16u maxCumulativeFailsafeSeconds = 1; + } + + attribute access(write: administer) int64u breadcrumb = 0; + readonly attribute BasicCommissioningInfo basicCommissioningInfo = 1; + readonly attribute RegulatoryLocationTypeEnum regulatoryConfig = 2; + readonly attribute RegulatoryLocationTypeEnum locationCapability = 3; + readonly attribute boolean supportsConcurrentConnection = 4; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ArmFailSafeRequest { + INT16U expiryLengthSeconds = 0; + INT64U breadcrumb = 1; + } + + request struct SetRegulatoryConfigRequest { + RegulatoryLocationTypeEnum newRegulatoryConfig = 0; + CHAR_STRING countryCode = 1; + INT64U breadcrumb = 2; + } + + response struct ArmFailSafeResponse = 1 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct SetRegulatoryConfigResponse = 3 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + response struct CommissioningCompleteResponse = 5 { + CommissioningErrorEnum errorCode = 0; + CHAR_STRING debugText = 1; + } + + command access(invoke: administer) ArmFailSafe(ArmFailSafeRequest): ArmFailSafeResponse = 0; + command access(invoke: administer) SetRegulatoryConfig(SetRegulatoryConfigRequest): SetRegulatoryConfigResponse = 2; + fabric command access(invoke: administer) CommissioningComplete(): CommissioningCompleteResponse = 4; +} + +/** Functionality to configure, enable, disable network credentials and access on a Matter device. */ +server cluster NetworkCommissioning = 49 { + enum NetworkCommissioningStatusEnum : ENUM8 { + kSuccess = 0; + kOutOfRange = 1; + kBoundsExceeded = 2; + kNetworkIDNotFound = 3; + kDuplicateNetworkID = 4; + kNetworkNotFound = 5; + kRegulatoryError = 6; + kAuthFailure = 7; + kUnsupportedSecurity = 8; + kOtherConnectionFailure = 9; + kIPV6Failed = 10; + kIPBindFailed = 11; + kUnknownError = 12; + } + + enum WiFiBandEnum : ENUM8 { + k2G4 = 0; + k3G65 = 1; + k5G = 2; + k6G = 3; + k60G = 4; + k1G = 5; + } + + bitmap Feature : BITMAP32 { + kWiFiNetworkInterface = 0x1; + kThreadNetworkInterface = 0x2; + kEthernetNetworkInterface = 0x4; + } + + bitmap WiFiSecurityBitmap : BITMAP8 { + kUnencrypted = 0x1; + kWEP = 0x2; + kWPAPersonal = 0x4; + kWPA2Personal = 0x8; + kWPA3Personal = 0x10; + } + + struct NetworkInfoStruct { + octet_string<32> networkID = 0; + boolean connected = 1; + } + + struct ThreadInterfaceScanResultStruct { + int16u panId = 0; + int64u extendedPanId = 1; + char_string<16> networkName = 2; + int16u channel = 3; + int8u version = 4; + octet_string<8> extendedAddress = 5; + int8s rssi = 6; + int8u lqi = 7; + } + + struct WiFiInterfaceScanResultStruct { + WiFiSecurityBitmap security = 0; + octet_string<32> ssid = 1; + octet_string<6> bssid = 2; + int16u channel = 3; + WiFiBandEnum wiFiBand = 4; + int8s rssi = 5; + } + + readonly attribute access(read: administer) int8u maxNetworks = 0; + readonly attribute access(read: administer) NetworkInfoStruct networks[] = 1; + readonly attribute int8u scanMaxTimeSeconds = 2; + readonly attribute int8u connectMaxTimeSeconds = 3; + attribute access(write: administer) boolean interfaceEnabled = 4; + readonly attribute access(read: administer) nullable NetworkCommissioningStatusEnum lastNetworkingStatus = 5; + readonly attribute access(read: administer) nullable octet_string<32> lastNetworkID = 6; + readonly attribute access(read: administer) nullable int32s lastConnectErrorValue = 7; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ScanNetworksRequest { + optional nullable OCTET_STRING<32> ssid = 0; + optional INT64U breadcrumb = 1; + } + + request struct AddOrUpdateWiFiNetworkRequest { + OCTET_STRING<32> ssid = 0; + OCTET_STRING<64> credentials = 1; + optional INT64U breadcrumb = 2; + } + + request struct AddOrUpdateThreadNetworkRequest { + OCTET_STRING<254> operationalDataset = 0; + optional INT64U breadcrumb = 1; + } + + request struct RemoveNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ConnectNetworkRequest { + OCTET_STRING<32> networkID = 0; + optional INT64U breadcrumb = 1; + } + + request struct ReorderNetworkRequest { + OCTET_STRING<32> networkID = 0; + INT8U networkIndex = 1; + optional INT64U breadcrumb = 2; + } + + response struct ScanNetworksResponse = 1 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + optional WiFiInterfaceScanResultStruct wiFiScanResults[] = 2; + optional ThreadInterfaceScanResultStruct threadScanResults[] = 3; + } + + response struct NetworkConfigResponse = 5 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING<512> debugText = 1; + optional INT8U networkIndex = 2; + } + + response struct ConnectNetworkResponse = 7 { + NetworkCommissioningStatusEnum networkingStatus = 0; + optional CHAR_STRING debugText = 1; + nullable INT32S errorValue = 2; + } + + command access(invoke: administer) ScanNetworks(ScanNetworksRequest): ScanNetworksResponse = 0; + command access(invoke: administer) AddOrUpdateWiFiNetwork(AddOrUpdateWiFiNetworkRequest): NetworkConfigResponse = 2; + command access(invoke: administer) AddOrUpdateThreadNetwork(AddOrUpdateThreadNetworkRequest): NetworkConfigResponse = 3; + command access(invoke: administer) RemoveNetwork(RemoveNetworkRequest): NetworkConfigResponse = 4; + command access(invoke: administer) ConnectNetwork(ConnectNetworkRequest): ConnectNetworkResponse = 6; + command access(invoke: administer) ReorderNetwork(ReorderNetworkRequest): NetworkConfigResponse = 8; +} + +/** The cluster provides commands for retrieving unstructured diagnostic logs from a Node that may be used to aid in diagnostics. */ +server cluster DiagnosticLogs = 50 { + enum IntentEnum : ENUM8 { + kEndUserSupport = 0; + kNetworkDiag = 1; + kCrashLogs = 2; + } + + enum StatusEnum : ENUM8 { + kSuccess = 0; + kExhausted = 1; + kNoLogs = 2; + kBusy = 3; + kDenied = 4; + } + + enum TransferProtocolEnum : ENUM8 { + kResponsePayload = 0; + kBDX = 1; + } + + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RetrieveLogsRequestRequest { + IntentEnum intent = 0; + TransferProtocolEnum requestedProtocol = 1; + optional CHAR_STRING<32> transferFileDesignator = 2; + } + + command RetrieveLogsRequest(RetrieveLogsRequestRequest): RetrieveLogsResponse = 0; +} + +/** The General Diagnostics Cluster, along with other diagnostics clusters, provide a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster GeneralDiagnostics = 51 { + enum BootReasonEnum : ENUM8 { + kUnspecified = 0; + kPowerOnReboot = 1; + kBrownOutReset = 2; + kSoftwareWatchdogReset = 3; + kHardwareWatchdogReset = 4; + kSoftwareUpdateCompleted = 5; + kSoftwareReset = 6; + } + + enum HardwareFaultEnum : ENUM8 { + kUnspecified = 0; + kRadio = 1; + kSensor = 2; + kResettableOverTemp = 3; + kNonResettableOverTemp = 4; + kPowerSource = 5; + kVisualDisplayFault = 6; + kAudioOutputFault = 7; + kUserInterfaceFault = 8; + kNonVolatileMemoryError = 9; + kTamperDetected = 10; + } + + enum InterfaceTypeEnum : ENUM8 { + kUnspecified = 0; + kWiFi = 1; + kEthernet = 2; + kCellular = 3; + kThread = 4; + } + + enum NetworkFaultEnum : ENUM8 { + kUnspecified = 0; + kHardwareFailure = 1; + kNetworkJammed = 2; + kConnectionFailed = 3; + } + + enum RadioFaultEnum : ENUM8 { + kUnspecified = 0; + kWiFiFault = 1; + kCellularFault = 2; + kThreadFault = 3; + kNFCFault = 4; + kBLEFault = 5; + kEthernetFault = 6; + } + + struct NetworkInterface { + char_string<32> name = 0; + boolean isOperational = 1; + nullable boolean offPremiseServicesReachableIPv4 = 2; + nullable boolean offPremiseServicesReachableIPv6 = 3; + octet_string<8> hardwareAddress = 4; + octet_string IPv4Addresses[] = 5; + octet_string IPv6Addresses[] = 6; + InterfaceTypeEnum type = 7; + } + + critical event HardwareFaultChange = 0 { + HardwareFaultEnum current[] = 0; + HardwareFaultEnum previous[] = 1; + } + + critical event RadioFaultChange = 1 { + RadioFaultEnum current[] = 0; + RadioFaultEnum previous[] = 1; + } + + critical event NetworkFaultChange = 2 { + NetworkFaultEnum current[] = 0; + NetworkFaultEnum previous[] = 1; + } + + critical event BootReason = 3 { + BootReasonEnum bootReason = 0; + } + + readonly attribute NetworkInterface networkInterfaces[] = 0; + readonly attribute int16u rebootCount = 1; + readonly attribute int64u upTime = 2; + readonly attribute int32u totalOperationalHours = 3; + readonly attribute BootReasonEnum bootReason = 4; + readonly attribute HardwareFaultEnum activeHardwareFaults[] = 5; + readonly attribute RadioFaultEnum activeRadioFaults[] = 6; + readonly attribute NetworkFaultEnum activeNetworkFaults[] = 7; + readonly attribute boolean testEventTriggersEnabled = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct TestEventTriggerRequest { + OCTET_STRING<16> enableKey = 0; + INT64U eventTrigger = 1; + } + + command access(invoke: manage) TestEventTrigger(TestEventTriggerRequest): DefaultSuccess = 0; +} + +/** The Software Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster SoftwareDiagnostics = 52 { + bitmap Feature : BITMAP32 { + kWaterMarks = 0x1; + } + + struct ThreadMetricsStruct { + int64u id = 0; + optional char_string<8> name = 1; + optional int32u stackFreeCurrent = 2; + optional int32u stackFreeMinimum = 3; + optional int32u stackSize = 4; + } + + info event SoftwareFault = 0 { + INT64U id = 0; + optional CHAR_STRING name = 1; + optional OCTET_STRING faultRecording = 2; + } + + readonly attribute int64u currentHeapFree = 1; + readonly attribute int64u currentHeapUsed = 2; + readonly attribute int64u currentHeapHighWatermark = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command ResetWatermarks(): DefaultSuccess = 0; +} + +/** The Ethernet Network Diagnostics Cluster provides a means to acquire standardized diagnostics metrics that MAY be used by a Node to assist a user or Administrative Node in diagnosing potential problems. */ +server cluster EthernetNetworkDiagnostics = 55 { + enum PHYRateEnum : ENUM8 { + kRate10M = 0; + kRate100M = 1; + kRate1G = 2; + kRate25G = 3; + kRate5G = 4; + kRate10G = 5; + kRate40G = 6; + kRate100G = 7; + kRate200G = 8; + kRate400G = 9; + } + + bitmap Feature : BITMAP32 { + kPacketCounts = 0x1; + kErrorCounts = 0x2; + } + + readonly attribute nullable PHYRateEnum PHYRate = 0; + readonly attribute nullable boolean fullDuplex = 1; + readonly attribute int64u packetRxCount = 2; + readonly attribute int64u packetTxCount = 3; + readonly attribute int64u txErrCount = 4; + readonly attribute int64u collisionCount = 5; + readonly attribute int64u overrunCount = 6; + readonly attribute nullable boolean carrierDetect = 7; + readonly attribute int64u timeSinceReset = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command ResetCounts(): DefaultSuccess = 0; +} + +/** Commands to trigger a Node to allow a new Administrator to commission it. */ +server cluster AdministratorCommissioning = 60 { + enum CommissioningWindowStatusEnum : ENUM8 { + kWindowNotOpen = 0; + kEnhancedWindowOpen = 1; + kBasicWindowOpen = 2; + } + + enum StatusCode : ENUM8 { + kBusy = 2; + kPAKEParameterError = 3; + kWindowNotOpen = 4; + } + + readonly attribute CommissioningWindowStatusEnum windowStatus = 0; + readonly attribute nullable fabric_idx adminFabricIndex = 1; + readonly attribute nullable int16u adminVendorId = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OpenCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + OCTET_STRING PAKEPasscodeVerifier = 1; + INT16U discriminator = 2; + INT32U iterations = 3; + OCTET_STRING salt = 4; + } + + request struct OpenBasicCommissioningWindowRequest { + INT16U commissioningTimeout = 0; + } + + timed command access(invoke: administer) OpenCommissioningWindow(OpenCommissioningWindowRequest): DefaultSuccess = 0; + timed command access(invoke: administer) OpenBasicCommissioningWindow(OpenBasicCommissioningWindowRequest): DefaultSuccess = 1; + timed command access(invoke: administer) RevokeCommissioning(): DefaultSuccess = 2; +} + +/** This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the associated Fabrics. */ +server cluster OperationalCredentials = 62 { + enum CertificateChainTypeEnum : ENUM8 { + kDACCertificate = 1; + kPAICertificate = 2; + } + + enum NodeOperationalCertStatusEnum : ENUM8 { + kOK = 0; + kInvalidPublicKey = 1; + kInvalidNodeOpId = 2; + kInvalidNOC = 3; + kMissingCsr = 4; + kTableFull = 5; + kInvalidAdminSubject = 6; + kFabricConflict = 9; + kLabelConflict = 10; + kInvalidFabricIndex = 11; + } + + fabric_scoped struct FabricDescriptorStruct { + octet_string<65> rootPublicKey = 1; + vendor_id vendorID = 2; + fabric_id fabricID = 3; + node_id nodeID = 4; + char_string<32> label = 5; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct NOCStruct { + fabric_sensitive octet_string noc = 1; + nullable fabric_sensitive octet_string icac = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute access(read: administer) NOCStruct NOCs[] = 0; + readonly attribute FabricDescriptorStruct fabrics[] = 1; + readonly attribute int8u supportedFabrics = 2; + readonly attribute int8u commissionedFabrics = 3; + readonly attribute OCTET_STRING trustedRootCertificates[] = 4; + readonly attribute int8u currentFabricIndex = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct AttestationRequestRequest { + OCTET_STRING attestationNonce = 0; + } + + request struct CertificateChainRequestRequest { + CertificateChainTypeEnum certificateType = 0; + } + + request struct CSRRequestRequest { + OCTET_STRING CSRNonce = 0; + optional boolean isForUpdateNOC = 1; + } + + request struct AddNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + OCTET_STRING IPKValue = 2; + Int64u caseAdminSubject = 3; + VENDOR_ID adminVendorId = 4; + } + + request struct UpdateNOCRequest { + OCTET_STRING NOCValue = 0; + optional OCTET_STRING ICACValue = 1; + } + + request struct UpdateFabricLabelRequest { + CHAR_STRING<32> label = 0; + } + + request struct RemoveFabricRequest { + fabric_idx fabricIndex = 0; + } + + request struct AddTrustedRootCertificateRequest { + OCTET_STRING rootCACertificate = 0; + } + + response struct AttestationResponse = 1 { + OCTET_STRING attestationElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct CertificateChainResponse = 3 { + OCTET_STRING certificate = 0; + } + + response struct CSRResponse = 5 { + OCTET_STRING NOCSRElements = 0; + OCTET_STRING attestationSignature = 1; + } + + response struct NOCResponse = 8 { + NodeOperationalCertStatusEnum statusCode = 0; + optional fabric_idx fabricIndex = 1; + optional CHAR_STRING debugText = 2; + } + + command access(invoke: administer) AttestationRequest(AttestationRequestRequest): AttestationResponse = 0; + command access(invoke: administer) CertificateChainRequest(CertificateChainRequestRequest): CertificateChainResponse = 2; + command access(invoke: administer) CSRRequest(CSRRequestRequest): CSRResponse = 4; + command access(invoke: administer) AddNOC(AddNOCRequest): NOCResponse = 6; + fabric command access(invoke: administer) UpdateNOC(UpdateNOCRequest): NOCResponse = 7; + fabric command access(invoke: administer) UpdateFabricLabel(UpdateFabricLabelRequest): NOCResponse = 9; + command access(invoke: administer) RemoveFabric(RemoveFabricRequest): NOCResponse = 10; + command access(invoke: administer) AddTrustedRootCertificate(AddTrustedRootCertificateRequest): DefaultSuccess = 11; +} + +/** The Group Key Management Cluster is the mechanism by which group keys are managed. */ +server cluster GroupKeyManagement = 63 { + enum GroupKeySecurityPolicyEnum : ENUM8 { + kTrustFirst = 0; + kCacheAndSync = 1; + } + + bitmap Feature : BITMAP32 { + kCacheAndSync = 0x1; + } + + fabric_scoped struct GroupInfoMapStruct { + group_id groupId = 1; + endpoint_no endpoints[] = 2; + optional char_string<16> groupName = 3; + fabric_idx fabricIndex = 254; + } + + fabric_scoped struct GroupKeyMapStruct { + group_id groupId = 1; + int16u groupKeySetID = 2; + fabric_idx fabricIndex = 254; + } + + struct GroupKeySetStruct { + int16u groupKeySetID = 0; + GroupKeySecurityPolicyEnum groupKeySecurityPolicy = 1; + nullable octet_string<16> epochKey0 = 2; + nullable epoch_us epochStartTime0 = 3; + nullable octet_string<16> epochKey1 = 4; + nullable epoch_us epochStartTime1 = 5; + nullable octet_string<16> epochKey2 = 6; + nullable epoch_us epochStartTime2 = 7; + } + + attribute access(write: manage) GroupKeyMapStruct groupKeyMap[] = 0; + readonly attribute GroupInfoMapStruct groupTable[] = 1; + readonly attribute int16u maxGroupsPerFabric = 2; + readonly attribute int16u maxGroupKeysPerFabric = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct KeySetWriteRequest { + GroupKeySetStruct groupKeySet = 0; + } + + request struct KeySetReadRequest { + INT16U groupKeySetID = 0; + } + + request struct KeySetRemoveRequest { + INT16U groupKeySetID = 0; + } + + response struct KeySetReadResponse = 2 { + GroupKeySetStruct groupKeySet = 0; + } + + response struct KeySetReadAllIndicesResponse = 5 { + INT16U groupKeySetIDs[] = 0; + } + + fabric command access(invoke: administer) KeySetWrite(KeySetWriteRequest): DefaultSuccess = 0; + fabric command access(invoke: administer) KeySetRead(KeySetReadRequest): KeySetReadResponse = 1; + fabric command access(invoke: administer) KeySetRemove(KeySetRemoveRequest): DefaultSuccess = 3; + fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; +} + +/** The Fixed Label Cluster provides a feature for the device to tag an endpoint with zero or more read only +labels. */ +server cluster FixedLabel = 64 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + readonly attribute LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** The User Label Cluster provides a feature to tag an endpoint with zero or more labels. */ +server cluster UserLabel = 65 { + struct LabelStruct { + char_string<16> label = 0; + char_string<16> value = 1; + } + + attribute access(write: manage) LabelStruct labelList[] = 0; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + +/** Attributes and commands for controlling the color properties of a color-capable light. */ +server cluster ColorControl = 768 { + enum ColorLoopAction : ENUM8 { + kDeactivate = 0; + kActivateFromColorLoopStartEnhancedHue = 1; + kActivateFromEnhancedCurrentHue = 2; + } + + enum ColorLoopDirection : ENUM8 { + kDecrementHue = 0; + kIncrementHue = 1; + } + + enum ColorMode : ENUM8 { + kCurrentHueAndCurrentSaturation = 0; + kCurrentXAndCurrentY = 1; + kColorTemperature = 2; + } + + enum HueDirection : ENUM8 { + kShortestDistance = 0; + kLongestDistance = 1; + kUp = 2; + kDown = 3; + } + + enum HueMoveMode : ENUM8 { + kStop = 0; + kUp = 1; + kDown = 3; + } + + enum HueStepMode : ENUM8 { + kUp = 1; + kDown = 3; + } + + enum SaturationMoveMode : ENUM8 { + kStop = 0; + kUp = 1; + kDown = 3; + } + + enum SaturationStepMode : ENUM8 { + kUp = 1; + kDown = 3; + } + + bitmap ColorCapabilities : BITMAP16 { + kHueSaturationSupported = 0x1; + kEnhancedHueSupported = 0x2; + kColorLoopSupported = 0x4; + kXYAttributesSupported = 0x8; + kColorTemperatureSupported = 0x10; + } + + bitmap ColorLoopUpdateFlags : BITMAP8 { + kUpdateAction = 0x1; + kUpdateDirection = 0x2; + kUpdateTime = 0x4; + kUpdateStartHue = 0x8; + } + + bitmap Feature : BITMAP32 { + kHueAndSaturation = 0x1; + kEnhancedHue = 0x2; + kColorLoop = 0x4; + kXY = 0x8; + kColorTemperature = 0x10; + } + + readonly attribute int8u currentHue = 0; + readonly attribute int8u currentSaturation = 1; + readonly attribute int16u remainingTime = 2; + readonly attribute int16u currentX = 3; + readonly attribute int16u currentY = 4; + readonly attribute int16u colorTemperatureMireds = 7; + readonly attribute enum8 colorMode = 8; + attribute bitmap8 options = 15; + readonly attribute nullable int8u numberOfPrimaries = 16; + readonly attribute int16u primary1X = 17; + readonly attribute int16u primary1Y = 18; + readonly attribute nullable int8u primary1Intensity = 19; + readonly attribute int16u primary2X = 21; + readonly attribute int16u primary2Y = 22; + readonly attribute nullable int8u primary2Intensity = 23; + readonly attribute int16u primary3X = 25; + readonly attribute int16u primary3Y = 26; + readonly attribute nullable int8u primary3Intensity = 27; + readonly attribute int16u primary4X = 32; + readonly attribute int16u primary4Y = 33; + readonly attribute nullable int8u primary4Intensity = 34; + readonly attribute int16u primary5X = 36; + readonly attribute int16u primary5Y = 37; + readonly attribute nullable int8u primary5Intensity = 38; + readonly attribute int16u primary6X = 40; + readonly attribute int16u primary6Y = 41; + readonly attribute nullable int8u primary6Intensity = 42; + readonly attribute int16u enhancedCurrentHue = 16384; + readonly attribute enum8 enhancedColorMode = 16385; + readonly attribute int8u colorLoopActive = 16386; + readonly attribute int8u colorLoopDirection = 16387; + readonly attribute int16u colorLoopTime = 16388; + readonly attribute int16u colorLoopStartEnhancedHue = 16389; + readonly attribute int16u colorLoopStoredEnhancedHue = 16390; + readonly attribute bitmap16 colorCapabilities = 16394; + readonly attribute int16u colorTempPhysicalMinMireds = 16395; + readonly attribute int16u colorTempPhysicalMaxMireds = 16396; + readonly attribute int16u coupleColorTempToLevelMinMireds = 16397; + attribute access(write: manage) nullable int16u startUpColorTemperatureMireds = 16400; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct MoveToHueRequest { + INT8U hue = 0; + HueDirection direction = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveHueRequest { + HueMoveMode moveMode = 0; + INT8U rate = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct StepHueRequest { + HueStepMode stepMode = 0; + INT8U stepSize = 1; + INT8U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveToSaturationRequest { + INT8U saturation = 0; + INT16U transitionTime = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct MoveSaturationRequest { + SaturationMoveMode moveMode = 0; + INT8U rate = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct StepSaturationRequest { + SaturationStepMode stepMode = 0; + INT8U stepSize = 1; + INT8U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveToHueAndSaturationRequest { + INT8U hue = 0; + INT8U saturation = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveToColorRequest { + INT16U colorX = 0; + INT16U colorY = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveColorRequest { + INT16S rateX = 0; + INT16S rateY = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct StepColorRequest { + INT16S stepX = 0; + INT16S stepY = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct MoveToColorTemperatureRequest { + INT16U colorTemperatureMireds = 0; + INT16U transitionTime = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct EnhancedMoveToHueRequest { + INT16U enhancedHue = 0; + HueDirection direction = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct EnhancedMoveHueRequest { + HueMoveMode moveMode = 0; + INT16U rate = 1; + BITMAP8 optionsMask = 2; + BITMAP8 optionsOverride = 3; + } + + request struct EnhancedStepHueRequest { + HueStepMode stepMode = 0; + INT16U stepSize = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct EnhancedMoveToHueAndSaturationRequest { + INT16U enhancedHue = 0; + INT8U saturation = 1; + INT16U transitionTime = 2; + BITMAP8 optionsMask = 3; + BITMAP8 optionsOverride = 4; + } + + request struct ColorLoopSetRequest { + ColorLoopUpdateFlags updateFlags = 0; + ColorLoopAction action = 1; + ColorLoopDirection direction = 2; + INT16U time = 3; + INT16U startHue = 4; + BITMAP8 optionsMask = 5; + BITMAP8 optionsOverride = 6; + } + + request struct StopMoveStepRequest { + BITMAP8 optionsMask = 0; + BITMAP8 optionsOverride = 1; + } + + request struct MoveColorTemperatureRequest { + HueMoveMode moveMode = 0; + INT16U rate = 1; + INT16U colorTemperatureMinimumMireds = 2; + INT16U colorTemperatureMaximumMireds = 3; + BITMAP8 optionsMask = 4; + BITMAP8 optionsOverride = 5; + } + + request struct StepColorTemperatureRequest { + HueStepMode stepMode = 0; + INT16U stepSize = 1; + INT16U transitionTime = 2; + INT16U colorTemperatureMinimumMireds = 3; + INT16U colorTemperatureMaximumMireds = 4; + BITMAP8 optionsMask = 5; + BITMAP8 optionsOverride = 6; + } + + command MoveToHue(MoveToHueRequest): DefaultSuccess = 0; + command MoveHue(MoveHueRequest): DefaultSuccess = 1; + command StepHue(StepHueRequest): DefaultSuccess = 2; + command MoveToSaturation(MoveToSaturationRequest): DefaultSuccess = 3; + command MoveSaturation(MoveSaturationRequest): DefaultSuccess = 4; + command StepSaturation(StepSaturationRequest): DefaultSuccess = 5; + command MoveToHueAndSaturation(MoveToHueAndSaturationRequest): DefaultSuccess = 6; + command MoveToColor(MoveToColorRequest): DefaultSuccess = 7; + command MoveColor(MoveColorRequest): DefaultSuccess = 8; + command StepColor(StepColorRequest): DefaultSuccess = 9; + command MoveToColorTemperature(MoveToColorTemperatureRequest): DefaultSuccess = 10; + command EnhancedMoveToHue(EnhancedMoveToHueRequest): DefaultSuccess = 64; + command EnhancedMoveHue(EnhancedMoveHueRequest): DefaultSuccess = 65; + command EnhancedStepHue(EnhancedStepHueRequest): DefaultSuccess = 66; + command EnhancedMoveToHueAndSaturation(EnhancedMoveToHueAndSaturationRequest): DefaultSuccess = 67; + command ColorLoopSet(ColorLoopSetRequest): DefaultSuccess = 68; + command StopMoveStep(StopMoveStepRequest): DefaultSuccess = 71; + command MoveColorTemperature(MoveColorTemperatureRequest): DefaultSuccess = 75; + command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; +} + +endpoint 0 { + device type ma_rootdevice = 22, version 1; + + binding cluster OtaSoftwareUpdateProvider; + + server cluster AccessControl { + emits event AccessControlEntryChanged; + emits event AccessControlExtensionChanged; + callback attribute acl; + callback attribute extension; + callback attribute subjectsPerAccessControlEntry default = 4; + callback attribute targetsPerAccessControlEntry default = 3; + callback attribute accessControlEntriesPerFabric default = 4; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster BasicInformation { + emits event StartUp; + emits event ShutDown; + emits event Leave; + callback attribute dataModelRevision default = 10; + callback attribute vendorName; + callback attribute vendorID; + callback attribute productName; + callback attribute productID; + persist attribute nodeLabel; + callback attribute location default = "XX"; + callback attribute hardwareVersion default = 0; + callback attribute hardwareVersionString; + callback attribute softwareVersion default = 0; + callback attribute softwareVersionString; + callback attribute manufacturingDate default = "20210614123456ZZ"; + callback attribute partNumber; + callback attribute productURL; + callback attribute productLabel; + callback attribute serialNumber; + persist attribute localConfigDisabled default = 0; + callback attribute uniqueID; + callback attribute capabilityMinima; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OtaSoftwareUpdateRequestor { + emits event StateTransition; + emits event VersionApplied; + emits event DownloadError; + callback attribute defaultOTAProviders default = 0; + ram attribute updatePossible default = 1; + ram attribute updateState default = 0; + ram attribute updateStateProgress default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster LocalizationConfiguration { + persist attribute activeLocale default = "en-US"; + callback attribute supportedLocales; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster TimeFormatLocalization { + persist attribute hourFormat default = 0; + persist attribute activeCalendarType default = 0; + callback attribute supportedCalendarTypes; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralCommissioning { + ram attribute breadcrumb default = 0x0000000000000000; + callback attribute basicCommissioningInfo; + callback attribute regulatoryConfig default = 0; + callback attribute locationCapability default = 0; + callback attribute supportsConcurrentConnection default = 1; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster NetworkCommissioning { + ram attribute maxNetworks; + callback attribute networks; + ram attribute scanMaxTimeSeconds; + ram attribute connectMaxTimeSeconds; + ram attribute interfaceEnabled; + ram attribute lastNetworkingStatus; + ram attribute lastNetworkID; + ram attribute lastConnectErrorValue; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + + server cluster DiagnosticLogs { + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GeneralDiagnostics { + emits event HardwareFaultChange; + emits event RadioFaultChange; + emits event NetworkFaultChange; + emits event BootReason; + callback attribute networkInterfaces; + callback attribute rebootCount default = 0x0000; + callback attribute upTime default = 0x0000000000000000; + callback attribute totalOperationalHours default = 0x00000000; + callback attribute bootReason; + callback attribute activeHardwareFaults; + callback attribute activeRadioFaults; + callback attribute activeNetworkFaults; + callback attribute testEventTriggersEnabled default = false; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster SoftwareDiagnostics { + callback attribute currentHeapFree default = 0x0000000000000000; + callback attribute currentHeapUsed default = 0x0000000000000000; + callback attribute currentHeapHighWatermark default = 0x0000000000000000; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + } + + server cluster EthernetNetworkDiagnostics { + callback attribute PHYRate; + callback attribute fullDuplex default = 0x00; + callback attribute packetRxCount default = 0x0000000000000000; + callback attribute packetTxCount default = 0x0000000000000000; + callback attribute txErrCount default = 0x0000000000000000; + callback attribute collisionCount default = 0x0000000000000000; + callback attribute overrunCount default = 0x0000000000000000; + callback attribute carrierDetect default = 0x00; + callback attribute timeSinceReset default = 0x0000000000000000; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 1; + } + + server cluster AdministratorCommissioning { + callback attribute windowStatus default = 0; + callback attribute adminFabricIndex default = 1; + callback attribute adminVendorId default = 0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster OperationalCredentials { + callback attribute NOCs; + callback attribute fabrics; + callback attribute supportedFabrics; + callback attribute commissionedFabrics; + callback attribute trustedRootCertificates; + callback attribute currentFabricIndex; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster GroupKeyManagement { + callback attribute groupKeyMap; + callback attribute groupTable; + callback attribute maxGroupsPerFabric; + callback attribute maxGroupKeysPerFabric; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster FixedLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + + server cluster UserLabel { + callback attribute labelList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } +} +endpoint 1 { + device type ma_extendedcolorlight = 269, version 1; + + + server cluster Identify { + ram attribute identifyTime default = 0x0000; + ram attribute identifyType default = 0x0; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + } + + server cluster Groups { + ram attribute nameSupport; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 4; + } + + server cluster OnOff { + persist attribute onOff default = 0x1; + ram attribute globalSceneControl default = 0x01; + ram attribute onTime default = 0x0000; + ram attribute offWaitTime default = 0x0000; + persist attribute startUpOnOff; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 5; + } + + server cluster LevelControl { + persist attribute currentLevel default = 0x254; + ram attribute remainingTime default = 0x0000; + ram attribute minLevel default = 0x01; + ram attribute maxLevel default = 0xFE; + ram attribute currentFrequency default = 0x0000; + ram attribute minFrequency default = 0x0000; + ram attribute maxFrequency default = 0x0000; + ram attribute options default = 0x00; + ram attribute onOffTransitionTime default = 0x0000; + ram attribute onLevel; + ram attribute onTransitionTime; + ram attribute offTransitionTime; + ram attribute defaultMoveRate default = 50; + persist attribute startUpCurrentLevel; + ram attribute featureMap default = 3; + ram attribute clusterRevision default = 5; + } + + server cluster Descriptor { + callback attribute deviceTypeList; + callback attribute serverList; + callback attribute clientList; + callback attribute partsList; + ram attribute featureMap default = 0; + callback attribute clusterRevision default = 1; + } + + server cluster ColorControl { + ram attribute currentHue default = 0x00; + ram attribute currentSaturation default = 0x00; + ram attribute remainingTime default = 0x0000; + ram attribute currentX default = 0x616B; + ram attribute currentY default = 0x607D; + ram attribute colorTemperatureMireds default = 0x00FA; + ram attribute colorMode default = 0x01; + ram attribute options default = 0x00; + ram attribute numberOfPrimaries; + ram attribute primary1X; + ram attribute primary1Y; + ram attribute primary1Intensity; + ram attribute primary2X; + ram attribute primary2Y; + ram attribute primary2Intensity; + ram attribute primary3X; + ram attribute primary3Y; + ram attribute primary3Intensity; + ram attribute primary4X; + ram attribute primary4Y; + ram attribute primary4Intensity; + ram attribute primary5X; + ram attribute primary5Y; + ram attribute primary5Intensity; + ram attribute primary6X; + ram attribute primary6Y; + ram attribute primary6Intensity; + ram attribute enhancedCurrentHue default = 0x0000; + ram attribute enhancedColorMode default = 0x01; + ram attribute colorLoopActive default = 0x00; + ram attribute colorLoopDirection default = 0x00; + ram attribute colorLoopTime default = 0x0019; + ram attribute colorLoopStartEnhancedHue default = 0x2300; + ram attribute colorLoopStoredEnhancedHue default = 0x0000; + ram attribute colorCapabilities default = 0x1F; + ram attribute colorTempPhysicalMinMireds default = 0x0000; + ram attribute colorTempPhysicalMaxMireds default = 0xFEFF; + ram attribute coupleColorTempToLevelMinMireds; + ram attribute startUpColorTemperatureMireds; + ram attribute featureMap default = 0x1F; + ram attribute clusterRevision default = 6; + } +} + + diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap new file mode 100644 index 00000000000000..e8e05aaba1f75c --- /dev/null +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -0,0 +1,8384 @@ +{ + "featureLevel": 98, + "creator": "zap", + "keyValuePairs": [ + { + "key": "commandDiscovery", + "value": "1" + }, + { + "key": "defaultResponsePolicy", + "value": "always" + }, + { + "key": "manufacturerCodes", + "value": "0x1002" + } + ], + "package": [ + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/zcl/zcl.json", + "type": "zcl-properties", + "category": "matter", + "version": 1, + "description": "Matter SDK ZCL data" + }, + { + "pathRelativity": "relativeToZap", + "path": "../../../../src/app/zap-templates/app-templates.json", + "type": "gen-templates-json", + "version": "chip-v1" + } + ], + "endpointTypes": [ + { + "id": 1, + "name": "MA-rootdevice", + "deviceTypeRef": { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + }, + "deviceTypes": [ + { + "code": 22, + "profileId": 259, + "label": "MA-rootdevice", + "name": "MA-rootdevice" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 22 + ], + "deviceTypeName": "MA-rootdevice", + "deviceTypeCode": 22, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/off Switch Configuration", + "code": 7, + "mfgCode": null, + "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "switch type", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "switch actions", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Access Control", + "code": 31, + "mfgCode": null, + "define": "ACCESS_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ACL", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Extension", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SubjectsPerAccessControlEntry", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TargetsPerAccessControlEntry", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AccessControlEntriesPerFabric", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "AccessControlEntryChanged", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AccessControlExtensionChanged", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 0, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StartUp", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ShutDown", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "Leave", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ + { + "name": "QueryImage", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ApplyUpdateRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "NotifyUpdateApplied", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Provider", + "code": 41, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "QueryImageResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ApplyUpdateResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AnnounceOTAProvider", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "OTA Software Update Requestor", + "code": 42, + "mfgCode": null, + "define": "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DefaultOTAProviders", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "UpdatePossible", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateState", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OTAUpdateStateEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpdateStateProgress", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "StateTransition", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "VersionApplied", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "DownloadError", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "en-US", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Time Format Localization", + "code": 44, + "mfgCode": null, + "define": "TIME_FORMAT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "HourFormat", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "HourFormatEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveCalendarType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "CalendarTypeEnum", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedCalendarTypes", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Unit Localization", + "code": 45, + "mfgCode": null, + "define": "UNIT_LOCALIZATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "TemperatureUnit", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "TempUnitEnum", + "included": 0, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ArmFailSafe", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfig", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CommissioningComplete", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Commissioning", + "code": 48, + "mfgCode": null, + "define": "GENERAL_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ArmFailSafeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "SetRegulatoryConfigResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "CommissioningCompleteResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "Breadcrumb", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BasicCommissioningInfo", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "BasicCommissioningInfo", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RegulatoryConfig", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LocationCapability", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "RegulatoryLocationTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportsConcurrentConnection", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ScanNetworks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddOrUpdateWiFiNetwork", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddOrUpdateThreadNetwork", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveNetwork", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ConnectNetwork", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ReorderNetwork", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Network Commissioning", + "code": 49, + "mfgCode": null, + "define": "NETWORK_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ScanNetworksResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NetworkConfigResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ConnectNetworkResponse", + "code": 7, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "MaxNetworks", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Networks", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ScanMaxTimeSeconds", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ConnectMaxTimeSeconds", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "InterfaceEnabled", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkingStatus", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "NetworkCommissioningStatusEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastNetworkID", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "LastConnectErrorValue", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32s", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Diagnostic Logs", + "code": 50, + "mfgCode": null, + "define": "DIAGNOSTIC_LOGS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "RetrieveLogsRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "General Diagnostics", + "code": 51, + "mfgCode": null, + "define": "GENERAL_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "TestEventTrigger", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "NetworkInterfaces", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RebootCount", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UpTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TotalOperationalHours", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BootReason", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "BootReasonEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveHardwareFaults", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveRadioFaults", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaults", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TestEventTriggersEnabled", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "false", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "HardwareFaultChange", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "RadioFaultChange", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "NetworkFaultChange", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "BootReason", + "code": 3, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetWatermarks", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Software Diagnostics", + "code": 52, + "mfgCode": null, + "define": "SOFTWARE_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ThreadMetrics", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapFree", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapUsed", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentHeapHighWatermark", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Thread Network Diagnostics", + "code": 53, + "mfgCode": null, + "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Channel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RoutingRole", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "RoutingRoleEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NetworkName", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PanId", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ExtendedPanId", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MeshLocalPrefix", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NeighborTable", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouteTable", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionId", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Weighting", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DataVersion", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StableDataVersion", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRouterId", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DetachedRoleCount", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChildRoleCount", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RouterRoleCount", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LeaderRoleCount", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "AttachAttemptCount", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartitionIdChangeCount", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BetterPartitionAttachAttemptCount", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ParentChangeCount", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxTotalCount", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxUnicastCount", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBroadcastCount", + "code": 24, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckRequestedCount", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxAckedCount", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxNoAckRequestedCount", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataCount", + "code": 28, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDataPollCount", + "code": 29, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconCount", + "code": 30, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxBeaconRequestCount", + "code": 31, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxOtherCount", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxRetryCount", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxDirectMaxRetryExpiryCount", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxIndirectMaxRetryExpiryCount", + "code": 35, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCcaCount", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrAbortCount", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrBusyChannelCount", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxTotalCount", + "code": 39, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxUnicastCount", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBroadcastCount", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataCount", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDataPollCount", + "code": 43, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconCount", + "code": 44, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxBeaconRequestCount", + "code": 45, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxOtherCount", + "code": 46, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxAddressFilteredCount", + "code": 47, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDestAddrFilteredCount", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxDuplicatedCount", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrNoFrameCount", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrUnknownNeighborCount", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrInvalidSrcAddrCount", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrSecCount", + "code": 53, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrFcsCount", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RxErrOtherCount", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveTimestamp", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PendingTimestamp", + "code": 57, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Delay", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SecurityPolicy", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "SecurityPolicy", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelPage0Mask", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OperationalDatasetComponents", + "code": 61, + "mfgCode": null, + "side": "server", + "type": "OperationalDatasetComponents", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ActiveNetworkFaultsList", + "code": 62, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x000F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 0, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "WiFi Network Diagnostics", + "code": 54, + "mfgCode": null, + "define": "WIFI_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "BSSID", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "octet_string", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SecurityType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "SecurityTypeEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "WiFiVersion", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "WiFiVersionEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ChannelNumber", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RSSI", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int8s", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "BeaconLostCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "BeaconRxCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastRxCount", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketMulticastTxCount", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastRxCount", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketUnicastTxCount", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMaxRate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "Disconnection", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "AssociationFailure", + "code": 1, + "mfgCode": null, + "side": "server", + "included": 1 + }, + { + "name": "ConnectionStatus", + "code": 2, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "ResetCounts", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Ethernet Network Diagnostics", + "code": 55, + "mfgCode": null, + "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "PHYRate", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "PHYRateEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FullDuplex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PacketRxCount", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PacketTxCount", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TxErrCount", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CollisionCount", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OverrunCount", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CarrierDetect", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "TimeSinceReset", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "int64u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000000000000000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Switch", + "code": 59, + "mfgCode": null, + "define": "SWITCH_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "NumberOfPositions", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentPosition", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "OpenCommissioningWindow", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "OpenBasicCommissioningWindow", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RevokeCommissioning", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Administrator Commissioning", + "code": 60, + "mfgCode": null, + "define": "ADMINISTRATOR_COMMISSIONING_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "WindowStatus", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "CommissioningWindowStatusEnum", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminFabricIndex", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "fabric_idx", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AdminVendorId", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AttestationRequest", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainRequest", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRRequest", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddNOC", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "UpdateNOC", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "UpdateFabricLabel", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "RemoveFabric", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "AddTrustedRootCertificate", + "code": 11, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Operational Credentials", + "code": 62, + "mfgCode": null, + "define": "OPERATIONAL_CREDENTIALS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AttestationResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CertificateChainResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "CSRResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "NOCResponse", + "code": 8, + "mfgCode": null, + "source": "server", + "incoming": 1, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NOCs", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Fabrics", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SupportedFabrics", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CommissionedFabrics", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "TrustedRootCertificates", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentFabricIndex", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "KeySetWrite", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRead", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetRemove", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "KeySetReadAllIndices", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ] + }, + { + "name": "Group Key Management", + "code": 63, + "mfgCode": null, + "define": "GROUP_KEY_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "KeySetReadResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "KeySetReadAllIndicesResponse", + "code": 5, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "GroupKeyMap", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GroupTable", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupsPerFabric", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxGroupKeysPerFabric", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "Fixed Label", + "code": 64, + "mfgCode": null, + "define": "FIXED_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "client", + "enabled": 0 + }, + { + "name": "User Label", + "code": 65, + "mfgCode": null, + "define": "USER_LABEL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "LabelList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + } + ] + }, + { + "id": 2, + "name": "MA-extendedcolorlight", + "deviceTypeRef": { + "code": 269, + "profileId": 259, + "label": "MA-extendedcolorlight", + "name": "MA-extendedcolorlight" + }, + "deviceTypes": [ + { + "code": 269, + "profileId": 259, + "label": "MA-extendedcolorlight", + "name": "MA-extendedcolorlight" + } + ], + "deviceVersions": [ + 1 + ], + "deviceIdentifiers": [ + 269 + ], + "deviceTypeName": "MA-extendedcolorlight", + "deviceTypeCode": 269, + "deviceTypeProfileId": 259, + "clusters": [ + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Identify", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "TriggerEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Identify", + "code": 3, + "mfgCode": null, + "define": "IDENTIFY_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdentifyTime", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "IdentifyType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "IdentifyTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddGroup", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewGroup", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetGroupMembership", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveGroup", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllGroups", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "AddGroupIfIdentifying", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Groups", + "code": 4, + "mfgCode": null, + "define": "GROUPS_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "AddGroupResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewGroupResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetGroupMembershipResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveGroupResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "NameSupport", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "NameSupportBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "AddScene", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ViewScene", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveScene", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RemoveAllScenes", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StoreScene", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "RecallScene", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "GetSceneMembership", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedAddScene", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedViewScene", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "CopyScene", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Scenes", + "code": 5, + "mfgCode": null, + "define": "SCENES_CLUSTER", + "side": "server", + "enabled": 0, + "commands": [ + { + "name": "AddSceneResponse", + "code": 0, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "ViewSceneResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveSceneResponse", + "code": 2, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "RemoveAllScenesResponse", + "code": 3, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "StoreSceneResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + }, + { + "name": "GetSceneMembershipResponse", + "code": 6, + "mfgCode": null, + "source": "server", + "incoming": 0, + "outgoing": 1 + } + ], + "attributes": [ + { + "name": "SceneCount", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentScene", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentGroup", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "group_id", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SceneValid", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NameSupport", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "4", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "Off", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "On", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Toggle", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OffWithEffect", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OnWithRecallGlobalScene", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "OnWithTimedOff", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "On/Off", + "code": 6, + "mfgCode": null, + "define": "ON_OFF_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GlobalSceneControl", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OnTime", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OffWaitTime", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StartUpOnOff", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "OnOffStartUpOnOff", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToLevel", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Move", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Step", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "Stop", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToLevelWithOnOff", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveWithOnOff", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepWithOnOff", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopWithOnOff", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Level Control", + "code": 8, + "mfgCode": null, + "define": "LEVEL_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "CurrentLevel", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x254", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "MinLevel", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxLevel", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFE", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentFrequency", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinFrequency", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxFrequency", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "LevelControlOptions", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OnOffTransitionTime", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnLevel", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OnTransitionTime", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "OffTransitionTime", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "DefaultMoveRate", + "code": 20, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "50", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "StartUpCurrentLevel", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "NVM", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Descriptor", + "code": 29, + "mfgCode": null, + "define": "DESCRIPTOR_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "DeviceTypeList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ServerList", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClientList", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Basic Information", + "code": 40, + "mfgCode": null, + "define": "BASIC_INFORMATION_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "DataModelRevision", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "10", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorName", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "VendorID", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "vendor_id", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductName", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductID", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NodeLabel", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Location", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "XX", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersion", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "HardwareVersionString", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersion", + "code": 9, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SoftwareVersionString", + "code": 10, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ManufacturingDate", + "code": 11, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "20210614123456ZZ", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "PartNumber", + "code": 12, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductURL", + "code": 13, + "mfgCode": null, + "side": "server", + "type": "long_char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ProductLabel", + "code": 14, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "SerialNumber", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "LocalConfigDisabled", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "NVM", + "singleton": 1, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Reachable", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "boolean", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "UniqueID", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "External", + "singleton": 1, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CapabilityMinima", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "CapabilityMinimaStruct", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 1, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "client", + "enabled": 0, + "commands": [ + { + "name": "MoveToHue", + "code": 0, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveHue", + "code": 1, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepHue", + "code": 2, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToSaturation", + "code": 3, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveSaturation", + "code": 4, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepSaturation", + "code": 5, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToHueAndSaturation", + "code": 6, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveToColor", + "code": 7, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveColor", + "code": 8, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "StepColor", + "code": 9, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 1 + }, + { + "name": "MoveToColorTemperature", + "code": 10, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedMoveToHue", + "code": 64, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedMoveHue", + "code": 65, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedStepHue", + "code": 66, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "EnhancedMoveToHueAndSaturation", + "code": 67, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "ColorLoopSet", + "code": 68, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StopMoveStep", + "code": 71, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "MoveColorTemperature", + "code": 75, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + }, + { + "name": "StepColorTemperature", + "code": 76, + "mfgCode": null, + "source": "client", + "incoming": 1, + "outgoing": 0 + } + ], + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Color Control", + "code": 768, + "mfgCode": null, + "define": "COLOR_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "CurrentHue", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentSaturation", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "RemainingTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentX", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x616B", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CurrentY", + "code": 4, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x607D", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "DriftCompensation", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CompensationText", + "code": 6, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorTemperatureMireds", + "code": 7, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00FA", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorMode", + "code": 8, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Options", + "code": 15, + "mfgCode": null, + "side": "server", + "type": "bitmap8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "NumberOfPrimaries", + "code": 16, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "Primary1X", + "code": 17, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Y", + "code": 18, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary1Intensity", + "code": 19, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2X", + "code": 21, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Y", + "code": 22, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary2Intensity", + "code": 23, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3X", + "code": 25, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Y", + "code": 26, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary3Intensity", + "code": 27, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4X", + "code": 32, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Y", + "code": 33, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary4Intensity", + "code": 34, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5X", + "code": 36, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Y", + "code": 37, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary5Intensity", + "code": 38, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6X", + "code": 40, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Y", + "code": 41, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Primary6Intensity", + "code": 42, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointX", + "code": 48, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "WhitePointY", + "code": 49, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRX", + "code": 50, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRY", + "code": 51, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointRIntensity", + "code": 52, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGX", + "code": 54, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGY", + "code": 55, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointGIntensity", + "code": 56, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBX", + "code": 58, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBY", + "code": 59, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ColorPointBIntensity", + "code": 60, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 0, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EnhancedCurrentHue", + "code": 16384, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "EnhancedColorMode", + "code": 16385, + "mfgCode": null, + "side": "server", + "type": "enum8", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x01", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopActive", + "code": 16386, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopDirection", + "code": 16387, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x00", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopTime", + "code": 16388, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0019", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopStartEnhancedHue", + "code": 16389, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x2300", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorLoopStoredEnhancedHue", + "code": 16390, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorCapabilities", + "code": 16394, + "mfgCode": null, + "side": "server", + "type": "bitmap16", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1F", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMinMireds", + "code": 16395, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "ColorTempPhysicalMaxMireds", + "code": 16396, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0xFEFF", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "CoupleColorTempToLevelMinMireds", + "code": 16397, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "StartUpColorTemperatureMireds", + "code": 16400, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 0, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x1F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "6", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "client", + "enabled": 0, + "attributes": [ + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "client", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + }, + { + "name": "Occupancy Sensing", + "code": 1030, + "mfgCode": null, + "define": "OCCUPANCY_SENSING_CLUSTER", + "side": "server", + "enabled": 0, + "attributes": [ + { + "name": "Occupancy", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "OccupancyBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OccupancySensorType", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeEnum", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "OccupancySensorTypeBitmap", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "OccupancySensorTypeBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 0, + "maxInterval": 65344, + "reportableChange": 0 + } + ] + } + ] + } + ], + "endpoints": [ + { + "endpointTypeName": "MA-rootdevice", + "endpointTypeIndex": 0, + "profileId": 259, + "endpointId": 0, + "networkId": 0 + }, + { + "endpointTypeName": "MA-extendedcolorlight", + "endpointTypeIndex": 1, + "profileId": 259, + "endpointId": 1, + "networkId": 0 + } + ], + "log": [] +} \ No newline at end of file diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index 39d4d46e7ac9ef..a91fb7fcc4ada7 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -1256,58 +1256,6 @@ server cluster ThreadNetworkDiagnostics = 53 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. -Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. -Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ -server cluster Switch = 59 { - bitmap Feature : BITMAP32 { - kLatchingSwitch = 0x1; - kMomentarySwitch = 0x2; - kMomentarySwitchRelease = 0x4; - kMomentarySwitchLongPress = 0x8; - kMomentarySwitchMultiPress = 0x10; - } - - info event SwitchLatched = 0 { - INT8U newPosition = 0; - } - - info event InitialPress = 1 { - INT8U newPosition = 0; - } - - info event LongPress = 2 { - INT8U newPosition = 0; - } - - info event ShortRelease = 3 { - INT8U previousPosition = 0; - } - - info event LongRelease = 4 { - INT8U previousPosition = 0; - } - - info event MultiPressOngoing = 5 { - INT8U newPosition = 0; - INT8U currentNumberOfPressesCounted = 1; - } - - info event MultiPressComplete = 6 { - INT8U previousPosition = 0; - INT8U totalNumberOfPressesCounted = 1; - } - - readonly attribute int8u numberOfPositions = 0; - readonly attribute int8u currentPosition = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { enum CommissioningWindowStatusEnum : ENUM8 { @@ -1856,47 +1804,11 @@ server cluster ColorControl = 768 { command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; } -/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ -server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { - kPIR = 0; - kUltrasonic = 1; - kPIRAndUltrasonic = 2; - kPhysicalContact = 3; - } - - bitmap OccupancyBitmap : BITMAP8 { - kOccupied = 0x1; - } - - bitmap OccupancySensorTypeBitmap : BITMAP8 { - kPIR = 0x1; - kUltrasonic = 0x2; - kPhysicalContact = 0x4; - } - - readonly attribute OccupancyBitmap occupancy = 0; - readonly attribute OccupancySensorTypeEnum occupancySensorType = 1; - readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - endpoint 0 { device type ma_rootdevice = 22, version 1; binding cluster OtaSoftwareUpdateProvider; - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -2096,13 +2008,6 @@ endpoint 0 { ram attribute clusterRevision default = 1; } - server cluster Switch { - ram attribute numberOfPositions default = 2; - ram attribute currentPosition; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster AdministratorCommissioning { callback attribute windowStatus default = 0; callback attribute adminFabricIndex default = 1; @@ -2241,14 +2146,6 @@ endpoint 1 { ram attribute featureMap default = 0x1F; ram attribute clusterRevision default = 6; } - - server cluster OccupancySensing { - ram attribute occupancy; - ram attribute occupancySensorType; - ram attribute occupancySensorTypeBitmap; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 3; - } } diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index 26f2b8f3f04044..951855989958db 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -219,7 +219,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -4684,7 +4684,7 @@ "mfgCode": null, "define": "SWITCH_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "NumberOfPositions", @@ -8277,7 +8277,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "Occupancy", diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index b94416839d359e..f599263490c64a 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -1166,58 +1166,6 @@ server cluster WiFiNetworkDiagnostics = 54 { readonly attribute int16u clusterRevision = 65533; } -/** This cluster exposes interactions with a switch device, for the purpose of using those interactions by other devices. -Two types of switch devices are supported: latching switch (e.g. rocker switch) and momentary switch (e.g. push button), distinguished with their feature flags. -Interactions with the switch device are exposed as attributes (for the latching switch) and as events (for both types of switches). An interested party MAY subscribe to these attributes/events and thus be informed of the interactions, and can perform actions based on this, for example by sending commands to perform an action such as controlling a light or a window shade. */ -server cluster Switch = 59 { - bitmap Feature : BITMAP32 { - kLatchingSwitch = 0x1; - kMomentarySwitch = 0x2; - kMomentarySwitchRelease = 0x4; - kMomentarySwitchLongPress = 0x8; - kMomentarySwitchMultiPress = 0x10; - } - - info event SwitchLatched = 0 { - INT8U newPosition = 0; - } - - info event InitialPress = 1 { - INT8U newPosition = 0; - } - - info event LongPress = 2 { - INT8U newPosition = 0; - } - - info event ShortRelease = 3 { - INT8U previousPosition = 0; - } - - info event LongRelease = 4 { - INT8U previousPosition = 0; - } - - info event MultiPressOngoing = 5 { - INT8U newPosition = 0; - INT8U currentNumberOfPressesCounted = 1; - } - - info event MultiPressComplete = 6 { - INT8U previousPosition = 0; - INT8U totalNumberOfPressesCounted = 1; - } - - readonly attribute int8u numberOfPositions = 0; - readonly attribute int8u currentPosition = 1; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Commands to trigger a Node to allow a new Administrator to commission it. */ server cluster AdministratorCommissioning = 60 { enum CommissioningWindowStatusEnum : ENUM8 { @@ -1766,47 +1714,11 @@ server cluster ColorControl = 768 { command StepColorTemperature(StepColorTemperatureRequest): DefaultSuccess = 76; } -/** Attributes and commands for configuring occupancy sensing, and reporting occupancy status. */ -server cluster OccupancySensing = 1030 { - enum OccupancySensorTypeEnum : ENUM8 { - kPIR = 0; - kUltrasonic = 1; - kPIRAndUltrasonic = 2; - kPhysicalContact = 3; - } - - bitmap OccupancyBitmap : BITMAP8 { - kOccupied = 0x1; - } - - bitmap OccupancySensorTypeBitmap : BITMAP8 { - kPIR = 0x1; - kUltrasonic = 0x2; - kPhysicalContact = 0x4; - } - - readonly attribute OccupancyBitmap occupancy = 0; - readonly attribute OccupancySensorTypeEnum occupancySensorType = 1; - readonly attribute OccupancySensorTypeBitmap occupancySensorTypeBitmap = 2; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - endpoint 0 { device type ma_rootdevice = 22, version 1; binding cluster OtaSoftwareUpdateProvider; - server cluster Groups { - ram attribute nameSupport; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -1958,13 +1870,6 @@ endpoint 0 { ram attribute clusterRevision default = 1; } - server cluster Switch { - ram attribute numberOfPositions default = 2; - ram attribute currentPosition; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster AdministratorCommissioning { callback attribute windowStatus default = 0; callback attribute adminFabricIndex default = 1; @@ -2103,14 +2008,6 @@ endpoint 1 { ram attribute featureMap default = 0x1F; ram attribute clusterRevision default = 6; } - - server cluster OccupancySensing { - ram attribute occupancy; - ram attribute occupancySensorType; - ram attribute occupancySensorTypeBitmap; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 3; - } } diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index 9e99cbc70f93b6..ecd8f43cba5780 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -219,7 +219,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "commands": [ { "name": "AddGroupResponse", @@ -4684,7 +4684,7 @@ "mfgCode": null, "define": "SWITCH_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "NumberOfPositions", @@ -8277,7 +8277,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "server", - "enabled": 1, + "enabled": 0, "attributes": [ { "name": "Occupancy", diff --git a/examples/platform/bouffalolab/bl602/flash_config/factory_data.dts b/examples/platform/bouffalolab/bl602/flash_config/factory_data.dts deleted file mode 100644 index 77eca2a07ad56d..00000000000000 --- a/examples/platform/bouffalolab/bl602/flash_config/factory_data.dts +++ /dev/null @@ -1,361 +0,0 @@ -/dts-v1/; -/include/ "bl602_base.dtsi"; -// version: 17 -// last_comp_version: 16 -// boot_cpuid_phys: 0x0 - -/ { - model = "bl bl602 IOT board"; - compatible = "bl,bl602-sample", "bl,bl602-common"; - #address-cells = <0x1>; - #size-cells = <0x1>; - gpio { - #address-cells = <1>; - #size-cells = <1>; - max_num = <40>; - gpio0 { - status = "okay"; - pin = <5>; - feature = "led"; - active = "Hi"; //Hi or Lo - mode = "blink"; //blink or hearbeat - time = <100>; //duration for this mode - }; - gpio1 { - status = "disable"; - pin = <6>; - feature = "led"; - active = "Hi"; //Hi or Lo - mode = "blink"; //blink or hearbeat - time = <100>; //duration for this mode - }; - gpio2 { - status = "okay"; - pin = <2>; - feature = "button"; - active = "Hi"; - mode = "multipress"; - button { - debounce = <10>; - short_press_ms { - start = <100>; - end = <3000>; - kevent = <2>; - }; - long_press_ms { - start = <6000>; - end = <10000>; - kevent = <3>; - }; - longlong_press_ms { - start = <15000>; - kevent = <4>; - }; - trig_level = "Hi"; - }; - hbn_use = "disable"; - }; - }; - i2s { - #address-cells = <1>; - #size-cells = <1>; - i2s@40017000 { - status = "okay"; - compatible = "bl602_i2s"; - reg = <0x40017000 0x100>; - mclk_only = "okay"; - pin { - mclk = <11>; - }; - }; - i2s@40017100 { - status = "okay"; - compatible = "bl602_i2s"; - reg = <0x40017100 0x100>; - mclk_only = "disable"; - pin { - bclk = <12>; - fs = <29>; - do = <30>; - di = <31>; - }; - }; - }; - i2c { - #address-cells = <1>; - #size-cells = <1>; - i2c@40011000 { - status = "okay"; - compatible = "bl602_i2c"; - reg = <0x40011000 0x100>; - pin { - scl = <32>; - sda = <13>; - }; - devices { - list_addr = <0x18 0x21>; - list_driver = "i2c_es8311", "i2c_gc0308>"; - }; - }; - i2c@40011100 { - status = "disable"; - compatible = "bl602_i2c"; - reg = <0x40011100 0x100>; - pin { - /*empty here*/ - }; - }; - }; - timer { - #address-cells = <1>; - #size-cells = <1>; - timer@40014000 { - status = "disable"; - compatible = "bl602_timer"; - reg = <0x40014000 0x100>; - }; - timer@40014100 { - status = "disable"; - compatible = "bl602_timer"; - reg = <0x40014100 0x100>; - }; - }; - pwm { - #address-cells = <1>; - #size-cells = <1>; - pwm@4000A420 { - status = "okay"; - compatible = "bl602_pwm"; - reg = <0x4000A420 0x20>; - path = "/dev/pwm0"; - id = <0>; - pin = <0>; - freq = <800000>; - duty = <50>; - }; - pwm@4000A440 { - status = "disable"; - reg = <0x4000A440 0x20>; - path = "/dev/pwm1"; - id = <1>; - pin = <1>; - freq = <5000>; - duty = <50>; - }; - pwm@4000A460 { - status = "disable"; - reg = <0x4000A460 0x20>; - path = "/dev/pwm2"; - id = <2>; - pin = <2>; - freq = <5000>; - duty = <50>; - }; - pwm@4000A480 { - status = "disable"; - reg = <0x4000A480 0x20>; - path = "/dev/pwm3"; - id = <3>; - pin = <3>; - freq = <5000>; - duty = <50>; - }; - pwm@4000A4A0 { - status = "disable"; - reg = <0x4000A4A0 0x20>; - path = "/dev/pwm4"; - id = <4>; - pin = <4>; - freq = <5000>; - duty = <50>; - }; - }; - ir { - #address-cells = <1>; - #size-cells = <1>; - ctrltype = <0>; - tx { - status = "disable"; - pin = <11>; // only support 11 - mode = "NEC"; // NEC,ExtenedNEC,RC5,SWM - interval = <100>; // ms - active_mode = "Hi"; //Hi,Lo - }; - rx { - status = "okay"; - pin = <12>; // only support 12 13 - mode = "NEC"; // NEC,ExtenedNEC,RC5,SWM - active_mode = "Hi"; //Hi,Lo - data_check = <2>; //bit 0:check cmd, bit 1:check addr - }; - }; - uart { - #address-cells = <1>; - #size-cells = <1>; - uart@4000A000 { - status = "okay"; - id = <0>; - compatible = "bl602_uart"; - path = "/dev/ttyS0"; - baudrate = <2000000>; - pin { - rx = <7>; - tx = <16>; - }; - buf_size { - rx_size = <512>; - tx_size = <512>; - }; - feature { - tx = "okay"; - rx = "okay"; - cts = "disable"; - rts = "disable"; - }; - }; - uart@4000A100 { - status = "okay"; - id = <1>; - compatible = "bl602_uart"; - path = "/dev/ttyS1"; - baudrate = <115200>; - pin { - rx = <3>; - tx = <4>; - }; - buf_size { - rx_size = <512>; - tx_size = <512>; - }; - feature { - tx = "okay"; - rx = "okay"; - cts = "disable"; - rts = "disable"; - }; - }; - }; - spi { - #address-cells = <1>; - #size-cells = <1>; - spi@4000F000 { - status = "okay"; /* okay disable */ - mode = "master"; - reg = <0x4000F000 0x100>; /* 4KB */ - path = "/dev/spi0"; - port = <0>; - polar_phase = <1>; /* 0,1,2,3 */ - freq = <6000000>; - pin { - clk = <3>; - cs = <2>; - mosi = <1>; - miso = <0>; - }; - dma_cfg { - tx_dma_ch = <2>; - rx_dma_ch = <3>; - }; - }; - }; - gpip { - #address-cells = <1>; - #size-cells = <1>; - adc_key { - status = "disable"; - pin = <9>; - interrupt = <3>; - key_vol = <0 100 400 300 500>; - key_pcb = "SW1", "SW2", "SW3", "SW4","SW5"; - key_event = "Usr1", "Usr2", "Start", "Up", "Down"; - key_raw = <1 2 3 4 5>; - }; - }; - qspi { - #address-cells = <1>; - #size-cells = <1>; - qspi@4000A000 { - status = "disable"; - reg = <0x4000A000 0x1000>;/* 4KB */ - }; - }; - wifi { - #address-cells = <1>; - #size-cells = <1>; - region { - country_code = <86>; - }; - mac { - mode = "MBF"; - sta_mac_addr = [C8 43 57 82 73 40]; - ap_mac_addr = [C8 43 57 82 73 02]; - }; - sta { - ssid = "yourssid"; - pwd = "yourapssword"; - auto_connect_enable = <0>; - }; - ap { - ssid = "bl_test_005"; - pwd = "12345678"; - ap_channel = <11>; - auto_chan_detect = "disable"; - }; - brd_rf { - xtal_mode = "MF"; - xtal = <36 36 0 60 60>; - /* - pwr_table = < 4 3 3 186 - 4 3 4 176 - 4 3 5 167 - 3 3 0 159 - 3 3 1 149 - 3 3 2 140 - 3 3 3 129 - 3 3 4 119 - 3 3 5 110 - 2 3 0 101 - 2 3 1 91 - 2 3 2 82 - 2 3 3 72 - 2 3 4 62 - 2 3 5 52 - 1 3 3 10>; - */ - pwr_mode = "bf";//B: only use power offset in EFUSE; b: use power offset in EFUSE with incremental mode; F: only use power offset in Flash; f: use power offset in Flash with incremental mode - pwr_table_11b = <20 20 20 18>;//1Mbps 2Mbps 5.5Mbps 11Mbps - pwr_table_11g = <18 18 18 18 18 18 14 14>; //6Mbps 9Mbps 12Mbps 18MBps 24Mbps 36Mbps 48Mbps 54Mbps - pwr_table_11n = <18 18 18 18 18 16 14 14>; //MCS0 MCS1 MCS2 MCS3 MCS4 MCS5 MCS6 MCS7 - pwr_offset = <10 10 10 10 10 10 10 10 10 10 10 10 10 10>;//due to the limit of current DTC, negative value is used. So we work around by adding all the poweroffset with 10. so 8 represents -2; 10 represents 0; 13 represents 3 - }; - rf_temp { - en_tcal = <0>; - linear_or_follow = <1>; - Tchannels = <2412 2427 2442 2457 2472>; - Tchannel_os = <180 168 163 160 157>; - Tchannel_os_low = <199 186 170 165 160>; - Troom_os = <255>; - //negative value is NOT supported. So we use '256' for 0, '255' for -1, '257' for 1,'511' for 256 - }; - }; - bluetooth { - #address-cells = <1>; - #size-cells = <1>; - brd_rf { - pwr_table_ble = <13>; //range:0~15dbm - }; - }; - MFD { - vendor_name = "Bouffalo Lab"; - vendor_id = [0x0d 0x13]; - product_name = "Test Device"; - product_id = [0x01 0xf0]; - product_part_number = "Test Part Number"; - product_url = "Test Product URL"; - product_label = "Test Product Label"; - manufactoring_date = <2023 02 26>; - hardware_version = [0x01 0x00]; - hardware_version_string = "ver_0.1"; - }; -}; -}; diff --git a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml deleted file mode 100644 index b7cf58abd724bc..00000000000000 --- a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml +++ /dev/null @@ -1,107 +0,0 @@ -[pt_table] -#partition table is 4K in size -address0 = 0xE000 -address1 = 0xF000 - -[[pt_entry]] -type = 0 -name = "FW" -device = 0 -address0 = 0x10000 -size0 = 0x15C000 -address1 = 0x16C000 -size1 = 0x4000 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 2 -name = "mfg" -device = 0 -address0 = 0x16C000 -size0 = 0x4000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 3 -name = "media" -device = 0 -address0 = 0x1A1000 -size0 = 0x47000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 4 -name = "PSM" -device = 0 -address0 = 0x1E8000 -size0 = 0x4000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 5 -name = "KEY" -device = 0 -address0 = 0x1F0000 -size0 = 0x2000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - -[[pt_entry]] -type = 6 -name = "DATA" -device = 0 -address0 = 0x1F2000 -size0 = 0x5000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - - -[[pt_entry]] -type = 7 -name = "factory" -device = 0 -address0 = 0x1F7000 -size0 = 0x7000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - - -[[pt_entry]] -type = 8 -name = "MFD" -device = 0 -address0 = 0x1FE000 -size0 = 0x1000 -address1 = 0 -size1 = 0 -# compressed image must set len,normal image can left it to 0 -len = 0 - - -#if user want to put RF calibration data on flash, uncomment following pt entry -#[[pt_entry]] -#type = 9 -#name = "rf_para" -#device = 0 -#address0 = 0x1FF000 -#size0 = 0x1000 -#address1 = 0 -#size1 = 0 -## compressed image must set len,normal image can left it to 0 -#len = 0 diff --git a/examples/platform/bouffalolab/bl702/ldscripts/psram_flash.ld b/examples/platform/bouffalolab/bl702/ldscripts/psram_flash.ld index c18b569ac062e3..04cff2d1b69c0f 100644 --- a/examples/platform/bouffalolab/bl702/ldscripts/psram_flash.ld +++ b/examples/platform/bouffalolab/bl702/ldscripts/psram_flash.ld @@ -226,6 +226,12 @@ SECTIONS KEEP(*libMatterDeviceInfoProviderExample.a:*(.sbss.*)) KEEP(*libMatterDeviceInfoProviderExample.a:*(.bss.*)) + . = ALIGN(16); + KEEP(*libopenthread-ftd.a:*(.sbss.*)) + KEEP(*libopenthread-ftd.a:*(.bss.*)) + KEEP(*libopenthread-mtd.a:*(.sbss.*)) + KEEP(*libopenthread-mtd.a:*(.bss.*)) + . = ALIGN(16); KEEP(*src/app/clusters/*/bouffalolab*.cpp.o(.sbss.*)) KEEP(*src/app/clusters/*/bouffalolab*.cpp.o(.bss.*)) @@ -246,6 +252,18 @@ SECTIONS KEEP(*sdk_lwip.*.c.o(.sbss.*)) KEEP(*sdk_lwip.*.c.o(.bss.*)) + . = ALIGN(16); + KEEP(*sdk_lwip.*.c.o(.sbss.*)) + KEEP(*sdk_lwip.*.c.o(.bss.*)) + + . = ALIGN(16); + KEEP(*libopenthread_br.a:*(.sbss.*)) + KEEP(*libopenthread_br.a:*(.bss.*)) + + . = ALIGN(16); + KEEP(*third_party/tcplp*.c.o(.bss.*)) + KEEP(*third_party/tcplp*.c.o(.bss.*)) + . = ALIGN(16); KEEP(*stack_main.o(.bss.*)) diff --git a/examples/platform/bouffalolab/bl702l/ldscripts/psram_flash_rom.ld b/examples/platform/bouffalolab/bl702l/ldscripts/psram_flash_rom.ld index 60d1ea8358396e..13fd522f638131 100644 --- a/examples/platform/bouffalolab/bl702l/ldscripts/psram_flash_rom.ld +++ b/examples/platform/bouffalolab/bl702l/ldscripts/psram_flash_rom.ld @@ -208,8 +208,6 @@ SECTIONS KEEP(*sdk_lwip.*.c.o(.bss.*)) KEEP(*lwip.*.c.o(.bss.*)) - - . = ALIGN(16); KEEP(*stack_main.o(.bss.*)) diff --git a/examples/platform/bouffalolab/common/plat/aos_task.c b/examples/platform/bouffalolab/common/iot_sdk/aos_task.c similarity index 100% rename from examples/platform/bouffalolab/common/plat/aos_task.c rename to examples/platform/bouffalolab/common/iot_sdk/aos_task.c diff --git a/examples/platform/bouffalolab/common/plat/demo_pwm.c b/examples/platform/bouffalolab/common/iot_sdk/demo_pwm.c similarity index 94% rename from examples/platform/bouffalolab/common/plat/demo_pwm.c rename to examples/platform/bouffalolab/common/iot_sdk/demo_pwm.c index c279ddc1aaec7c..b2343b63e079fa 100644 --- a/examples/platform/bouffalolab/common/plat/demo_pwm.c +++ b/examples/platform/bouffalolab/common/iot_sdk/demo_pwm.c @@ -8,8 +8,8 @@ #include -#include "board.h" #include "demo_pwm.h" +#include "mboard.h" #define PWM_FREQ 1000 #define PWM_DUTY_CYCLE 10000 @@ -49,7 +49,7 @@ hosal_pwm_dev_t rgb_pwm[] = { #endif }; -void demo_hosal_pwm_init(void) +void demo_pwm_init(void) { /* init pwm with given settings */ for (uint32_t i = 0; i < MAX_PWM_CHANNEL; i++) @@ -58,7 +58,7 @@ void demo_hosal_pwm_init(void) } } -void demo_hosal_pwm_start(void) +void demo_pwm_start(void) { /* start pwm */ for (uint32_t i = 0; i < MAX_PWM_CHANNEL; i++) @@ -67,7 +67,7 @@ void demo_hosal_pwm_start(void) } } -void demo_hosal_pwm_change_param(hosal_pwm_config_t * para) +void demo_pwm_change_param(hosal_pwm_config_t * para) { /* change pwm param */ for (uint32_t i = 0; i < MAX_PWM_CHANNEL; i++) @@ -80,7 +80,7 @@ void demo_hosal_pwm_change_param(hosal_pwm_config_t * para) } } -void demo_hosal_pwm_stop(void) +void demo_pwm_stop(void) { for (uint32_t i = 0; i < MAX_PWM_CHANNEL; i++) { @@ -101,7 +101,7 @@ void set_level(uint8_t currLevel) para.duty_cycle = currLevel * PWM_DUTY_CYCLE / 254; para.freq = PWM_FREQ; - demo_hosal_pwm_change_param(¶); + demo_pwm_change_param(¶); } void set_color_red(uint8_t currLevel) @@ -186,7 +186,7 @@ void set_color(uint8_t currLevel, uint8_t currHue, uint8_t currSat) para[2].duty_cycle = green * PWM_DUTY_CYCLE / 254; para[2].freq = PWM_FREQ; - demo_hosal_pwm_change_param(para); + demo_pwm_change_param(para); #else set_level(currLevel); #endif diff --git a/examples/platform/bouffalolab/common/iot_sdk/platform_port.c b/examples/platform/bouffalolab/common/iot_sdk/platform_port.c new file mode 100644 index 00000000000000..9ffd48ec10811b --- /dev/null +++ b/examples/platform/bouffalolab/common/iot_sdk/platform_port.c @@ -0,0 +1,405 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include +#include +#include + +#include + +#include + +#if BL702_ENABLE +#include +#include +#elif BL702L_ENABLE +#include +#include +#elif BL602_ENABLE +#include +#endif +#include +#if BL702L_ENABLE +#include +#endif +#include +#include +#ifdef CFG_USE_PSRAM +#include +#endif +#include +#include +#include + +#include + +#if BL702L_ENABLE +#include +#include +#include +#endif + +#include + +#include "mboard.h" +#include + +HOSAL_UART_DEV_DECL(uart_stdio, CHIP_UART_PORT, CHIP_UART_PIN_TX, CHIP_UART_PIN_RX, CHIP_UART_BAUDRATE); + +#ifdef SYS_AOS_LOOP_ENABLE +void aos_loop_start(void); +#endif + +// ================================================================================ +// FreeRTOS Callbacks +// ================================================================================ +unsigned int sleep(unsigned int seconds) +{ + const TickType_t xDelay = 1000 * seconds / portTICK_PERIOD_MS; + vTaskDelay(xDelay); + return 0; +} + +#if !BL702L_ENABLE +void vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) +{ + printf("Stack Overflow checked. Stack name %s", pcTaskName); + while (true) + { + /*empty here*/ + } +} + +void vApplicationMallocFailedHook(void) +{ + printf("Memory Allocate Failed. Current left size is %d bytes", xPortGetFreeHeapSize()); + while (true) + { + /*empty here*/ + } +} + +void vApplicationIdleHook(void) +{ + // bl_wdt_feed(); + __asm volatile(" wfi "); +} + +void vApplicationGetIdleTaskMemory(StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, + uint32_t * pulIdleTaskStackSize) +{ + /* If the buffers to be provided to the Idle task are declared inside this + function then they must be declared static - otherwise they will be allocated on + the stack and so not exists after this function exits. */ + + /* Pass out a pointer to the StaticTask_t structure in which the Idle task's + state will be stored. */ + *ppxIdleTaskTCBBuffer = (StaticTask_t *) pvPortMalloc(sizeof(StaticTask_t)); + + /* Pass out the array that will be used as the Idle task's stack. */ + *ppxIdleTaskStackBuffer = (StackType_t *) pvPortMalloc(sizeof(StackType_t) * configMINIMAL_STACK_SIZE); + + /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer. + Note that, as the array is necessarily of type StackType_t, + configMINIMAL_STACK_SIZE is specified in words, not bytes. */ + *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; +} + +/* configSUPPORT_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the +application must provide an implementation of vApplicationGetTimerTaskMemory() +to provide the memory that is used by the Timer service task. */ +void vApplicationGetTimerTaskMemory(StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, + uint32_t * pulTimerTaskStackSize) +{ + /* If the buffers to be provided to the Timer task are declared inside this + function then they must be declared static - otherwise they will be allocated on + the stack and so not exists after this function exits. */ + + /* Pass out a pointer to the StaticTask_t structure in which the Timer + task's state will be stored. */ + *ppxTimerTaskTCBBuffer = (StaticTask_t *) pvPortMalloc(sizeof(StaticTask_t)); + + /* Pass out the array that will be used as the Timer task's stack. */ + *ppxTimerTaskStackBuffer = (StackType_t *) pvPortMalloc(sizeof(StackType_t) * configTIMER_TASK_STACK_DEPTH); + + /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer. + Note that, as the array is necessarily of type StackType_t, + configTIMER_TASK_STACK_DEPTH is specified in words, not bytes. */ + *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; +} + +#if (configUSE_TICK_HOOK != 0) +void vApplicationTickHook(void) +{ +#if defined(CFG_USB_CDC_ENABLE) + extern void usb_cdc_monitor(void); + usb_cdc_monitor(); +#endif +} +#endif + +void vApplicationSleep(TickType_t xExpectedIdleTime) {} + +void vAssertCalled(void) +{ + void * ra = (void *) __builtin_return_address(0); + +#if CONF_ENABLE_FRAME_PTR == 0 + taskDISABLE_INTERRUPTS(); +#endif + + if (xPortIsInsideInterrupt()) + { + printf("vAssertCalled, ra = %p in ISR\r\n", (void *) ra); + } + else + { + printf("vAssertCalled, ra = %p in task %s\r\n", (void *) ra, pcTaskGetName(NULL)); + } + +#if CONF_ENABLE_FRAME_PTR + portABORT(); +#endif + + while (true) + ; +} +#endif + +#if BL702L_ENABLE +void __attribute__((weak)) user_vAssertCalled(void) +{ + void * ra = (void *) __builtin_return_address(0); + + taskDISABLE_INTERRUPTS(); + + if (xPortIsInsideInterrupt()) + { + printf("vAssertCalled, ra = %p in ISR\r\n", (void *) ra); + } + else + { + printf("vAssertCalled, ra = %p in task %s\r\n", (void *) ra, pcTaskGetName(NULL)); + } + + while (true) + ; +} + +void __attribute__((weak)) user_vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) +{ + puts("Stack Overflow checked\r\n"); + if (pcTaskName) + { + printf("Stack name %s\r\n", pcTaskName); + } + while (1) + { + /*empty here*/ + } +} + +void __attribute__((weak)) user_vApplicationMallocFailedHook(void) +{ + printf("Memory Allocate Failed. Current left size is %d bytes\r\n", xPortGetFreeHeapSize()); +#if defined(CFG_USE_PSRAM) + printf("Current psram left size is %d bytes\r\n", xPortGetFreeHeapSizePsram()); +#endif + while (1) + { + /*empty here*/ + } +} + +void bflb_assert(void) __attribute__((weak, alias("user_vAssertCalled"))); +#else +void user_vAssertCalled(void) __attribute__((weak, alias("vAssertCalled"))); +void bflb_assert(void) __attribute__((weak, alias("vAssertCalled"))); +#endif + +// ================================================================================ +// Main Code +// ================================================================================ +extern uint8_t _heap_start; +extern size_t _heap_size; // @suppress("Type cannot be resolved") + +#if BL602_ENABLE +extern uint8_t _heap_wifi_start; +extern uint8_t _heap_wifi_size; // @suppress("Type cannot be resolved") +static const HeapRegion_t xHeapRegions[] = { + { &_heap_start, (unsigned int) &_heap_size }, // set on runtime + { &_heap_wifi_start, (unsigned int) &_heap_wifi_size }, + { NULL, 0 } /* Terminates the array. */ +}; +#elif BL702_ENABLE +static const HeapRegion_t xHeapRegions[] = { + { &_heap_start, (size_t) &_heap_size }, // set on runtime + { NULL, 0 } /* Terminates the array. */ +}; +#elif BL702L_ENABLE +static const HeapRegion_t xHeapRegions[] = { + { &_heap_start, (size_t) &_heap_size }, // set on runtime + { NULL, 0 } /* Terminates the array. */ +}; +#endif + +#ifdef CFG_USE_PSRAM +extern uint32_t __psram_bss_init_start; +extern uint32_t __psram_bss_init_end; + +static uint32_t __attribute__((section(".rsvd_data"))) psram_reset_count; + +extern uint8_t _heap3_start; +extern size_t _heap3_size; // @suppress("Type cannot be resolved") +static const HeapRegion_t xPsramHeapRegions[] = { + { &_heap3_start, (size_t) &_heap3_size }, { NULL, 0 } /* Terminates the array. */ +}; + +size_t get_heap3_size(void) +{ + return (size_t) &_heap3_size; +} + +void do_psram_test() +{ + static const char teststr[] = "bouffalolab psram test string"; + + do + { + uint8_t * pheap = &_heap3_start; + size_t size = (size_t) &_heap3_size; + + size = size > sizeof(teststr) ? sizeof(teststr) : size; + memset(pheap, 0, size); + if (pheap[0] != 0) + { + break; + } + + memcpy(pheap, teststr, size); + if (0 != memcmp(pheap, teststr, size)) + { + break; + } + + arch_memset4(&__psram_bss_init_start, 0, &__psram_bss_init_end - &__psram_bss_init_start); + + psram_reset_count = 0xffffff00; + return; + } while (0); + + if ((psram_reset_count & 0xffffff00) != 0xffffff00) + { + psram_reset_count = 0xffffff00; + } + + if ((psram_reset_count & 0x000000ff) > 3) + { + printf("PSRAM is still failed to initialize after %ld system reset", psram_reset_count & 0x000000ff); + vAssertCalled(); + } + + psram_reset_count = ((psram_reset_count & 0x000000ff) + 1) | 0xffffff00; + bl_sys_reset_system(); +} +#endif + +void setup_heap() +{ + bl_sys_init(); + +#if BL702_ENABLE + bl_sys_em_config(); +#elif BL702L_ENABLE + bl_sys_em_config(); + + // Initialize rom data + extern uint8_t _rom_data_run; + extern uint8_t _rom_data_load; + extern uint8_t _rom_data_size; + memcpy((void *) &_rom_data_run, (void *) &_rom_data_load, (size_t) &_rom_data_size); +#endif + + vPortDefineHeapRegions(xHeapRegions); + +#ifdef CFG_USE_PSRAM + bl_psram_init(); + do_psram_test(); + vPortDefineHeapRegionsPsram(xPsramHeapRegions); +#endif +} + +size_t get_heap_size(void) +{ + return (size_t) &_heap_size; +} + +void app_init(void) +{ + bl_sys_early_init(); + +#if BL702L_ENABLE + rom_freertos_init(256, 400); + rom_hal_init(); + rom_lmac154_hook_init(); +#endif + + hosal_uart_init(&uart_stdio); + + blog_init(); + bl_irq_init(); +#if BL702L_ENABLE + bl_rtc_init(); +#endif + bl_sec_init(); +#if BL702_ENABLE + bl_timer_init(); +#endif + + hal_boot2_init(); + + /* board config is set after system is init*/ + hal_board_cfg(0); + +#if BL702L_ENABLE || CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + hosal_dma_init(); +#endif +#if BL602_ENABLE + wifi_td_diagnosis_init(); +#endif +} + +void platform_port_init(void) +{ + app_init(); + +#if CONFIG_ENABLE_CHIP_SHELL || PW_RPC_ENABLED + uartInit(); +#endif +#ifdef SYS_AOS_LOOP_ENABLE + aos_loop_start(); +#else +#if defined(CFG_USB_CDC_ENABLE) + extern void usb_cdc_start(int fd_console); + usb_cdc_start(-1); +#endif +#endif +} diff --git a/examples/platform/bouffalolab/common/plat/uart.c b/examples/platform/bouffalolab/common/iot_sdk/uart.c similarity index 79% rename from examples/platform/bouffalolab/common/plat/uart.c rename to examples/platform/bouffalolab/common/iot_sdk/uart.c index 35e0516e480b33..212bcaa51b9b03 100644 --- a/examples/platform/bouffalolab/common/plat/uart.c +++ b/examples/platform/bouffalolab/common/iot_sdk/uart.c @@ -19,7 +19,7 @@ #include #include -#include +#include #ifdef CFG_USB_CDC_ENABLE #include @@ -123,6 +123,45 @@ void aosUartRxCallback(int fd, void * param) xSemaphoreGiveFromISR(chipUart_var.sema, &xHigherPriorityTaskWoken); } } + +static int uartTxCallback(void * p_arg) +{ + + return 0; +} + +static int uartRxCallback(void * p_arg) +{ + uint32_t len = 0; + BaseType_t xHigherPriorityTaskWoken = 1; + + if (chipUart_var.head >= chipUart_var.tail) + { + if (chipUart_var.head < MAX_BUFFER_SIZE) + { + // len = hosal_uart_receive(&uart_stdio, chipUart_var.rxbuf + chipUart_var.head, MAX_BUFFER_SIZE - chipUart_var.head); + chipUart_var.head = (chipUart_var.head + len) % MAX_BUFFER_SIZE; + } + + if (0 == chipUart_var.head) + { + // len = hosal_uart_receive(&uart_stdio, chipUart_var.rxbuf, chipUart_var.tail - 1); + chipUart_var.head += len; + } + } + else + { + chipUart_var.head += + // hosal_uart_receive(&uart_stdio, chipUart_var.rxbuf + chipUart_var.head, chipUart_var.tail - chipUart_var.head - 1); + } + + if (chipUart_var.head != chipUart_var.tail) + { + xSemaphoreGiveFromISR(chipUart_var.sema, &xHigherPriorityTaskWoken); + } + + return 0; +} #endif void uartInit(void) diff --git a/examples/platform/bouffalolab/common/iot_sdk/uart.h b/examples/platform/bouffalolab/common/iot_sdk/uart.h new file mode 100644 index 00000000000000..ff2a398a395dd7 --- /dev/null +++ b/examples/platform/bouffalolab/common/iot_sdk/uart.h @@ -0,0 +1,37 @@ +/* + * + * Copyright (c) 2021 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void uartInit(void); +int16_t uartWrite(const char * Buf, uint16_t BufLength); +int16_t uartRead(char * Buf, uint16_t NbBytesToRead); + +#ifdef CFG_USB_CDC_ENABLE +void aosUartRxCallback(int fd, void * param); +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/examples/platform/bouffalolab/common/plat/LEDWidget.cpp b/examples/platform/bouffalolab/common/plat/LEDWidget.cpp index a01545ac7058dd..bf6159befb97f1 100644 --- a/examples/platform/bouffalolab/common/plat/LEDWidget.cpp +++ b/examples/platform/bouffalolab/common/plat/LEDWidget.cpp @@ -15,51 +15,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include -#include -#include -#include #include -#include +#include #include "LEDWidget.h" -void LEDWidget::Init() -{ -#ifdef LED1_PIN - mPin = LED1_PIN; - - hosal_gpio_dev_t gpio_led = { .config = OUTPUT_OPEN_DRAIN_NO_PULL, .priv = NULL }; - gpio_led.port = mPin; - - hosal_gpio_init(&gpio_led); -#endif - SetOnoff(false); -} - -void LEDWidget::Toggle(void) -{ - SetOnoff(1 - mOnoff); -} - -void LEDWidget::SetOnoff(bool state) -{ -#ifdef LED1_PIN - hosal_gpio_dev_t gpio_led = { .port = mPin, .config = OUTPUT_OPEN_DRAIN_NO_PULL, .priv = NULL }; - - mOnoff = state; - - if (state) - { - hosal_gpio_output_set(&gpio_led, 1); - } - else - { - hosal_gpio_output_set(&gpio_led, 0); - } -#endif -} - bool LEDWidget::GetOnoff(void) { return mOnoff ? true : false; @@ -70,8 +32,8 @@ void DimmableLEDWidget::Init() mOnoff = light_v = 0; #ifdef MAX_PWM_CHANNEL - demo_hosal_pwm_init(); - demo_hosal_pwm_start(); + demo_pwm_init(); + demo_pwm_start(); #endif } @@ -115,8 +77,8 @@ void ColorLEDWidget::Init() { mOnoff = light_v = light_s = light_h = 0; #ifdef MAX_PWM_CHANNEL - demo_hosal_pwm_init(); - demo_hosal_pwm_start(); + demo_pwm_init(); + demo_pwm_start(); #endif } diff --git a/examples/platform/bouffalolab/common/plat/LEDWidget.h b/examples/platform/bouffalolab/common/plat/LEDWidget.h index 935a1750620066..af1877d1089f3a 100644 --- a/examples/platform/bouffalolab/common/plat/LEDWidget.h +++ b/examples/platform/bouffalolab/common/plat/LEDWidget.h @@ -23,10 +23,11 @@ class LEDWidget { public: - void Init(void); - void SetOnoff(bool state); + virtual void Init(void) = 0; + virtual void SetOnoff(bool state) = 0; bool GetOnoff(void); - void Toggle(void); + virtual void Toggle(void) = 0; + virtual ~LEDWidget(void){}; uint8_t mOnoff; uint8_t mPin; @@ -35,10 +36,11 @@ class LEDWidget class DimmableLEDWidget : public LEDWidget { public: - void Init(void); - void Toggle(void); - void SetOnoff(bool state); + void Init(void) override; + void Toggle(void) override; + void SetOnoff(bool state) override; void SetLevel(uint8_t level); + ~DimmableLEDWidget(void) {} uint8_t light_v; }; @@ -46,11 +48,12 @@ class DimmableLEDWidget : public LEDWidget class ColorLEDWidget : public DimmableLEDWidget { public: - void Init(void); - void Toggle(void); - void SetOnoff(bool state); + void Init(void) override; + void Toggle(void) override; + void SetOnoff(bool state) override; void SetLevel(uint8_t level); void SetColor(uint8_t level, uint8_t hue, uint8_t sat); + ~ColorLEDWidget(void) {} uint8_t light_h; uint8_t light_s; diff --git a/examples/platform/bouffalolab/common/plat/demo_pwm.h b/examples/platform/bouffalolab/common/plat/demo_pwm.h index 80eadb6811bf8d..d434ee9addec2b 100644 --- a/examples/platform/bouffalolab/common/plat/demo_pwm.h +++ b/examples/platform/bouffalolab/common/plat/demo_pwm.h @@ -1,17 +1,12 @@ #ifndef __DEMO_PWM__ #define __DEMO_PWM__ -#include -#include -#include - #ifdef __cplusplus extern "C" { #endif -void demo_hosal_pwm_init(void); -void demo_hosal_pwm_start(void); -void demo_hosal_pwm_change_param(hosal_pwm_config_t * para); +void demo_pwm_init(void); +void demo_pwm_start(void); void set_color_red(uint8_t currLevel); void set_color_green(uint8_t currLevel); void set_color_yellow(uint8_t currLevel); diff --git a/examples/platform/bouffalolab/common/plat/main.cpp b/examples/platform/bouffalolab/common/plat/main.cpp index bf04405bf78523..65e8efce1cc377 100644 --- a/examples/platform/bouffalolab/common/plat/main.cpp +++ b/examples/platform/bouffalolab/common/plat/main.cpp @@ -16,71 +16,16 @@ * limitations under the License. */ -#include -#include - -#include -#include -#include - -#include - #include + #include #include -extern "C" { - -#include - -#ifdef BL702_ENABLE -#include -#include -#elif BL702L_ENABLE -#include -#include -#elif defined(BL602_ENABLE) -#include -#endif -#include -#if defined(BL702L_ENABLE) -#include -#endif -#include -#include -#ifdef CFG_USE_PSRAM -#include -#endif -#include -#include -#include - -#include - -#ifdef BL702L_ENABLE -#include -#include -#include -#endif - -#include "board.h" -#include -} - using namespace ::chip; using namespace ::chip::Inet; using namespace ::chip::DeviceLayer; -#define UNUSED_PARAMETER(a) (a = a) - -HOSAL_UART_DEV_DECL(uart_stdio, CHIP_UART_PORT, CHIP_UART_PIN_TX, CHIP_UART_PIN_RX, CHIP_UART_BAUDRATE); - volatile int apperror_cnt; - -#ifdef SYS_AOS_LOOP_ENABLE -extern "C" void aos_loop_start(void); -#endif - // ================================================================================ // App Error //================================================================================= @@ -97,350 +42,17 @@ void appError(CHIP_ERROR error) appError(static_cast(error.AsInteger())); } -// ================================================================================ -// FreeRTOS Callbacks -// ================================================================================ -extern "C" unsigned int sleep(unsigned int seconds) -{ - const TickType_t xDelay = 1000 * seconds / portTICK_PERIOD_MS; - vTaskDelay(xDelay); - return 0; -} - -#ifndef BL702L_ENABLE - -extern "C" void vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) -{ - ChipLogProgress(NotSpecified, "Stack Overflow checked. Stack name %s", pcTaskName); - while (true) - { - /*empty here*/ - } -} - -extern "C" void vApplicationMallocFailedHook(void) -{ - ChipLogProgress(NotSpecified, "Memory Allocate Failed. Current left size is %d bytes", xPortGetFreeHeapSize()); - while (true) - { - /*empty here*/ - } -} - -extern "C" void vApplicationIdleHook(void) +extern "C" int START_ENTRY(void) { - // bl_wdt_feed(); - __asm volatile(" wfi "); -} - -extern "C" void vApplicationGetIdleTaskMemory(StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, - uint32_t * pulIdleTaskStackSize) -{ - /* If the buffers to be provided to the Idle task are declared inside this - function then they must be declared static - otherwise they will be allocated on - the stack and so not exists after this function exits. */ - - /* Pass out a pointer to the StaticTask_t structure in which the Idle task's - state will be stored. */ - *ppxIdleTaskTCBBuffer = (StaticTask_t *) pvPortMalloc(sizeof(StaticTask_t)); - - /* Pass out the array that will be used as the Idle task's stack. */ - *ppxIdleTaskStackBuffer = (StackType_t *) pvPortMalloc(sizeof(StackType_t) * configMINIMAL_STACK_SIZE); - - /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer. - Note that, as the array is necessarily of type StackType_t, - configMINIMAL_STACK_SIZE is specified in words, not bytes. */ - *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; -} - -/* configSUPPORT_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the -application must provide an implementation of vApplicationGetTimerTaskMemory() -to provide the memory that is used by the Timer service task. */ -extern "C" void vApplicationGetTimerTaskMemory(StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, - uint32_t * pulTimerTaskStackSize) -{ - /* If the buffers to be provided to the Timer task are declared inside this - function then they must be declared static - otherwise they will be allocated on - the stack and so not exists after this function exits. */ - - /* Pass out a pointer to the StaticTask_t structure in which the Timer - task's state will be stored. */ - *ppxTimerTaskTCBBuffer = (StaticTask_t *) pvPortMalloc(sizeof(StaticTask_t)); - - /* Pass out the array that will be used as the Timer task's stack. */ - *ppxTimerTaskStackBuffer = (StackType_t *) pvPortMalloc(sizeof(StackType_t) * configTIMER_TASK_STACK_DEPTH); - - /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer. - Note that, as the array is necessarily of type StackType_t, - configTIMER_TASK_STACK_DEPTH is specified in words, not bytes. */ - *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; -} - -#if (configUSE_TICK_HOOK != 0) -extern "C" void vApplicationTickHook(void) -{ -#if defined(CFG_USB_CDC_ENABLE) - extern void usb_cdc_monitor(void); - usb_cdc_monitor(); -#endif -} -#endif - -void vApplicationSleep(TickType_t xExpectedIdleTime) {} - -extern "C" void vAssertCalled(void) -{ - void * ra = (void *) __builtin_return_address(0); + platform_port_init(); - taskDISABLE_INTERRUPTS(); - if (xPortIsInsideInterrupt()) - { - printf("vAssertCalled, ra = %p in ISR\r\n", (void *) ra); - } - else - { - printf("vAssertCalled, ra = %p in task %s\r\n", (void *) ra, pcTaskGetName(NULL)); - } - - while (true) - ; -} -#endif - -#ifdef BL702L_ENABLE -extern "C" void __attribute__((weak)) user_vAssertCalled(void) -{ - void * ra = (void *) __builtin_return_address(0); - - taskDISABLE_INTERRUPTS(); - if (xPortIsInsideInterrupt()) - { - printf("vAssertCalled, ra = %p in ISR\r\n", (void *) ra); - } - else - { - printf("vAssertCalled, ra = %p in task %s\r\n", (void *) ra, pcTaskGetName(NULL)); - } - - while (true) - ; -} - -extern "C" void __attribute__((weak)) user_vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) -{ - puts("Stack Overflow checked\r\n"); - if (pcTaskName) - { - printf("Stack name %s\r\n", pcTaskName); - } - while (1) - { - /*empty here*/ - } -} - -extern "C" void __attribute__((weak)) user_vApplicationMallocFailedHook(void) -{ - printf("Memory Allocate Failed. Current left size is %d bytes\r\n", xPortGetFreeHeapSize()); -#if defined(CFG_USE_PSRAM) - printf("Current psram left size is %d bytes\r\n", xPortGetFreeHeapSizePsram()); -#endif - while (1) - { - /*empty here*/ - } -} - -#else -extern "C" void user_vAssertCalled(void) __attribute__((weak, alias("vAssertCalled"))); -#endif - -// ================================================================================ -// Main Code -// ================================================================================ -extern "C" uint8_t _heap_start; -extern "C" size_t _heap_size; // @suppress("Type cannot be resolved") - -#ifdef BL602_ENABLE -extern uint8_t _heap_wifi_start; -extern uint8_t _heap_wifi_size; // @suppress("Type cannot be resolved") -static HeapRegion_t xHeapRegions[] = { - { &_heap_start, (unsigned int) &_heap_size }, // set on runtime - { &_heap_wifi_start, (unsigned int) &_heap_wifi_size }, - { NULL, 0 } /* Terminates the array. */ -}; -#elif defined(BL702_ENABLE) -static constexpr HeapRegion_t xHeapRegions[] = { - { &_heap_start, (size_t) &_heap_size }, // set on runtime - { NULL, 0 } /* Terminates the array. */ -}; -#elif defined(BL702L_ENABLE) -static constexpr HeapRegion_t xHeapRegions[] = { - { &_heap_start, (size_t) &_heap_size }, // set on runtime - { NULL, 0 } /* Terminates the array. */ -}; -#endif - -#ifdef CFG_USE_PSRAM - -extern "C" uint32_t __psram_bss_init_start; -extern "C" uint32_t __psram_bss_init_end; - -static uint32_t __attribute__((section(".rsvd_data"))) psram_reset_count; - -extern "C" uint8_t _heap3_start; -extern "C" size_t _heap3_size; // @suppress("Type cannot be resolved") -static constexpr HeapRegion_t xPsramHeapRegions[] = { - { &_heap3_start, (size_t) &_heap3_size }, { NULL, 0 } /* Terminates the array. */ -}; - -extern "C" size_t get_heap3_size(void) -{ - return (size_t) &_heap3_size; -} - -extern "C" void do_psram_test() -{ - static constexpr char teststr[] = "bouffalolab psram test string"; - - do - { - uint8_t * pheap = &_heap3_start; - size_t size = (size_t) &_heap3_size; - - size = size > sizeof(teststr) ? sizeof(teststr) : size; - memset(pheap, 0, size); - if (pheap[0] != 0) - { - break; - } - - memcpy(pheap, teststr, size); - if (0 != memcmp(pheap, teststr, size)) - { - break; - } - - arch_memset4(&__psram_bss_init_start, 0, &__psram_bss_init_end - &__psram_bss_init_start); - - psram_reset_count = 0xffffff00; - return; - } while (0); - - if ((psram_reset_count & 0xffffff00) != 0xffffff00) - { - psram_reset_count = 0xffffff00; - } - - if ((psram_reset_count & 0x000000ff) > 3) - { - ChipLogError(NotSpecified, "PSRAM is still failed to initialize after %ld system reset", psram_reset_count & 0x000000ff); - vAssertCalled(); - } - - psram_reset_count = ((psram_reset_count & 0x000000ff) + 1) | 0xffffff00; - bl_sys_reset_system(); -} -#endif - -extern "C" void setup_heap() -{ - bl_sys_init(); - -#ifdef BL702_ENABLE - bl_sys_em_config(); -#elif defined(BL702L_ENABLE) - bl_sys_em_config(); - - // Initialize rom data - extern uint8_t _rom_data_run; - extern uint8_t _rom_data_load; - extern uint8_t _rom_data_size; - memcpy((void *) &_rom_data_run, (void *) &_rom_data_load, (size_t) &_rom_data_size); -#endif - - vPortDefineHeapRegions(xHeapRegions); - -#ifdef CFG_USE_PSRAM - bl_psram_init(); - do_psram_test(); - vPortDefineHeapRegionsPsram(xPsramHeapRegions); -#endif -} - -extern "C" size_t get_heap_size(void) -{ - return (size_t) &_heap_size; -} - -extern "C" void app_init(void) -{ - bl_sys_early_init(); - -#ifdef BL702L_ENABLE - rom_freertos_init(256, 400); - rom_hal_init(); - rom_lmac154_hook_init(); -#endif - - hosal_uart_init(&uart_stdio); + easyflash_init(); + ef_load_env_cache(); ChipLogProgress(NotSpecified, "=================================================="); ChipLogProgress(NotSpecified, "bouffalolab chip-lighting-example, built at " __DATE__ " " __TIME__); ChipLogProgress(NotSpecified, "=================================================="); -#ifdef CFG_USE_PSRAM - ChipLogProgress(NotSpecified, "Heap %u@[%p:%p], %u@[%p:%p]", (unsigned int) &_heap_size, &_heap_start, - &_heap_start + (unsigned int) &_heap_size, (unsigned int) &_heap3_size, &_heap3_start, - &_heap3_start + (unsigned int) &_heap3_size); -#else - ChipLogProgress(NotSpecified, "Heap %u@[%p:%p]", (unsigned int) &_heap_size, &_heap_start, - &_heap_start + (unsigned int) &_heap_size); -#endif - - blog_init(); - bl_irq_init(); -#if defined(BL702L_ENABLE) - bl_rtc_init(); -#endif - bl_sec_init(); -#if defined(BL702_ENABLE) - bl_timer_init(); -#endif - - hal_boot2_init(); - - /* board config is set after system is init*/ - hal_board_cfg(0); - -#if defined(BL702L_ENABLE) || defined(BL706_WIFI) - hosal_dma_init(); -#endif -#ifdef BL602_ENABLE - wifi_td_diagnosis_init(); -#endif -} - -extern "C" void START_ENTRY(void) -{ - app_init(); - -#if CONFIG_ENABLE_CHIP_SHELL || PW_RPC_ENABLED - uartInit(); -#endif -#ifdef SYS_AOS_LOOP_ENABLE - ChipLogProgress(NotSpecified, "Starting AOS loop Task"); - aos_loop_start(); -#else -#if defined(CFG_USB_CDC_ENABLE) - extern void usb_cdc_start(int fd_console); - usb_cdc_start(-1); -#endif -#endif - - easyflash_init(); - ef_load_env_cache(); - ChipLogProgress(NotSpecified, "Init CHIP Memory"); chip::Platform::MemoryInit(NULL, 0); @@ -453,4 +65,6 @@ extern "C" void START_ENTRY(void) // Should never get here. ChipLogError(NotSpecified, "Starting OS Scheduler failed"); appError(0); + + return 0; } diff --git a/examples/platform/bouffalolab/common/plat/plat.h b/examples/platform/bouffalolab/common/plat/plat.h index 8235304f42c551..ba85f03e88105f 100644 --- a/examples/platform/bouffalolab/common/plat/plat.h +++ b/examples/platform/bouffalolab/common/plat/plat.h @@ -24,8 +24,14 @@ #define EXT_DISCOVERY_TIMEOUT_SECS 20 #ifdef __cplusplus + #include void appError(CHIP_ERROR error); + +extern "C" void platform_port_init(void); #else + void appError(int err); +void platform_port_init(void); + #endif diff --git a/examples/platform/bouffalolab/common/plat/platform.cpp b/examples/platform/bouffalolab/common/plat/platform.cpp index b0d73daa3a2bbc..97e3a07621b093 100644 --- a/examples/platform/bouffalolab/common/plat/platform.cpp +++ b/examples/platform/bouffalolab/common/plat/platform.cpp @@ -51,25 +51,25 @@ #include #endif -#if CHIP_ENABLE_OPENTHREAD +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include #include #include #include #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET || CHIP_DEVICE_CONFIG_ENABLE_WIFI +#include #include -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#if defined(BL602_ENABLE) +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI && BL602_ENABLE #include -#else -#include #endif -#else +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI && BL702_ENABLE +#include +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET #include #endif -#include #endif #include @@ -87,14 +87,14 @@ chip::app::Clusters::NetworkCommissioning::Instance } #endif -static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; - #if CONFIG_BOUFFALOLAB_FACTORY_DATA_ENABLE || defined(CONFIG_BOUFFALOLAB_FACTORY_DATA_TEST) namespace { FactoryDataProvider sFactoryDataProvider; } #endif +static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; + void ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg) { switch (event->Type) @@ -111,7 +111,9 @@ void ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg) OTAConfig::InitOTARequestorHandler, nullptr); } break; -#else +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET case DeviceEventType::kInterfaceIpAddressChanged: if ((event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV4_Assigned) || (event->InterfaceIpAddressChanged.Type == InterfaceIpChangeType::kIpV6_Assigned)) @@ -128,7 +130,6 @@ void ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg) chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(OTAConfig::kInitOTARequestorDelaySec), OTAConfig::InitOTARequestorHandler, nullptr); } - break; #endif case DeviceEventType::kInternetConnectivityChange: @@ -166,6 +167,8 @@ void ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg) CHIP_ERROR PlatformManagerImpl::PlatformInit(void) { + chip::RendezvousInformationFlags rendezvousMode(chip::RendezvousInformationFlag::kOnNetwork); + #if PW_RPC_ENABLED PigweedLogger::pw_init(); #elif CONFIG_ENABLE_CHIP_SHELL @@ -181,7 +184,7 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void) chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(CHIP_BLE_DEVICE_NAME); -#if CHIP_ENABLE_OPENTHREAD +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD #if CONFIG_ENABLE_CHIP_SHELL cmd_otcli_init(); @@ -196,7 +199,9 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void) ReturnLogErrorOnFailure(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice)); #endif -#elif CHIP_DEVICE_CONFIG_ENABLE_WIFI +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI ReturnLogErrorOnFailure(sWiFiNetworkCommissioningInstance.Init()); #endif @@ -233,7 +238,7 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void) chip::DeviceLayer::PlatformMgr().UnlockChipStack(); -#if CHIP_ENABLE_OPENTHREAD +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD ChipLogProgress(NotSpecified, "Starting OpenThread task"); // Start OpenThread task ReturnLogErrorOnFailure(ThreadStackMgrImpl().StartThreadTask()); @@ -242,10 +247,9 @@ CHIP_ERROR PlatformManagerImpl::PlatformInit(void) ConfigurationMgr().LogDeviceConfig(); #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE - PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); -#else - PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kOnNetwork)); + rendezvousMode.Set(chip::RendezvousInformationFlag::kBLE); #endif + PrintOnboardingCodes(rendezvousMode); PlatformMgr().AddEventHandler(ChipEventHandler, 0); diff --git a/examples/platform/bouffalolab/common/route_hook/bl_route_hook.c b/examples/platform/bouffalolab/common/route_hook/bl_route_hook.c index 93cc731b99857d..68c51bd327e3a2 100644 --- a/examples/platform/bouffalolab/common/route_hook/bl_route_hook.c +++ b/examples/platform/bouffalolab/common/route_hook/bl_route_hook.c @@ -1,8 +1,6 @@ #include #include -#include "utils_log.h" - #include "lwip/icmp6.h" #include "lwip/mld6.h" #include "lwip/netif.h" @@ -81,7 +79,7 @@ static void ra_recv_handler(struct netif * netif, const uint8_t * icmp_payload, const uint8_t * rio_data = &icmp_payload[sizeof(rio_header_t)]; uint8_t rio_data_len = opt_len - sizeof(rio_header_t); - log_info("Received RIO\r\n"); + printf("Received RIO\r\n"); if (rio_data_len >= prefix_len_bytes) { ip6_addr_t prefix; @@ -95,14 +93,14 @@ static void ra_recv_handler(struct netif * netif, const uint8_t * icmp_payload, route.prefix = prefix; route.preference = preference; route.lifetime_seconds = lwip_ntohl(rio_header.route_lifetime); - log_info("prefix %s lifetime %u\r\n", ip6addr_ntoa(&prefix), route.lifetime_seconds); + printf("prefix %s lifetime %lu\r\n", ip6addr_ntoa(&prefix), route.lifetime_seconds); if (bl_route_table_add_route_entry(&route) == NULL) { - log_error("Failed to add route table entry\r\n"); + printf("Failed to add route table entry\r\n"); } else { - log_info("Added entry to route table\r\n"); + printf("Added entry to route table\r\n"); } } } @@ -129,12 +127,12 @@ static uint8_t icmp6_raw_recv_handler(void * arg, struct raw_pcb * pcb, struct p if (p->tot_len != p->len) { - log_error("Ignore segmented ICMP packet\r\n"); + printf("Ignore segmented ICMP packet\r\n"); return 0; } if (p->tot_len <= sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr)) { - log_error("Ignore invalid ICMP packet\r\n"); + printf("Ignore invalid ICMP packet\r\n"); return 0; } if (!ip6_addr_islinklocal(&dest) && !ip6_addr_isallnodes_linklocal(&dest) && !ip6_addr_isallrouters_linklocal(&dest)) @@ -162,7 +160,7 @@ int8_t bl_route_hook_init(void) if (lwip_netif == NULL) { - log_error("Invalid network interface\r\n"); + printf("Invalid network interface\r\n"); return -1; } @@ -177,13 +175,13 @@ int8_t bl_route_hook_init(void) hook = (bl_route_hook_t *) malloc(sizeof(bl_route_hook_t)); if (hook == NULL) { - log_error("Cannot allocate hook\r\n"); + printf("Cannot allocate hook\r\n"); return -1; } if (mld6_joingroup_netif(lwip_netif, ip_2_ip6(&router_group)) != ERR_OK) { - log_error("Failed to join multicast group\r\n"); + printf("Failed to join multicast group\r\n"); ret = -1; goto exit; } diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index dc66ec8eda7eb1..ba048759705c7f 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -35,7 +35,7 @@ steps: --target android-arm64-tv-server --target android-x64-chip-tool --target bouffalolab-bl602-iot-matter-v1-light - --target bouffalolab-bl704l-dvk-light + --target bouffalolab-bl704ldk-light --target bouffalolab-xt-zb6-devkit-light-rpc --target cc13x2x7_26x2x7-lighting --target cc13x2x7_26x2x7-lock-mtd diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 92d2eefd54f568..7b462089a8f218 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -15,7 +15,7 @@ from builders.ameba import AmebaApp, AmebaBoard, AmebaBuilder from builders.android import AndroidApp, AndroidBoard, AndroidBuilder, AndroidProfile from builders.asr import ASRApp, ASRBoard, ASRBuilder -from builders.bouffalolab import BouffalolabApp, BouffalolabBoard, BouffalolabBuilder +from builders.bouffalolab import BouffalolabApp, BouffalolabBoard, BouffalolabBuilder, BouffalolabMfd from builders.cc32xx import cc32xxApp, cc32xxBuilder from builders.cyw30739 import Cyw30739App, Cyw30739Board, Cyw30739Builder from builders.efr32 import Efr32App, Efr32Board, Efr32Builder @@ -620,11 +620,9 @@ def BuildBouffalolabTarget(): module_type="BL706C-22"), TargetPart('BL706-NIGHT-LIGHT', board=BouffalolabBoard.BL706_NIGHT_LIGHT, module_type="BL706C-22"), - TargetPart('BL706-ETH', - board=BouffalolabBoard.BL706_ETH, module_type="BL706C-22"), - TargetPart('BL706-WIFI', - board=BouffalolabBoard.BL706_WIFI, module_type="BL706C-22"), - TargetPart('BL704L-DVK', board=BouffalolabBoard.BL704L_DVK, module_type="BL704L"), + TargetPart('BL706DK', + board=BouffalolabBoard.BL706DK, module_type="BL706C-22"), + TargetPart('BL704LDK', board=BouffalolabBoard.BL704LDK, module_type="BL704L"), ]) # Apps @@ -638,6 +636,12 @@ def BuildBouffalolabTarget(): target.AppendModifier('cdc', enable_cdc=True) target.AppendModifier('resetCnt', enable_resetCnt=True) target.AppendModifier('rotating_device_id', enable_rotating_device_id=True) + target.AppendModifier('mfd', function_mfd=BouffalolabMfd.MFD_RELEASE) + target.AppendModifier('mfdtest', function_mfd=BouffalolabMfd.MFD_TEST) + target.AppendModifier('ethernet', enable_ethernet=True) + target.AppendModifier('wifi', enable_wifi=True) + target.AppendModifier('thread', enable_thread=True) + target.AppendModifier('fp', enable_frame_ptr=True) return target diff --git a/scripts/build/builders/bouffalolab.py b/scripts/build/builders/bouffalolab.py index d91f5d5633f318..85bb48c9701842 100644 --- a/scripts/build/builders/bouffalolab.py +++ b/scripts/build/builders/bouffalolab.py @@ -46,9 +46,8 @@ class BouffalolabBoard(Enum): BL602_NIGHT_LIGHT = auto() XT_ZB6_DevKit = auto() BL706_NIGHT_LIGHT = auto() - BL706_ETH = auto() - BL706_WIFI = auto() - BL704L_DVK = auto() + BL706DK = auto() + BL704LDK = auto() def GnArgName(self): if self == BouffalolabBoard.BL602_IoT_Matter_V1: @@ -59,16 +58,20 @@ def GnArgName(self): return 'XT-ZB6-DevKit' elif self == BouffalolabBoard.BL706_NIGHT_LIGHT: return 'BL706-NIGHT-LIGHT' - elif self == BouffalolabBoard.BL706_ETH: - return 'BL706-ETH' - elif self == BouffalolabBoard.BL706_WIFI: - return 'BL706-WIFI' - elif self == BouffalolabBoard.BL704L_DVK: - return 'BL704L-DVK' + elif self == BouffalolabBoard.BL706DK: + return 'BL706DK' + elif self == BouffalolabBoard.BL704LDK: + return 'BL704LDK' else: raise Exception('Unknown board #: %r' % self) +class BouffalolabMfd(Enum): + MFD_DISABLE = auto() + MFD_TEST = auto() + MFD_RELEASE = auto() + + class BouffalolabBuilder(GnBuilder): def __init__(self, @@ -82,7 +85,12 @@ def __init__(self, enable_shell: bool = False, enable_cdc: bool = False, enable_resetCnt: bool = False, - enable_rotating_device_id: bool = False + enable_rotating_device_id: bool = False, + function_mfd: BouffalolabMfd = BouffalolabMfd.MFD_DISABLE, + enable_ethernet: bool = False, + enable_wifi: bool = False, + enable_thread: bool = False, + enable_frame_ptr: bool = False ): if 'BL602' == module_type: @@ -102,6 +110,7 @@ def __init__(self, self.argsOpt = [] self.chip_name = bouffalo_chip + self.enable_frame_ptr = enable_frame_ptr toolchain = os.path.join(root, os.path.split(os.path.realpath(__file__))[0], '../../../config/bouffalolab/toolchain') toolchain = 'custom_toolchain="{}:riscv_gcc"'.format(toolchain) @@ -114,30 +123,57 @@ def __init__(self, self.argsOpt.append('board=\"{}\"'.format(self.board.GnArgName())) self.argsOpt.append('baudrate=\"{}\"'.format(baudrate)) + if not (enable_wifi or enable_thread or enable_ethernet): + # decide default connectivity for each chip + if bouffalo_chip == "bl602": + enable_wifi, enable_thread, enable_ethernet = True, False, False + elif bouffalo_chip == "bl702": + enable_wifi, enable_thread, enable_ethernet = False, True, False + elif bouffalo_chip == "bl702l": + enable_wifi, enable_thread, enable_ethernet = False, True, False + + if (enable_ethernet or enable_wifi) and enable_thread: + raise Exception('Currently, Thread cannot be enabled with Wi-Fi or Ethernet') + + # hardware connectivity support check if bouffalo_chip == "bl602": - self.argsOpt.append('chip_enable_openthread=false') - self.argsOpt.append('chip_enable_wifi=true') - if bouffalo_chip == "bl702": + + if enable_ethernet or enable_thread: + raise Exception('SoC %s doesn\'t support connectivity Ethernet/Thread.' % bouffalo_chip) + + elif bouffalo_chip == "bl702": + self.argsOpt.append('module_type=\"{}\"'.format(module_type)) - if board == BouffalolabBoard.BL706_ETH: - self.argsOpt.append('chip_config_network_layer_ble=false') - self.argsOpt.append('chip_enable_openthread=false') - self.argsOpt.append('chip_enable_wifi=false') - elif board == BouffalolabBoard.BL706_WIFI: - self.argsOpt.append('chip_enable_openthread=false') - self.argsOpt.append('chip_enable_wifi=true') - else: - self.argsOpt.append('chip_enable_openthread=true') - self.argsOpt.append('chip_enable_wifi=false') + if board != BouffalolabBoard.BL706DK: + if enable_ethernet or enable_wifi: + raise Exception('Board %s doesn\'t support connectivity Ethernet/Wi-Fi.' % board) + elif bouffalo_chip == "bl702l": - self.argsOpt.append('chip_enable_openthread=true') - self.argsOpt.append('chip_enable_wifi=false') + + if enable_ethernet or enable_wifi: + raise Exception('SoC %s doesn\'t support connectivity Ethernet/Wi-Fi currently.' % bouffalo_chip) + + self.argsOpt.append('chip_enable_ethernet={}'.format(str(enable_ethernet).lower())) + self.argsOpt.append('chip_enable_wifi={}'.format(str(enable_wifi).lower())) + self.argsOpt.append('chip_enable_openthread={}'.format(str(enable_thread).lower())) + + # for enable_ethernet, do not need ble for commissioning + self.argsOpt.append('chip_config_network_layer_ble={}'.format(str(enable_wifi or enable_thread)).lower()) + + if enable_ethernet or enable_wifi: + self.argsOpt.append('chip_mdns="minimal"') + self.argsOpt.append('chip_inet_config_enable_ipv4=true') + + if enable_thread: + self.argsOpt.append('chip_mdns="platform"') + self.argsOpt.append('chip_inet_config_enable_ipv4=false') + self.argsOpt.append('openthread_project_core_config_file="{}-openthread-core-bl-config.h"'.format(bouffalo_chip)) if enable_cdc: if bouffalo_chip != "bl702": raise Exception('Chip %s does NOT support USB CDC' % bouffalo_chip) - if board == BouffalolabBoard.BL706_ETH: - raise Exception('Board %s does NOT support USB CDC' % self.board.GnArgName()) + if enable_ethernet: + raise Exception('BL706 Ethernet does NOT support USB CDC') self.argsOpt.append('enable_cdc_module=true') @@ -153,20 +189,41 @@ def __init__(self, self.argsOpt.append('chip_enable_additional_data_advertising=true') self.argsOpt.append('chip_enable_rotating_device_id=true') + if BouffalolabMfd.MFD_DISABLE != function_mfd: + if bouffalo_chip != "bl602": + raise Exception('Only BL602 support matter factory data feature currently.') + + if BouffalolabMfd.MFD_RELEASE == function_mfd: + self.argsOpt.append("chip_enable_factory_data=true") + elif BouffalolabMfd.MFD_TEST == function_mfd: + self.argsOpt.append("chip_enable_factory_data_test=true") + + if enable_frame_ptr: + self.argsOpt.append("enable_debug_frame_ptr=true") + else: + self.argsOpt.append("enable_debug_frame_ptr=false") + try: self.argsOpt.append('bouffalolab_sdk_root="%s"' % os.environ['BOUFFALOLAB_SDK_ROOT']) except KeyError as err: - logging.fatal('Please make sure Bouffalo Lab SDK installs as below:') - logging.fatal('\tcd third_party/bouffalolab/repo') - logging.fatal('\tsudo bash scripts/setup.sh') + self.print_enviroment_error() + raise err - logging.fatal('Please make sure BOUFFALOLAB_SDK_ROOT exports before building as below:') - logging.fatal('\texport BOUFFALOLAB_SDK_ROOT=/opt/bouffalolab_sdk') + def print_enviroment_error(self): + logging.fatal('*' * 80) + logging.fatal('\tPlease make sure Bouffalo Lab SDK installs as below:') + logging.fatal('\t\tcd third_party/bouffalolab/repo') + logging.fatal('\t\tsudo bash scripts/setup.sh') - raise err + logging.fatal('\tPlease make sure BOUFFALOLAB_SDK_ROOT exports before building as below:') + logging.fatal('\t\texport BOUFFALOLAB_SDK_ROOT=/opt/bouffalolab_sdk') + logging.fatal('*' * 80) def GnBuildArgs(self): - return self.argsOpt + if self.enable_frame_ptr: + return self.argsOpt + ["debug_output_file=\"{}\"".format(os.path.join(self.output_dir, '%s.out' % self.app.AppNamePrefix(self.chip_name)))] + else: + return self.argsOpt def build_outputs(self): items = { @@ -183,7 +240,6 @@ def build_outputs(self): def PostBuildCommand(self): # Generate Bouffalo Lab format OTA image for development purpose. - ota_images_folder_path = self.output_dir + "/ota_images" ota_images_dev_image = self.output_dir + "/" + self.app.AppNamePrefix(self.chip_name) + ".bin.xz.hash" ota_images_image = self.output_dir + "/ota_images/FW_OTA.bin.xz.hash" diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 27cf157e4d6050..91bbc0a326c831 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -1,7 +1,7 @@ ameba-amebad-{all-clusters,all-clusters-minimal,light,light-switch,pigweed} asr-{asr582x,asr595x,asr550x}-{all-clusters,all-clusters-minimal,lighting,light-switch,lock,bridge,temperature-measurement,thermostat,ota-requestor,dishwasher,refrigerator}[-ota][-shell][-no_logging][-factory][-rotating_id][-rio] android-{arm,arm64,x86,x64,androidstudio-arm,androidstudio-arm64,androidstudio-x86,androidstudio-x64}-{chip-tool,chip-test,tv-server,tv-casting-app,java-matter-controller,virtual-device-app}[-no-debug] -bouffalolab-{bl602-iot-matter-v1,bl602-night-light,xt-zb6-devkit,bl706-night-light,bl706-eth,bl706-wifi,bl704l-dvk}-light[-shell][-115200][-rpc][-cdc][-resetcnt][-rotating_device_id] +bouffalolab-{bl602-iot-matter-v1,bl602-night-light,xt-zb6-devkit,bl706-night-light,bl706dk,bl704ldk}-light[-shell][-115200][-rpc][-cdc][-resetcnt][-rotating_device_id][-mfd][-mfdtest][-ethernet][-wifi][-thread][-fp] cc32xx-lock ti-cc13x2x7_26x2x7-{lighting,lock,pump,pump-controller}[-mtd] ti-cc13x4_26x4-{all-clusters,lighting,lock,pump,pump-controller}[-mtd][-ftd] diff --git a/src/lib/shell/streamer_bouffalolab.cpp b/src/lib/shell/streamer_bouffalolab.cpp index d7db7611f39d4a..ae22227dc4dd90 100644 --- a/src/lib/shell/streamer_bouffalolab.cpp +++ b/src/lib/shell/streamer_bouffalolab.cpp @@ -17,7 +17,7 @@ /** * @file - * Source implementation of an input / output stream for bl702 targets. + * Source implementation of an input / output stream for Bouffalo Lab targets. */ #include @@ -31,35 +31,34 @@ namespace chip { namespace Shell { namespace { -int streamer_bl702_init(streamer_t * streamer) +int streamer_iot_sdk_init(streamer_t * streamer) { (void) streamer; - // uartInit(); return 0; } -ssize_t streamer_bl702_read(streamer_t * streamer, char * buffer, size_t length) +ssize_t streamer_iot_sdk_read(streamer_t * streamer, char * buffer, size_t length) { (void) streamer; return (ssize_t) uartRead(buffer, (uint16_t) length); } -ssize_t streamer_bl702_write(streamer_t * streamer, const char * buffer, size_t length) +ssize_t streamer_iot_sdk_write(streamer_t * streamer, const char * buffer, size_t length) { (void) streamer; return uartWrite(buffer, (uint16_t) length); } -static streamer_t streamer_bl702 = { - .init_cb = streamer_bl702_init, - .read_cb = streamer_bl702_read, - .write_cb = streamer_bl702_write, +static streamer_t streamer_iot_sdk = { + .init_cb = streamer_iot_sdk_init, + .read_cb = streamer_iot_sdk_read, + .write_cb = streamer_iot_sdk_write, }; -} // namespace +} // namespace streamer_t * streamer_get(void) { - return &streamer_bl702; + return &streamer_iot_sdk; } } // namespace Shell diff --git a/src/lwip/BUILD.gn b/src/lwip/BUILD.gn index 24462da32a920c..3547ac1157568d 100644 --- a/src/lwip/BUILD.gn +++ b/src/lwip/BUILD.gn @@ -145,8 +145,6 @@ if (current_os == "zephyr" || current_os == "mbed") { } } else if (lwip_platform == "bl702" && defined(chip_enable_openthread) && chip_enable_openthread == false) { - # bl702 platform will use ethernet or SPI Wi-Fi for connectivity, if openthread is not enabled - import("${bouffalolab_iot_sdk_build_root}/bl702/bl_iot_sdk.gni") group("lwip") { public_deps = [ ":lwip_buildconfig" ] public_deps += [ "${bouffalolab_iot_sdk_build_root}/bl702:bl_iot_sdk" ] diff --git a/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp b/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp index 8cd34b5bf67d83..59f1cf4ba52351 100644 --- a/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp +++ b/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp @@ -17,9 +17,10 @@ #include #include -#include #include +#include + extern "C" { #include @@ -63,7 +64,12 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetBootReason(BootReasonType & bootReason CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(MutableByteSpan & BssId) { - return CopySpanToMutableSpan(ByteSpan(wifiMgmr.wifi_mgmr_stat_info.bssid), BssId); + if (ConnectivityMgrImpl()._IsWiFiStationConnected()) + { + return CopySpanToMutableSpan(ByteSpan(wifiMgmr.wifi_mgmr_stat_info.bssid), BssId); + } + + return CHIP_ERROR_READ_FAILED; } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp index b051a44a44a0d5..4ed9c9359b1f92 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp @@ -1,6 +1,6 @@ /* - * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include #include #include @@ -24,8 +22,6 @@ #include #include -#define WIFI_STA_DISCONNECT_DELAY (pdMS_TO_TICKS(200)) - using namespace ::chip; using namespace ::chip::DeviceLayer::Internal; @@ -33,11 +29,6 @@ namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { -namespace { -static char WiFiSSIDStr[DeviceLayer::Internal::kMaxWiFiSSIDLength]; -static uint8_t scan_type = 0; -} // namespace - CHIP_ERROR BLWiFiDriver::Init(NetworkStatusChangeCallback * networkStatusChangeCallback) { CHIP_ERROR err; @@ -141,24 +132,13 @@ CHIP_ERROR BLWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, { char wifi_ssid[64] = { 0 }; char passwd[64] = { 0 }; - int state = 0; + wifi_interface_t wifi_interface; ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting); - wifi_mgmr_sta_disconnect(); - vTaskDelay(WIFI_STA_DISCONNECT_DELAY); - - wifi_mgmr_sta_disable(NULL); - wifi_mgmr_state_get(&state); - while (state != WIFI_STATE_IDLE) - { - wifi_mgmr_state_get(&state); - vTaskDelay(100); - } - memcpy(wifi_ssid, ssid, ssidLen); memcpy(passwd, key, keyLen); - wifi_interface_t wifi_interface; + wifi_interface = wifi_mgmr_sta_enable(); // Valid Credentials length are: // - 0 bytes: Unsecured (open) connection @@ -234,27 +214,41 @@ void BLWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback } } -CHIP_ERROR BLWiFiDriver::StartScanWiFiNetworks(ByteSpan ssid) +void BLWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) { - CHIP_ERROR err = CHIP_NO_ERROR; + int iret = 0; - if (!ssid.empty()) - { - memset(WiFiSSIDStr, 0, sizeof(WiFiSSIDStr)); - memcpy(WiFiSSIDStr, ssid.data(), ssid.size()); - err = (CHIP_ERROR) wifi_mgmr_scan_adv(NULL, NULL, NULL, 0, NULL, WiFiSSIDStr, 1, 0); - scan_type = 1; - } - else - { - err = (CHIP_ERROR) wifi_mgmr_scan(NULL, NULL); - scan_type = 0; - } - if (err != CHIP_NO_ERROR) + if (callback != nullptr) { - return CHIP_ERROR_INTERNAL; + if (!ssid.empty()) + { + if (ssid.size() < sizeof(mScanSSID)) + { + memset(mScanSSID, 0, sizeof(mScanSSID)); + memcpy(mScanSSID, ssid.data(), ssid.size()); + iret = wifi_mgmr_scan_adv(NULL, NULL, NULL, 0, NULL, mScanSSID, 1, 0); + mScanType = 1; + } + else + { + iret = -1; + } + } + else + { + iret = wifi_mgmr_scan(NULL, NULL); + mScanType = 0; + } + + if (0 == iret) + { + mpScanCallback = callback; + } + else + { + callback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); + } } - return CHIP_NO_ERROR; } void BLWiFiDriver::OnScanWiFiNetworkDone() @@ -274,7 +268,7 @@ void BLWiFiDriver::OnScanWiFiNetworkDone() } wifi_mgmr_ap_item_t * ScanResult = (wifi_mgmr_ap_item_t *) pvPortMalloc(ap_num * sizeof(wifi_mgmr_ap_item_t)); - wifi_mgmr_get_scan_result(ScanResult, &ap_num, scan_type, WiFiSSIDStr); + wifi_mgmr_get_scan_result(ScanResult, &ap_num, 0, mScanSSID); if (ScanResult) { @@ -306,19 +300,6 @@ void BLWiFiDriver::OnScanWiFiNetworkDone() } } -void BLWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) -{ - if (callback != nullptr) - { - mpScanCallback = callback; - if (StartScanWiFiNetworks(ssid) != CHIP_NO_ERROR) - { - mpScanCallback = nullptr; - callback->OnFinished(Status::kUnknownError, CharSpan(), nullptr); - } - } -} - CHIP_ERROR GetConfiguredNetwork(Network & network) { uint8_t ssid[64]; @@ -340,7 +321,7 @@ void BLWiFiDriver::OnNetworkStatusChange() { Network configuredNetwork; bool staConnected = false; - // VerifyOrReturn(ESP32Utils::IsStationEnabled(staEnabled) == CHIP_NO_ERROR); + VerifyOrReturn(mpStatusChangeCallback != nullptr); CHIP_ERROR err = GetConfiguredNetwork(configuredNetwork); if (err != CHIP_NO_ERROR) @@ -406,9 +387,107 @@ bool BLWiFiDriver::WiFiNetworkIterator::Next(Network & item) item.connected = true; } } + return true; } +void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg) +{ + if (!(DeviceEventType::IsPlatformSpecific(event->Type) && DeviceEventType::IsPublic(event->Type))) + { + return; + } + + switch (event->Type) + { + case kWiFiOnInitDone: + break; + case kWiFiOnScanDone: + BLWiFiDriver::GetInstance().OnScanWiFiNetworkDone(); + break; + case kWiFiOnConnected: + BLWiFiDriver::GetInstance().OnNetworkStatusChange(); + break; + case kGotIpAddress: + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); + ConnectivityMgrImpl().OnConnectivityChanged(deviceInterface_getNetif()); + break; + case kGotIpv6Address: + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); + ConnectivityMgrImpl().OnConnectivityChanged(deviceInterface_getNetif()); + break; + case kWiFiOnDisconnected: + if (ConnectivityManager::kWiFiStationState_Connecting == ConnectivityMgrImpl().GetWiFiStationState()) + { + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting_Failed); + } + break; + default: + ChipLogProgress(DeviceLayer, "Undefined network commission event type %x.\r\n", event->Type); + break; + } +} + +static wifi_conf_t conf = { + .country_code = "CN", +}; + +extern "C" void wifi_event_handler(uint32_t code) +{ + ChipDeviceEvent event; + + memset(&event, 0, sizeof(ChipDeviceEvent)); + + switch (code) + { + case CODE_WIFI_ON_INIT_DONE: + wifi_mgmr_start_background(&conf); + break; + case CODE_WIFI_ON_SCAN_DONE: + event.Type = kWiFiOnScanDone; + PlatformMgr().PostEventOrDie(&event); + break; + case CODE_WIFI_ON_CONNECTED: + event.Type = kWiFiOnConnected; + PlatformMgr().PostEventOrDie(&event); + break; + case CODE_WIFI_ON_GOT_IP: + event.Type = kGotIpAddress; + PlatformMgr().PostEventOrDie(&event); + break; + case CODE_WIFI_ON_DISCONNECT: + event.Type = kWiFiOnDisconnected; + PlatformMgr().PostEventOrDie(&event); + break; + default: + ChipLogProgress(DeviceLayer, "[APP] [EVT] Unknown code %lu \r\n", code); + } +} + +extern "C" void network_netif_ext_callback(struct netif * nif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args) +{ + ChipDeviceEvent event; + + memset(&event, 0, sizeof(ChipDeviceEvent)); + + if ((LWIP_NSC_IPV6_ADDR_STATE_CHANGED & reason) && args) + { + + if (args->ipv6_addr_state_changed.addr_index >= LWIP_IPV6_NUM_ADDRESSES || + ip6_addr_islinklocal(netif_ip6_addr(nif, args->ipv6_addr_state_changed.addr_index))) + { + return; + } + + if (netif_ip6_addr_state(nif, args->ipv6_addr_state_changed.addr_index) != args->ipv6_addr_state_changed.old_state && + ip6_addr_ispreferred(netif_ip6_addr_state(nif, args->ipv6_addr_state_changed.addr_index))) + { + event.Type = kGotIpv6Address; + PlatformMgr().PostEventOrDie(&event); + } + } +} + } // namespace NetworkCommissioning } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h index 83416a534988ac..5ae1c9a610ef73 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h @@ -1,6 +1,6 @@ /* - * - * Copyright (c) 2021 Project CHIP Authors + * Copyright (c) 2022 Project CHIP Authors + * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { +void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg); + namespace { constexpr uint8_t kMaxWiFiNetworks = 1; constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; @@ -132,7 +134,6 @@ class BLWiFiDriver final : public WiFiDriver private: bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); - CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; @@ -140,6 +141,10 @@ class BLWiFiDriver final : public WiFiDriver ConnectCallback * mpConnectCallback; NetworkStatusChangeCallback * mpStatusChangeCallback = nullptr; int32_t mLastDisconnectedReason; + + /** +1 byte for string termination */ + char mScanSSID[DeviceLayer::Internal::kMaxWiFiSSIDLength + 1]; + uint32_t mScanType; }; } // namespace NetworkCommissioning diff --git a/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp b/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp index f16012851d78de..3c7b35941128c7 100644 --- a/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp @@ -16,25 +16,20 @@ */ #include -#include - +#include #include #include +#include +#include #include #include - -#include -#include +#include namespace chip { namespace DeviceLayer { -static wifi_conf_t conf = { - .country_code = "CN", -}; - static int app_entropy_source(void * data, unsigned char * output, size_t len, size_t * olen) { bl_rand_stream(reinterpret_cast(output), static_cast(len)); @@ -43,69 +38,6 @@ static int app_entropy_source(void * data, unsigned char * output, size_t len, s return 0; } -typedef void (*aos_event_cb)(input_event_t * event, void * private_data); - -void OnWiFiPlatformEvent(input_event_t * event, void * private_data) -{ - switch (event->code) - { - case CODE_WIFI_ON_INIT_DONE: { - wifi_mgmr_start_background(&conf); - } - break; - case CODE_WIFI_ON_MGMR_DONE: { - } - break; - case CODE_WIFI_ON_CONNECTED: { - ChipLogProgress(DeviceLayer, "WiFi station connected."); - } - break; - case CODE_WIFI_ON_SCAN_DONE: { - chip::DeviceLayer::PlatformMgr().LockChipStack(); - NetworkCommissioning::BLWiFiDriver::GetInstance().OnScanWiFiNetworkDone(); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - } - break; - case CODE_WIFI_ON_CONNECTING: { - ChipLogProgress(DeviceLayer, "WiFi station starts connecting."); - } - break; - case CODE_WIFI_ON_DISCONNECT: { - ChipLogProgress(DeviceLayer, "WiFi station disconnect, reason %s.", wifi_mgmr_status_code_str(event->value)); - chip::DeviceLayer::PlatformMgr().LockChipStack(); - if (ConnectivityManager::kWiFiStationState_Connecting == ConnectivityMgrImpl().GetWiFiStationState()) - { - ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting_Failed); - } - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - } - break; - case CODE_WIFI_CMD_RECONNECT: { - ChipLogProgress(DeviceLayer, "WiFi station reconnect."); - } - break; - case CODE_WIFI_ON_GOT_IP: { - ChipLogProgress(DeviceLayer, "WiFi station gets IPv4 address."); - chip::DeviceLayer::PlatformMgr().LockChipStack(); - ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); - ConnectivityMgrImpl().OnConnectivityChanged(wifi_mgmr_sta_netif_get()); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - } - break; - case CODE_WIFI_ON_GOT_IP6: { - ChipLogProgress(DeviceLayer, "WiFi station gets IPv6 address."); - chip::DeviceLayer::PlatformMgr().LockChipStack(); - ConnectivityMgrImpl().OnConnectivityChanged(wifi_mgmr_sta_netif_get()); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - } - break; - default: { - ChipLogProgress(DeviceLayer, "WiFi station gets unknow code %u.", event->code); - /*nothing*/ - } - } -} - CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) { CHIP_ERROR err = CHIP_NO_ERROR; @@ -113,10 +45,8 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) // Initialize LwIP. tcpip_init(NULL, NULL); - aos_register_event_filter(EV_WIFI, OnWiFiPlatformEvent, NULL); - hal_wifi_start_firmware_task(); - aos_post_event(EV_WIFI, CODE_WIFI_ON_INIT_DONE, 0); + ReturnErrorOnFailure(System::Clock::InitClock_RealTime()); err = chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16); SuccessOrExit(err); @@ -129,6 +59,7 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) SuccessOrExit(err); Internal::GenericPlatformManagerImpl_FreeRTOS::mEventLoopTask = backup_eventLoopTask; + wifi_start_firmware_task(); exit: return err; } diff --git a/src/platform/bouffalolab/BL602/args.gni b/src/platform/bouffalolab/BL602/args.gni index 2f8964ad4a907c..fbabcea74083b7 100644 --- a/src/platform/bouffalolab/BL602/args.gni +++ b/src/platform/bouffalolab/BL602/args.gni @@ -26,8 +26,6 @@ chip_enable_ota_requestor = true lwip_platform = "bl602" -chip_inet_config_enable_ipv4 = true - chip_build_tests = false chip_inet_config_enable_dns_resolver = false chip_inet_config_enable_tun_endpoint = false diff --git a/src/platform/bouffalolab/BL602/lwip_default_hooks.h b/src/platform/bouffalolab/BL602/lwip_default_hooks.h deleted file mode 100644 index 3c1d1d186c8836..00000000000000 --- a/src/platform/bouffalolab/BL602/lwip_default_hooks.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _LWIP_DEFAULT_HOOKS_H_ -#define _LWIP_DEFAULT_HOOKS_H_ -#include "lwip/arch.h" -#include "lwip/err.h" -#include "lwip/ip_addr.h" - -#ifdef CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT -extern struct netif * lwip_hook_ip6_route(const ip6_addr_t * src, const ip6_addr_t * dest); -#define LWIP_HOOK_IP6_ROUTE lwip_hook_ip6_route -#endif - -#ifdef CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT -extern const ip6_addr_t * lwip_hook_nd6_get_gw(struct netif * netif, const ip6_addr_t * dest); -#define LWIP_HOOK_ND6_GET_GW lwip_hook_nd6_get_gw -#endif - -#endif /* _LWIP_DEFAULT_HOOKS_H_ */ diff --git a/src/platform/bouffalolab/BL602/wifi_mgmr_portable.c b/src/platform/bouffalolab/BL602/wifi_mgmr_portable.c index 47cac9e4e10018..ae50a9c30c47aa 100644 --- a/src/platform/bouffalolab/BL602/wifi_mgmr_portable.c +++ b/src/platform/bouffalolab/BL602/wifi_mgmr_portable.c @@ -1,9 +1,12 @@ +#include #include #include +#include #include #include #include +#include #include #include @@ -12,13 +15,16 @@ #include #include +#include + extern struct wpa_sm gWpaSm; +static netif_ext_callback_t netifExtCallback; int wifi_mgmr_get_bssid(uint8_t * bssid) { int i; - for (i = 0; i < 8; i++) + for (i = 0; i < sizeof(wifiMgmr.wifi_mgmr_stat_info.bssid); i++) { bssid[i] = wifiMgmr.wifi_mgmr_stat_info.bssid[i]; } @@ -149,3 +155,18 @@ struct netif * deviceInterface_getNetif(void) { return wifi_mgmr_sta_netif_get(); } + +static void wifi_event_handler_raw(input_event_t * event, void * private_data) +{ + wifi_event_handler(event->code); +} + +void wifi_start_firmware_task(void) +{ + aos_register_event_filter(EV_WIFI, wifi_event_handler_raw, NULL); + + netif_add_ext_callback(&netifExtCallback, network_netif_ext_callback); + + hal_wifi_start_firmware_task(); + aos_post_event(EV_WIFI, CODE_WIFI_ON_INIT_DONE, 0); +} diff --git a/src/platform/bouffalolab/BL602/wifi_mgmr_portable.h b/src/platform/bouffalolab/BL602/wifi_mgmr_portable.h index aa855d23680613..f74f829a8baf76 100644 --- a/src/platform/bouffalolab/BL602/wifi_mgmr_portable.h +++ b/src/platform/bouffalolab/BL602/wifi_mgmr_portable.h @@ -18,6 +18,10 @@ bool wifi_mgmr_security_type_is_wpa2(void); bool wifi_mgmr_security_type_is_wpa3(void); struct netif * deviceInterface_getNetif(void); +void wifi_event_handler(uint32_t code); +void wifi_start_firmware_task(void); +void network_netif_ext_callback(struct netif * netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args); + #ifdef __cplusplus } #endif diff --git a/src/platform/bouffalolab/BL702/BUILD.gn b/src/platform/bouffalolab/BL702/BUILD.gn index b6a076655b3ace..ae27e225df6b01 100644 --- a/src/platform/bouffalolab/BL702/BUILD.gn +++ b/src/platform/bouffalolab/BL702/BUILD.gn @@ -20,14 +20,15 @@ import("${chip_root}/src/platform/device.gni") import("${chip_root}/src/platform/bouffalolab/common/args.gni") assert(chip_device_platform == "bl702") -assert(false == (chip_enable_wifi && chip_enable_openthread), - "Not support Wi-Fi and Thread together") +assert(chip_enable_factory_data == false) if (chip_enable_openthread) { import("//build_overrides/openthread.gni") } static_library("BL702") { + defines = [] + sources = [ "DiagnosticDataProviderImpl.cpp", "PlatformManagerImpl.cpp", @@ -73,11 +74,13 @@ static_library("BL702") { "ConfigurationManagerImpl.cpp", "ConnectivityManagerImpl.cpp", "NetworkCommissioningDriver.cpp", - "WiFiInterface.c", + "wifi_mgmr_portable.c", ] deps = [ "${chip_root}/src/lib/dnssd:platform_header" ] - } else if (chip_enable_openthread) { + } + + if (chip_enable_openthread) { # needed for MTD/FTD import("//build_overrides/bouffalolab_iot_sdk.gni") @@ -97,7 +100,9 @@ static_library("BL702") { ] deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] } - } else { + } + + if (chip_enable_ethernet) { sources += [ "ConfigurationManagerImpl.cpp", "ConnectivityManagerImpl.cpp", diff --git a/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp b/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp index ec685f82ac7547..2b09225b2259c2 100644 --- a/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp @@ -18,14 +18,14 @@ #include #include #if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#include -#endif +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET extern "C" { #include } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET namespace chip { namespace DeviceLayer { @@ -37,7 +37,9 @@ CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) return CHIP_NO_ERROR; } -#elif !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI + +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET CHIP_ERROR ConfigurationManagerImpl::GetPrimaryMACAddress(MutableByteSpan buf) { if (buf.size() != ConfigurationManager::kPrimaryMACAddressLength) @@ -47,7 +49,7 @@ CHIP_ERROR ConfigurationManagerImpl::GetPrimaryMACAddress(MutableByteSpan buf) return CHIP_NO_ERROR; } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/BL702/ConnectivityManagerImpl.cpp b/src/platform/bouffalolab/BL702/ConnectivityManagerImpl.cpp index 3f3465554bfad0..49692725f234c1 100644 --- a/src/platform/bouffalolab/BL702/ConnectivityManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/ConnectivityManagerImpl.cpp @@ -23,13 +23,13 @@ #if CHIP_DEVICE_CONFIG_ENABLE_WIFI #include -#include -#endif +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET #include #include -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET using namespace ::chip; @@ -109,15 +109,41 @@ extern "C" void wifiInterface_eventScanDone(struct netif * interface, netbus_fs_ ChipLogProgress(DeviceLayer, "wifiInterface_eventScanDone"); NetworkCommissioning::BLWiFiDriver::GetInstance().OnScanWiFiNetworkDone(pmsg); } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET extern "C" void ethernetInterface_eventGotIP(struct netif * interface) { ChipLogProgress(DeviceLayer, "ethernetInterface_eventGotIP"); ConnectivityMgrImpl().OnConnectivityChanged(interface); } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET +extern "C" void network_netif_ext_callback(struct netif * nif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args) +{ + ChipDeviceEvent event; + + memset(&event, 0, sizeof(ChipDeviceEvent)); + + if ((LWIP_NSC_IPV6_ADDR_STATE_CHANGED & reason) && args) + { + + if (args->ipv6_addr_state_changed.addr_index >= LWIP_IPV6_NUM_ADDRESSES || + ip6_addr_islinklocal(netif_ip6_addr(nif, args->ipv6_addr_state_changed.addr_index))) + { + return; + } + + if (netif_ip6_addr_state(nif, args->ipv6_addr_state_changed.addr_index) != args->ipv6_addr_state_changed.old_state && + ip6_addr_ispreferred(netif_ip6_addr_state(nif, args->ipv6_addr_state_changed.addr_index))) + { + event.Type = kGotIpv6Address; + PlatformMgr().PostEventOrDie(&event); + } + } +} +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp b/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp index 1c93df0830875c..69ccc5da6e2dd3 100644 --- a/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp +++ b/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp @@ -18,8 +18,8 @@ #include #if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#include -#endif +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI extern "C" { #include @@ -58,31 +58,31 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetBootReason(BootReasonType & bootReason #if CHIP_DEVICE_CONFIG_ENABLE_WIFI CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(MutableByteSpan & BssId) { - struct bflbwifi_ap_record ap_info; + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { ChipLogError(DeviceLayer, "Failed to get ap info."); return CHIP_ERROR_INTERNAL; } - return CopySpanToMutableSpan(ByteSpan(ap_info.bssid), BssId); + return CopySpanToMutableSpan(ByteSpan(pApInfo->bssid), BssId); } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum & securityType) { using app::Clusters::WiFiNetworkDiagnostics::SecurityTypeEnum; - struct bflbwifi_ap_record ap_info; + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { ChipLogError(DeviceLayer, "Failed to get ap info."); return CHIP_ERROR_INTERNAL; } - if (ap_info.auth_mode < (uint8_t)(SecurityTypeEnum::kUnknownEnumValue)) + if (pApInfo->auth_mode < (uint8_t)(SecurityTypeEnum::kUnknownEnumValue)) { - securityType = (SecurityTypeEnum)(ap_info.auth_mode); + securityType = (SecurityTypeEnum)(pApInfo->auth_mode); } else { @@ -99,30 +99,30 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiVersion(app::Clusters::WiFiNetwork CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiChannelNumber(uint16_t & channelNumber) { - struct bflbwifi_ap_record ap_info; + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { ChipLogError(DeviceLayer, "Failed to get ap info."); return CHIP_ERROR_INTERNAL; } - channelNumber = ap_info.channel; + channelNumber = pApInfo->channel; return CHIP_NO_ERROR; } CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiRssi(int8_t & rssi) { - struct bflbwifi_ap_record ap_info; + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { ChipLogError(DeviceLayer, "Failed to get ap info."); return CHIP_ERROR_INTERNAL; } - rssi = ap_info.rssi; + rssi = pApInfo->rssi; return CHIP_NO_ERROR; } @@ -171,6 +171,6 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBeaconRxCount(uint32_t & beaconRxC { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/BL702/EthernetInterface.c b/src/platform/bouffalolab/BL702/EthernetInterface.c index 469ffb79f64852..82ded1b92d6dd3 100644 --- a/src/platform/bouffalolab/BL702/EthernetInterface.c +++ b/src/platform/bouffalolab/BL702/EthernetInterface.c @@ -21,28 +21,17 @@ #include "EthernetInterface.h" static struct dhcp6 dhcp6_val; - -extern int8_t bl_route_hook_init(void); +static netif_ext_callback_t netifExtCallback; static void netif_status_callback(struct netif * netif) { - if (netif->flags & NETIF_FLAG_UP) + if ((netif->flags & NETIF_FLAG_UP) && !ip4_addr_isany(netif_ip4_addr(netif))) { - for (uint32_t i = 0; i < LWIP_IPV6_NUM_ADDRESSES; i++) - { - if (!ip6_addr_isany(netif_ip6_addr(netif, i)) && ip6_addr_ispreferred(netif_ip6_addr_state(netif, i))) - { - - const ip6_addr_t * ip6addr = netif_ip6_addr(netif, i); - if (ip6_addr_isany(ip6addr) || ip6_addr_islinklocal(ip6addr)) - { - continue; - } + printf("IP: %s\r\n", ip4addr_ntoa(netif_ip4_addr(netif))); + printf("MASK: %s\r\n", ip4addr_ntoa(netif_ip4_netmask(netif))); + printf("Gateway: %s\r\n", ip4addr_ntoa(netif_ip4_gw(netif))); - ethernetInterface_eventGotIP(netif); - break; - } - } + ethernetInterface_eventGotIP(netif); } } @@ -81,7 +70,7 @@ void ethernetInterface_init(void) /* Set callback to be called when interface is brought up/down or address is changed while up */ netif_set_status_callback(ð_mac, netif_status_callback); - bl_route_hook_init(); + netif_add_ext_callback(&netifExtCallback, network_netif_ext_callback); } struct netif * deviceInterface_getNetif(void) diff --git a/src/platform/bouffalolab/BL702/EthernetInterface.h b/src/platform/bouffalolab/BL702/EthernetInterface.h index 7809a5430f5c88..98e1a7fa03df49 100644 --- a/src/platform/bouffalolab/BL702/EthernetInterface.h +++ b/src/platform/bouffalolab/BL702/EthernetInterface.h @@ -25,6 +25,8 @@ void ethernetInterface_init(void); void ethernetInterface_eventGotIP(struct netif * interface); struct netif * deviceInterface_getNetif(void); +void network_netif_ext_callback(struct netif * netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args); + #ifdef __cplusplus } #endif diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp index 252a1eba7f2475..3762091fbd3e21 100644 --- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp +++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.cpp @@ -17,12 +17,11 @@ #include #include -#include +#include using namespace ::chip; using namespace ::chip::DeviceLayer::Internal; -//#if CHIP_DEVICE_CONFIG_ENABLE_WIFI namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { @@ -33,23 +32,22 @@ CHIP_ERROR BLWiFiDriver::Init(NetworkStatusChangeCallback * networkStatusChangeC size_t ssidLen = 0; size_t credentialsLen = 0; - err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiSSID, mSavedNetwork.ssid, sizeof(mSavedNetwork.ssid), - &ssidLen); - SuccessOrExit(err); - err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiPassword, mSavedNetwork.credentials, + mpScanCallback = nullptr; + mpConnectCallback = nullptr; + mpStatusChangeCallback = networkStatusChangeCallback; + + err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiSSID, mSavedNetwork.credentials, sizeof(mSavedNetwork.credentials), &credentialsLen); SuccessOrExit(err); + err = PersistedStorage::KeyValueStoreMgr().Get(BLConfig::kConfigKey_WiFiPassword, mSavedNetwork.ssid, + sizeof(mSavedNetwork.ssid), &ssidLen); + SuccessOrExit(err); - mSavedNetwork.credentialsLen = credentialsLen; - mSavedNetwork.ssidLen = ssidLen; - mSavedNetwork.credentials[mSavedNetwork.credentialsLen] = '\0'; - mSavedNetwork.ssid[mSavedNetwork.ssidLen] = '\0'; + mSavedNetwork.credentialsLen = credentialsLen; + mSavedNetwork.ssidLen = ssidLen; - mStagingNetwork = mSavedNetwork; - mpScanCallback = nullptr; - mpConnectCallback = nullptr; - mpStatusChangeCallback = networkStatusChangeCallback; - mScanSpecific = false; + mStagingNetwork = mSavedNetwork; + mScanSpecific = false; exit: if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND) @@ -123,6 +121,7 @@ Status BLWiFiDriver::RemoveNetwork(ByteSpan networkId, MutableCharSpan & outDebu Status BLWiFiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, MutableCharSpan & outDebugText) { outDebugText.reduce_size(0); + // Only one network is supported now VerifyOrReturnError(index == 0, Status::kOutOfRange); VerifyOrReturnError(NetworkMatch(mStagingNetwork, networkId), Status::kNetworkIDNotFound); @@ -145,7 +144,8 @@ CHIP_ERROR BLWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen || keyLen == BLWiFiDriver::WiFiCredentialLength::kWEP64 || (keyLen >= BLWiFiDriver::WiFiCredentialLength::kMinWPAPSK && keyLen <= BLWiFiDriver::WiFiCredentialLength::kMaxWPAPSK)) { - + wifiInterface_disconnect(); + vTaskDelay(500); if (keyLen == BLWiFiDriver::WiFiCredentialLength::kOpen) { wifiInterface_connect((char *) ssid, NULL); @@ -187,11 +187,9 @@ void BLWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback VerifyOrExit(NetworkMatch(mStagingNetwork, networkId), networkingStatus = Status::kNetworkIDNotFound); VerifyOrExit(mpConnectCallback == nullptr, networkingStatus = Status::kUnknownError); - ChipLogProgress(NetworkProvisioning, "BL702 Network Commissioning ConnectNetwork: SSID: %.*s", - static_cast(networkId.size()), networkId.data()); + ChipLogProgress(NetworkProvisioning, "BL NetworkCommissioningDelegate: SSID: %.*s", static_cast(networkId.size()), + networkId.data()); - mStagingNetwork.ssid[mStagingNetwork.ssidLen] = '\0'; - mStagingNetwork.credentials[mStagingNetwork.credentialsLen] = '\0'; err = ConnectWiFiNetwork(reinterpret_cast(mStagingNetwork.ssid), mStagingNetwork.ssidLen, reinterpret_cast(mStagingNetwork.credentials), mStagingNetwork.credentialsLen); mpConnectCallback = callback; @@ -209,14 +207,34 @@ void BLWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback } } -void BLWiFiDriver::OnScanWiFiNetworkDone(void * arg) +void BLWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) { - netbus_fs_scan_ind_cmd_msg_t * pmsg = (netbus_fs_scan_ind_cmd_msg_t *) arg; - size_t i = 0, ap_num = pmsg->num; + if (callback != nullptr) + { + ChipLogError(NetworkProvisioning, "ssid.data(): %s", ssid.data()); + + if (ssid.data()) + { + memset(mScanSSID, 0, sizeof(mScanSSID)); + memcpy(mScanSSID, ssid.data(), ssid.size()); + mScanSpecific = true; + } + mpScanCallback = callback; + wifiInterface_startScan(); + } +} + +void BLWiFiDriver::OnScanWiFiNetworkDone(void * opaque) +{ + netbus_wifi_mgmr_msg_cmd_t * pkg_data = (netbus_wifi_mgmr_msg_cmd_t *) ((struct pkg_protocol *) opaque)->payload; + netbus_fs_scan_ind_cmd_msg_t * pmsg = (netbus_fs_scan_ind_cmd_msg_t *) ((netbus_fs_scan_ind_cmd_msg_t *) pkg_data); + + size_t i = 0, ap_num = 0; WiFiScanResponse *pScanResponse, *p; for (i = 0; i < pmsg->num; i++) { + ChipLogProgress(DeviceLayer, "OnScanWiFiNetworkDone %s", pmsg->records[i].ssid); if (mScanSpecific && !strcmp(mScanSSID, (char *) (pmsg->records[i].ssid))) { ap_num = 1; @@ -224,7 +242,7 @@ void BLWiFiDriver::OnScanWiFiNetworkDone(void * arg) } } - if (0 == ap_num || (mScanSpecific && ap_num == pmsg->num)) + if (0 == pmsg->num || (mScanSpecific && 0 == ap_num)) { ChipLogProgress(DeviceLayer, "No AP found"); if (mpScanCallback != nullptr) @@ -235,7 +253,15 @@ void BLWiFiDriver::OnScanWiFiNetworkDone(void * arg) return; } - p = pScanResponse = (WiFiScanResponse *) malloc(sizeof(WiFiScanResponse) * ap_num); + if (ap_num) + { + p = pScanResponse = (WiFiScanResponse *) malloc(sizeof(WiFiScanResponse) * ap_num); + } + else + { + p = pScanResponse = (WiFiScanResponse *) malloc(sizeof(WiFiScanResponse) * pmsg->num); + ap_num = pmsg->num; + } for (i = 0; i < pmsg->num; i++) { if (mScanSpecific && strcmp(mScanSSID, (char *) (pmsg->records[i].ssid))) @@ -280,39 +306,25 @@ void BLWiFiDriver::OnScanWiFiNetworkDone(void * arg) free(pScanResponse); } -void BLWiFiDriver::ScanNetworks(ByteSpan ssid, WiFiDriver::ScanCallback * callback) -{ - if (callback != nullptr) - { - if (ssid.data()) - { - memset(mScanSSID, 0, sizeof(mScanSSID)); - memcpy(mScanSSID, ssid.data(), ssid.size()); - mScanSpecific = true; - } - mpScanCallback = callback; - wifiInterface_startScan(); - } -} - CHIP_ERROR GetConfiguredNetwork(Network & network) { - struct bflbwifi_ap_record ap_info; - - ChipLogProgress(DeviceLayer, "GetConfiguredNetwork"); + struct bflbwifi_ap_record * pApInfo = wifiInterface_getApInfo(); - if (!wifiInterface_getApInfo(&ap_info)) + if (NULL == pApInfo) { return CHIP_ERROR_INTERNAL; } - uint8_t length = strnlen(reinterpret_cast(ap_info.ssid), DeviceLayer::Internal::kMaxWiFiSSIDLength); + ChipLogProgress(DeviceLayer, "GetConfiguredNetwork [%s]", pApInfo->ssid); + + uint8_t length = strnlen(reinterpret_cast(pApInfo->ssid), DeviceLayer::Internal::kMaxWiFiSSIDLength); if (length > sizeof(network.networkID)) { ChipLogError(DeviceLayer, "SSID too long"); return CHIP_ERROR_INTERNAL; } - memcpy(network.networkID, ap_info.ssid, length); + + memcpy(network.networkID, pApInfo->ssid, length); network.networkIDLen = length; return CHIP_NO_ERROR; } @@ -334,6 +346,7 @@ void BLWiFiDriver::OnNetworkStatusChange() if (ConnectivityMgrImpl().GetWiFiStationState() == ConnectivityManager::kWiFiStationState_Connected) { + ChipLogProgress(DeviceLayer, "OnNetworkStatusChange kWiFiStationState_Connected, %s", configuredNetwork.networkID); staConnected = true; } @@ -390,7 +403,64 @@ bool BLWiFiDriver::WiFiNetworkIterator::Next(Network & item) return true; } +void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg) +{ + if (!(DeviceEventType::IsPlatformSpecific(event->Type) && DeviceEventType::IsPublic(event->Type))) + { + return; + } + + switch (event->Type) + { + case kWiFiOnInitDone: + break; + case kWiFiOnConnected: + BLWiFiDriver::GetInstance().OnNetworkStatusChange(); + break; + case kGotIpAddress: + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); + ConnectivityMgrImpl().OnConnectivityChanged(deviceInterface_getNetif()); + break; + case kGotIpv6Address: + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManagerImpl::kWiFiStationState_Connected); + ConnectivityMgrImpl().OnConnectivityChanged(deviceInterface_getNetif()); + break; + case kWiFiOnDisconnected: + if (ConnectivityManager::kWiFiStationState_Connecting == ConnectivityMgrImpl().GetWiFiStationState()) + { + ConnectivityMgrImpl().ChangeWiFiStationState(ConnectivityManager::kWiFiStationState_Connecting_Failed); + } + break; + default: + ChipLogProgress(DeviceLayer, "Undefined network commission event type %x.\r\n", event->Type); + break; + } +} + +extern "C" void wifi_event_handler(uint32_t code) +{ + ChipDeviceEvent event; + + memset(&event, 0, sizeof(ChipDeviceEvent)); + switch (code) + { + case VIRT_NET_EV_ON_CONNECTED: + event.Type = kWiFiOnConnected; + PlatformMgr().PostEventOrDie(&event); + break; + case VIRT_NET_EV_ON_GOT_IP: + event.Type = kGotIpAddress; + PlatformMgr().PostEventOrDie(&event); + break; + case VIRT_NET_EV_ON_DISCONNECT: + event.Type = kWiFiOnDisconnected; + PlatformMgr().PostEventOrDie(&event); + break; + default: + ChipLogProgress(DeviceLayer, "[APP] [EVT] Unknown code %lu \r\n", code); + } +} + } // namespace NetworkCommissioning } // namespace DeviceLayer } // namespace chip -//#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h index caa071ddd467b2..5c9e5637857a14 100644 --- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h @@ -17,12 +17,15 @@ #pragma once +#include #include namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { +void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg); + namespace { constexpr uint8_t kMaxWiFiNetworks = 1; constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; @@ -49,9 +52,9 @@ class BLScanResponseIterator : public Iterator void Release() override {} private: + const size_t mSize; + const WiFiScanResponse * mpScanResults; size_t mIternum = 0; - size_t mSize; - WiFiScanResponse * mpScanResults; }; class BLWiFiDriver final : public WiFiDriver @@ -73,9 +76,9 @@ class BLWiFiDriver final : public WiFiDriver struct WiFiNetwork { - char ssid[DeviceLayer::Internal::kMaxWiFiSSIDLength + 1]; + char ssid[DeviceLayer::Internal::kMaxWiFiSSIDLength]; uint8_t ssidLen = 0; - char credentials[DeviceLayer::Internal::kMaxWiFiKeyLength + 1]; + char credentials[DeviceLayer::Internal::kMaxWiFiKeyLength]; uint8_t credentialsLen = 0; }; enum WiFiCredentialLength @@ -107,10 +110,11 @@ class BLWiFiDriver final : public WiFiDriver Status AddOrUpdateNetwork(ByteSpan ssid, ByteSpan credentials, MutableCharSpan & outDebugText, uint8_t & outNetworkIndex) override; void ScanNetworks(ByteSpan ssid, ScanCallback * callback) override; + CHIP_ERROR ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen); void OnConnectWiFiNetwork(bool isConnected); - void OnScanWiFiNetworkDone(void * arg); - void OnNetworkStatusChange(); + void OnScanWiFiNetworkDone(void * opaque = NULL); + void OnNetworkStatusChange(void); CHIP_ERROR SetLastDisconnectReason(const ChipDeviceEvent * event); int32_t GetLastDisconnectReason(); @@ -123,7 +127,6 @@ class BLWiFiDriver final : public WiFiDriver private: bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId); - CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid); WiFiNetwork mSavedNetwork; WiFiNetwork mStagingNetwork; @@ -131,6 +134,8 @@ class BLWiFiDriver final : public WiFiDriver ConnectCallback * mpConnectCallback; NetworkStatusChangeCallback * mpStatusChangeCallback = nullptr; int32_t mLastDisconnectedReason; + + /** +1 byte for string termination */ char mScanSSID[chip::DeviceLayer::Internal::kMaxWiFiSSIDLength + 1]; bool mScanSpecific = false; }; diff --git a/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp b/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp index db91cda12ed06b..1edc80bb21eed4 100644 --- a/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp @@ -25,16 +25,18 @@ #include #if CHIP_DEVICE_CONFIG_ENABLE_WIFI -#include -#endif +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI #if CHIP_DEVICE_CONFIG_ENABLE_THREAD #include #include -#else -#include #endif +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET +#include +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + extern "C" { #include } @@ -63,24 +65,17 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) // Initialize LwIP. tcpip_init(NULL, NULL); -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI - wifiInterface_init(); -#elif CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD otRadio_opt_t opt; - opt.byte = 0; + opt.bf.isFtd = true; opt.bf.isCoexEnable = true; ot_alarmInit(); ot_radioInit(opt); -#else - ethernetInterface_init(); -#endif +#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD ReturnErrorOnFailure(System::Clock::InitClock_RealTime()); - SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance()); - SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance()); - err = chip::Crypto::add_entropy_source(app_entropy_source, NULL, 16); SuccessOrExit(err); @@ -92,6 +87,14 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) SuccessOrExit(err); Internal::GenericPlatformManagerImpl_FreeRTOS::mEventLoopTask = backup_eventLoopTask; +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI + wifi_start_firmware_task(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI + +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + ethernetInterface_init(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + exit: return err; } diff --git a/src/platform/bouffalolab/BL702/args.gni b/src/platform/bouffalolab/BL702/args.gni index 4a3494612104ac..ba2962717104cc 100644 --- a/src/platform/bouffalolab/BL702/args.gni +++ b/src/platform/bouffalolab/BL702/args.gni @@ -17,6 +17,7 @@ import("//build_overrides/chip.gni") import("//build_overrides/mbedtls.gni") import("//build_overrides/pigweed.gni") import("${chip_root}/examples/platform/bouffalolab/bl702/args.gni") +import("${chip_root}/src/platform/bouffalolab/common/args.gni") chip_device_platform = "bl702" @@ -28,13 +29,12 @@ riscv_platform_config = "${bouffalolab_iot_sdk_build_root}/common/rsicv.gni" mbedtls_target = "${bouffalolab_iot_sdk_build_root}/bl702:bl_iot_sdk" -chip_inet_config_enable_ipv4 = false chip_inet_config_enable_tcp_endpoint = false chip_build_tests = false openthread_external_mbedtls = mbedtls_target -openthread_project_core_config_file = "bl702-openthread-core-bl-config.h" + openthread_core_config_platform_check_file = "bl702-openthread-core-bl-config-check.h" openthread_project_include_dirs = diff --git a/src/platform/bouffalolab/BL702/bl702-openthread-core-bl-config.h b/src/platform/bouffalolab/BL702/bl702-openthread-core-bl-config.h index e25197c8011f10..6bc32bebc35f3f 100644 --- a/src/platform/bouffalolab/BL702/bl702-openthread-core-bl-config.h +++ b/src/platform/bouffalolab/BL702/bl702-openthread-core-bl-config.h @@ -60,8 +60,8 @@ #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 0 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 0 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 1 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1 +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 0 +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 0 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 1 #define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 @@ -77,4 +77,7 @@ // #define OPENTHREAD_CONFIG_MAC_CSL_TRANSMITTER_ENABLE 0 #define OPENTHREAD_CONFIG_TCP_ENABLE 0 +#define OPENTHREAD_CONFIG_PING_SENDER_ENABLE 1 +// #define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG + #endif // OPENTHREAD_CORE_BL702_CONFIG_H_ diff --git a/src/platform/bouffalolab/BL702/lwip_default_hooks.h b/src/platform/bouffalolab/BL702/lwip_default_hooks.h deleted file mode 100644 index 3c1d1d186c8836..00000000000000 --- a/src/platform/bouffalolab/BL702/lwip_default_hooks.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _LWIP_DEFAULT_HOOKS_H_ -#define _LWIP_DEFAULT_HOOKS_H_ -#include "lwip/arch.h" -#include "lwip/err.h" -#include "lwip/ip_addr.h" - -#ifdef CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT -extern struct netif * lwip_hook_ip6_route(const ip6_addr_t * src, const ip6_addr_t * dest); -#define LWIP_HOOK_IP6_ROUTE lwip_hook_ip6_route -#endif - -#ifdef CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT -extern const ip6_addr_t * lwip_hook_nd6_get_gw(struct netif * netif, const ip6_addr_t * dest); -#define LWIP_HOOK_ND6_GET_GW lwip_hook_nd6_get_gw -#endif - -#endif /* _LWIP_DEFAULT_HOOKS_H_ */ diff --git a/src/platform/bouffalolab/BL702/WiFiInterface.c b/src/platform/bouffalolab/BL702/wifi_mgmr_portable.c similarity index 57% rename from src/platform/bouffalolab/BL702/WiFiInterface.c rename to src/platform/bouffalolab/BL702/wifi_mgmr_portable.c index 1634edc04256a0..05b9f4b7317b1e 100644 --- a/src/platform/bouffalolab/BL702/WiFiInterface.c +++ b/src/platform/bouffalolab/BL702/wifi_mgmr_portable.c @@ -16,6 +16,7 @@ */ #include #include +#include #include #include @@ -24,71 +25,48 @@ #include #include -#include -#include - -#include -#include +#include virt_net_t vnet_spi; -struct bflbwifi_ap_record vnet_ap_record; -SemaphoreHandle_t vnet_msgSem = NULL; - -extern int8_t bl_route_hook_init(void); +static struct bflbwifi_ap_record vnet_ap_record; +static netif_ext_callback_t netifExtCallback; /* event callback */ static int virt_net_spi_event_cb(virt_net_t obj, enum virt_net_event_code code, void * opaque) { + struct bflbwifi_ap_record * record; + assert(obj != NULL); - switch (code) + if (VIRT_NET_EV_ON_LINK_STATUS_DONE == code) { - case VIRT_NET_EV_ON_CONNECTED: - wifiInterface_eventConnected((struct netif *) &obj->netif); - break; - case VIRT_NET_EV_ON_DISCONNECT: - wifiInterface_eventDisconnected((struct netif *) &obj->netif); - break; - - case VIRT_NET_EV_ON_LINK_STATUS_DONE: { - struct bflbwifi_ap_record * record; netbus_fs_link_status_ind_cmd_msg_t * pkg_data; pkg_data = (netbus_fs_link_status_ind_cmd_msg_t *) ((struct pkg_protocol *) opaque)->payload; record = &pkg_data->record; memcpy(&vnet_ap_record, record, sizeof(struct bflbwifi_ap_record)); - wifiInterface_eventLinkStatusDone((struct netif *) &obj->netif, pkg_data); - - if (vnet_msgSem) + if (record->link_status == BF1B_WIFI_LINK_STATUS_DOWN) { - xSemaphoreGive(vnet_msgSem); + code = VIRT_NET_EV_ON_DISCONNECT; + } + else + { + code = -1; + return 0; } - - break; } - - case VIRT_NET_EV_ON_GOT_IP: { - wifiInterface_eventGotIP((struct netif *) &obj->netif); - break; + else if (VIRT_NET_EV_ON_SCAN_DONE == code) + { + wifiInterface_eventScanDone((struct netif *) &obj->netif, opaque); } - case VIRT_NET_EV_ON_SCAN_DONE: { - netbus_wifi_mgmr_msg_cmd_t * pkg_data; - pkg_data = (netbus_wifi_mgmr_msg_cmd_t *) ((struct pkg_protocol *) opaque)->payload; - - netbus_fs_scan_ind_cmd_msg_t * msg; - msg = (netbus_fs_scan_ind_cmd_msg_t *) ((netbus_fs_scan_ind_cmd_msg_t *) pkg_data); - wifiInterface_eventScanDone((struct netif *) &obj->netif, msg); - } - default: - break; - } + wifi_event_handler(code); return 0; } -bool wifiInterface_init() +bool wifi_start_firmware_task(void) { vnet_spi = virt_net_create(NULL); if (vnet_spi == NULL) @@ -101,16 +79,10 @@ bool wifiInterface_init() return false; } - vnet_msgSem = xSemaphoreCreateBinary(); - if (vnet_msgSem == NULL) - { - return false; - } - virt_net_setup_callback(vnet_spi, virt_net_spi_event_cb, NULL); netifapi_netif_set_default((struct netif *) &vnet_spi->netif); - bl_route_hook_init(); + netif_add_ext_callback(&netifExtCallback, network_netif_ext_callback); return true; } @@ -125,9 +97,19 @@ struct netif * deviceInterface_getNetif(void) return NULL; } +struct netif * otbr_getBackboneNetif(void) +{ + if (vnet_spi) + { + return (struct netif *) &vnet_spi->netif; + } + + return NULL; +} + void wifiInterface_getMacAddress(uint8_t * pmac) { - virt_net_get_mac(vnet_spi, pmac); + memcpy(pmac, vnet_spi->mac, sizeof(vnet_spi->mac)); } void wifiInterface_connect(char * ssid, char * passwd) @@ -140,19 +122,15 @@ void wifiInterface_disconnect(void) virt_net_disconnect(vnet_spi); } -bool wifiInterface_getApInfo(struct bflbwifi_ap_record * ap_info) +struct bflbwifi_ap_record * wifiInterface_getApInfo(void) { - virt_net_get_link_status(vnet_spi); - - if (vnet_msgSem && xSemaphoreTake(vnet_msgSem, 3000)) + memset(&vnet_ap_record, 0, sizeof(struct bflbwifi_ap_record)); + if (0 == virt_net_get_link_status(vnet_spi)) { - if (ap_info) - { - memcpy(ap_info, &vnet_ap_record, sizeof(struct bflbwifi_ap_record)); - } - return true; + return &vnet_ap_record; } - return false; + + return NULL; } void wifiInterface_startScan(void) diff --git a/src/platform/bouffalolab/BL702/WiFiInterface.h b/src/platform/bouffalolab/BL702/wifi_mgmr_portable.h similarity index 83% rename from src/platform/bouffalolab/BL702/WiFiInterface.h rename to src/platform/bouffalolab/BL702/wifi_mgmr_portable.h index e48e0da6cba63b..4d152355c405c1 100644 --- a/src/platform/bouffalolab/BL702/WiFiInterface.h +++ b/src/platform/bouffalolab/BL702/wifi_mgmr_portable.h @@ -22,14 +22,13 @@ extern "C" { #endif #include - -bool wifiInterface_init(); +#include struct netif * deviceInterface_getNetif(void); void wifiInterface_getMacAddress(uint8_t * pmac); void wifiInterface_connect(char * ssid, char * passwd); void wifiInterface_disconnect(void); -bool wifiInterface_getApInfo(struct bflbwifi_ap_record * ap_info); +struct bflbwifi_ap_record * wifiInterface_getApInfo(void); void wifiInterface_startScan(void); void wifiInterface_eventConnected(struct netif * interface); @@ -39,6 +38,11 @@ void wifiInterface_eventLinkStatusDone(struct netif * interface, netbus_fs_link_ void wifiInterface_eventGotIP(struct netif * interface); void wifiInterface_eventScanDone(struct netif * interface, netbus_fs_scan_ind_cmd_msg_t * pmsg); +void wifi_event_handler(uint32_t code); +bool wifi_start_firmware_task(void); + +void network_netif_ext_callback(struct netif * netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t * args); + #ifdef __cplusplus } #endif diff --git a/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp b/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp index 798e0c1413e220..3072f3aa26dcab 100644 --- a/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp @@ -68,9 +68,6 @@ CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) ReturnErrorOnFailure(System::Clock::InitClock_RealTime()); - SetConfigurationMgr(&ConfigurationManagerImpl::GetDefaultInstance()); - SetDiagnosticDataProvider(&DiagnosticDataProviderImpl::GetDefaultInstance()); - // Initialize LwIP. tcpip_init(NULL, NULL); diff --git a/src/platform/bouffalolab/BL702L/args.gni b/src/platform/bouffalolab/BL702L/args.gni index 58c45b87113ff5..f9a81a293f40c5 100644 --- a/src/platform/bouffalolab/BL702L/args.gni +++ b/src/platform/bouffalolab/BL702L/args.gni @@ -28,13 +28,12 @@ riscv_platform_config = "${bouffalolab_iot_sdk_build_root}/common/rsicv.gni" mbedtls_target = "${bouffalolab_iot_sdk_build_root}/bl702l:bl_iot_sdk" -chip_inet_config_enable_ipv4 = false chip_inet_config_enable_tcp_endpoint = false chip_build_tests = false openthread_external_mbedtls = mbedtls_target -openthread_project_core_config_file = "bl702l-openthread-core-bl-config.h" + openthread_core_config_platform_check_file = "bl702l-openthread-core-bl-config-check.h" openthread_project_include_dirs = diff --git a/src/platform/bouffalolab/BL702L/bl702l-openthread-core-bl-config.h b/src/platform/bouffalolab/BL702L/bl702l-openthread-core-bl-config.h index e25197c8011f10..7836304f8a0401 100644 --- a/src/platform/bouffalolab/BL702L/bl702l-openthread-core-bl-config.h +++ b/src/platform/bouffalolab/BL702L/bl702l-openthread-core-bl-config.h @@ -60,8 +60,8 @@ #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 0 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 0 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 1 -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1 +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE 0 +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 0 #define OPENTHREAD_CONFIG_MAC_SOFTWARE_ENERGY_SCAN_ENABLE 1 #define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1 diff --git a/src/platform/bouffalolab/common/BLEManagerImpl.cpp b/src/platform/bouffalolab/common/BLEManagerImpl.cpp index b233721953161e..1cb6ce696f73e6 100644 --- a/src/platform/bouffalolab/common/BLEManagerImpl.cpp +++ b/src/platform/bouffalolab/common/BLEManagerImpl.cpp @@ -29,7 +29,7 @@ #endif extern "C" { -#ifdef BL702L +#if CHIP_DEVICE_LAYER_TARGET_BL702L #include #else #include @@ -124,7 +124,7 @@ CHIP_ERROR BLEManagerImpl::_Init() memset(mSubscribedConns, 0, sizeof(mSubscribedConns)); ReturnErrorOnFailure(InitRandomStaticAddress()); -#ifdef BL702L +#if CHIP_DEVICE_LAYER_TARGET_BL702L btble_controller_init(configMAX_PRIORITIES - 1); #else ble_controller_init(configMAX_PRIORITIES - 1); diff --git a/src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h b/src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h index 8746bebf82bfe8..a7ee3ec529f146 100644 --- a/src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h +++ b/src/platform/bouffalolab/common/CHIPDevicePlatformEvent.h @@ -19,8 +19,10 @@ #include +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE #include #include +#endif namespace chip { namespace DeviceLayer { @@ -51,6 +53,7 @@ enum InternalPlatformSpecificEventTypes } // namespace DeviceEventType +#if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE struct BleConnEventType { bt_conn * BtConn; @@ -88,6 +91,11 @@ struct ChipDevicePlatformEvent final BleC2IndDoneEventType BleC2IndDoneEvent; }; }; +#else +struct ChipDevicePlatformEvent final +{ +}; +#endif } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/common/CHIPPlatformConfig.h b/src/platform/bouffalolab/common/CHIPPlatformConfig.h index 3cb267bdcb6b1e..94fe3e715580c8 100644 --- a/src/platform/bouffalolab/common/CHIPPlatformConfig.h +++ b/src/platform/bouffalolab/common/CHIPPlatformConfig.h @@ -19,9 +19,10 @@ #include -// ==================== General Platform Adaptations ==================== -#define ChipDie() abort() +extern "C" void bflb_assert(void); +#define CHIP_CONFIG_ABORT() bflb_assert() +// ==================== General Platform Adaptations ==================== #define CHIP_CONFIG_PERSISTED_STORAGE_KEY_TYPE const char * #define CHIP_CONFIG_PERSISTED_STORAGE_ENC_MSG_CNTR_ID 1 #define CHIP_CONFIG_PERSISTED_STORAGE_MAX_KEY_LENGTH 2 @@ -29,9 +30,6 @@ #define CHIP_CONFIG_LIFETIIME_PERSISTED_COUNTER_KEY BLConfig::kConfigKey_LifeTimeCounter // ==================== Security Adaptations ==================== -//#define CHIP_CONFIG_SHA256_CONTEXT_SIZE sizeof(bl_sha_ctx_t) -#define CHIP_CONFIG_SHA256_CONTEXT_SIZE ((1 + 5 + 18 + 16 + 16) * sizeof(unsigned int)) - #define CHIP_CONFIG_AES_IMPLEMENTATION_OPENSSL 0 #define CHIP_CONFIG_AES_IMPLEMENTATION_AESNI 0 #define CHIP_CONFIG_AES_IMPLEMENTATION_MBEDTLS 1 diff --git a/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp b/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp index 4d6a50e485fe11..4495a7a08ade1b 100644 --- a/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp +++ b/src/platform/bouffalolab/common/ConfigurationManagerImpl.cpp @@ -21,9 +21,7 @@ #include -extern "C" { -#include -} +extern "C" void hal_reboot(void); namespace chip { namespace DeviceLayer { @@ -200,7 +198,8 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) // Restart the system. ChipLogProgress(DeviceLayer, "System restarting"); - bl_sys_reset_por(); + + hal_reboot(); } ConfigurationManager & ConfigurationMgrImpl() diff --git a/src/platform/bouffalolab/common/ConfigurationManagerImpl.h b/src/platform/bouffalolab/common/ConfigurationManagerImpl.h index d882f76f89e3bf..1e7bb53922eb79 100644 --- a/src/platform/bouffalolab/common/ConfigurationManagerImpl.h +++ b/src/platform/bouffalolab/common/ConfigurationManagerImpl.h @@ -65,7 +65,7 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp CHIP_ERROR GetPrimaryWiFiMACAddress(uint8_t * buf) override; #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_WIFI && !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET CHIP_ERROR GetPrimaryMACAddress(MutableByteSpan buf) override; #endif diff --git a/src/platform/bouffalolab/common/ConnectivityManagerImpl.cpp b/src/platform/bouffalolab/common/ConnectivityManagerImpl.cpp index a74cf5dd1cf686..598d40a24b31e4 100644 --- a/src/platform/bouffalolab/common/ConnectivityManagerImpl.cpp +++ b/src/platform/bouffalolab/common/ConnectivityManagerImpl.cpp @@ -33,12 +33,15 @@ #if CHIP_DEVICE_CONFIG_ENABLE_WIFI #include -#ifdef BL602 +#if CHIP_DEVICE_LAYER_TARGET_BL602 #include #endif -#ifdef BL702 +#if CHIP_DEVICE_LAYER_TARGET_BL702 #include #endif +#if CHIP_DEVICE_LAYER_TARGET_BL616 +#include +#endif #endif #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE @@ -71,6 +74,8 @@ CHIP_ERROR ConnectivityManagerImpl::_Init() #if CHIP_DEVICE_CONFIG_ENABLE_WIFI mWiFiStationState = ConnectivityManager::kWiFiStationState_NotConnected; ReturnErrorOnFailure(SetWiFiStationMode(kWiFiStationMode_Enabled)); + + PlatformMgr().AddEventHandler(NetworkCommissioning::NetworkEventHandler, 0); #endif return CHIP_NO_ERROR; @@ -226,7 +231,7 @@ void ConnectivityManagerImpl::DriveStationState() } break; case ConnectivityManager::kWiFiStationState_Connected: { - ChipLogProgress(DeviceLayer, "Wi-Fi stattion connected."); + ChipLogProgress(DeviceLayer, "Wi-Fi station connected."); OnWiFiStationConnected(); SystemLayer().ScheduleLambda([]() { NetworkCommissioning::BLWiFiDriver::GetInstance().OnConnectWiFiNetwork(true); }); } @@ -247,7 +252,7 @@ void ConnectivityManagerImpl::DriveStationState(::chip::System::Layer * aLayer, } #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET || CHIP_DEVICE_CONFIG_ENABLE_WIFI void ConnectivityManagerImpl::OnConnectivityChanged(struct netif * interface) { bool haveIPv4Conn = false; @@ -308,11 +313,13 @@ void ConnectivityManagerImpl::OnConnectivityChanged(struct netif * interface) if (haveIPv4Conn != hadIPv4Conn) { + memset(&m_ip4addr, 0, sizeof(ip4_addr_t)); ChipLogProgress(DeviceLayer, "%s Internet connectivity %s", "IPv4", (haveIPv4Conn) ? "ESTABLISHED" : "LOST"); } if (haveIPv6Conn != hadIPv6Conn) { + memset(&m_ip6addr, 0, sizeof(ip6_addr_t) * LWIP_IPV6_NUM_ADDRESSES); ChipLogProgress(DeviceLayer, "%s Internet connectivity %s", "IPv6", (haveIPv6Conn) ? "ESTABLISHED" : "LOST"); } } diff --git a/src/platform/bouffalolab/common/ConnectivityManagerImpl.h b/src/platform/bouffalolab/common/ConnectivityManagerImpl.h index 0011a8b0fc1467..80b1d980d4f9d1 100644 --- a/src/platform/bouffalolab/common/ConnectivityManagerImpl.h +++ b/src/platform/bouffalolab/common/ConnectivityManagerImpl.h @@ -42,6 +42,16 @@ namespace chip { namespace DeviceLayer { +enum +{ + kWiFiOnInitDone = DeviceEventType::kRange_PublicPlatformSpecific, + kWiFiOnScanDone, + kWiFiOnConnected, + kGotIpAddress, + kGotIpv6Address, + kWiFiOnDisconnected, +}; + class ConnectivityManagerImpl final : public ConnectivityManager, public Internal::GenericConnectivityManagerImpl, public Internal::GenericConnectivityManagerImpl_UDP, @@ -79,7 +89,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, void OnWiFiStationDisconnected(void); #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET void OnConnectivityChanged(struct netif * interface); void OnIPv4AddressAvailable(); void OnIPv6AddressAvailable(); @@ -100,9 +110,10 @@ class ConnectivityManagerImpl final : public ConnectivityManager, void _ClearWiFiStationProvision(); void _OnWiFiStationProvisionChange(); CHIP_ERROR ConnectProvisionedWiFiNetwork(); -#elif !CHIP_DEVICE_CONFIG_ENABLE_THREAD - enum class ConnectivityFlags : uint16_t - { +#endif + +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + enum class ConnectivityFlags : uint16_t{ kHaveIPv4InternetConnectivity = 0x0001, kHaveIPv6InternetConnectivity = 0x0002, kAwaitingConnectivity = 0x0010, @@ -110,7 +121,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager, BitFlags mConnectivityFlag; #endif -#if !CHIP_DEVICE_CONFIG_ENABLE_THREAD +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET ip4_addr_t m_ip4addr; ip6_addr_t m_ip6addr[LWIP_IPV6_NUM_ADDRESSES]; #endif diff --git a/src/platform/bouffalolab/common/Logging.cpp b/src/platform/bouffalolab/common/Logging.cpp index e008fcd022b331..b9ccf882c61165 100644 --- a/src/platform/bouffalolab/common/Logging.cpp +++ b/src/platform/bouffalolab/common/Logging.cpp @@ -18,6 +18,7 @@ #include +#include #include #include @@ -27,7 +28,9 @@ #include #include +#if CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L #include +#endif namespace chip { namespace Logging { @@ -37,8 +40,26 @@ static char formattedMsg[CHIP_CONFIG_LOG_MESSAGE_MAX_SIZE]; void LogV(const char * module, uint8_t category, const char * msg, va_list v) { #ifndef PW_RPC_ENABLED + int lmsg = 0; + vsnprintf(formattedMsg, sizeof(formattedMsg), msg, v); + lmsg = strlen(formattedMsg); + if (lmsg) + { + /** remove duplicate \r\n */ + if (lmsg >= 2 && formattedMsg[lmsg - 2] == '\r' && formattedMsg[lmsg - 1] == '\n') + { + lmsg -= 2; + } + else if (lmsg >= 1 && formattedMsg[lmsg - 1] == '\n') + { + lmsg -= 1; + } + + formattedMsg[lmsg] = '\0'; + } + switch (category) { case kLogCategory_Error: @@ -82,3 +103,28 @@ void LogV(const char * module, uint8_t category, const char * msg, va_list v) } // namespace Platform } // namespace Logging } // namespace chip + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD +extern "C" void otPlatLog(int aLogLevel, int aLogRegion, const char * aFormat, ...) +{ + va_list v; + uint8_t category = chip::Logging::kLogCategory_Error; + + (void) aLogRegion; + + if (aLogLevel == 1 && aLogLevel == 2) + { + category = chip::Logging::kLogCategory_Error; + } + else + { + category = chip::Logging::kLogCategory_Progress; + } + + va_start(v, aFormat); + + chip::Logging::Platform::LogV("OTBR", category, aFormat, v); + + va_end(v); +} +#endif diff --git a/src/platform/bouffalolab/common/OTAImageProcessorImpl.cpp b/src/platform/bouffalolab/common/OTAImageProcessorImpl.cpp index 6e38bf0b5a77cd..0f70a2a33edc1e 100644 --- a/src/platform/bouffalolab/common/OTAImageProcessorImpl.cpp +++ b/src/platform/bouffalolab/common/OTAImageProcessorImpl.cpp @@ -18,12 +18,17 @@ #include #include -#include "OTAImageProcessorImpl.h" +#if CHIP_DEVICE_LAYER_TARGET_BL602 || CHIP_DEVICE_LAYER_TARGET_BL702 || CHIP_DEVICE_LAYER_TARGET_BL702L extern "C" { #include #include +#endif + +extern void hal_reboot(void); } +#include "OTAImageProcessorImpl.h" + using namespace chip::System; namespace chip { @@ -198,7 +203,6 @@ void OTAImageProcessorImpl::HandleProcessBlock(intptr_t context) ByteSpan block = imageProcessor->mBlock; if (imageProcessor->mHeaderParser.IsInitialized()) { - error = imageProcessor->mHeaderParser.AccumulateAndDecode(block, header); if (CHIP_ERROR_BUFFER_TOO_SMALL == error) { diff --git a/src/platform/bouffalolab/common/PlatformManagerImpl.cpp b/src/platform/bouffalolab/common/PlatformManagerImpl.cpp index f31ae77999db64..a346a1bbd7e1b8 100644 --- a/src/platform/bouffalolab/common/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/common/PlatformManagerImpl.cpp @@ -50,5 +50,21 @@ void PlatformManagerImpl::_Shutdown() Internal::GenericPlatformManagerImpl_FreeRTOS::_Shutdown(); } + +CHIP_ERROR PlatformManagerImpl::_PostEvent(const ChipDeviceEvent * event) +{ + if (mChipEventQueue == NULL) + { + return CHIP_ERROR_INTERNAL; + } + BaseType_t status = xQueueSend(mChipEventQueue, event, 0); + if (status != pdTRUE) + { + ChipLogError(DeviceLayer, "Failed to post event to CHIP Platform event queue"); + return CHIP_ERROR(chip::ChipError::Range::kOS, status); + } + + return CHIP_NO_ERROR; +} } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/bouffalolab/common/PlatformManagerImpl.h b/src/platform/bouffalolab/common/PlatformManagerImpl.h index 6acc7bf07c3c0c..59cc45848e2323 100644 --- a/src/platform/bouffalolab/common/PlatformManagerImpl.h +++ b/src/platform/bouffalolab/common/PlatformManagerImpl.h @@ -18,10 +18,11 @@ #pragma once -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI +#include + +#if CHIP_DEVICE_LAYER_TARGET_BL602 #include #endif -#include namespace chip { namespace DeviceLayer { @@ -58,10 +59,11 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener friend PlatformManager & PlatformMgr(void); friend PlatformManagerImpl & PlatformMgrImpl(void); friend class Internal::BLEManagerImpl; -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI +#if CHIP_DEVICE_LAYER_TARGET_BL602 && CHIP_DEVICE_CONFIG_ENABLE_WIFI friend void OnWiFiPlatformEvent(input_event_t * event, void * private_data); #endif + CHIP_ERROR _PostEvent(const ChipDeviceEvent * event); System::Clock::Timestamp mStartTime = System::Clock::kZero; static PlatformManagerImpl sInstance; @@ -86,7 +88,7 @@ inline PlatformManager & PlatformMgr(void) * Returns the platform-specific implementation of the PlatformManager singleton object. * * Chip applications can use this to gain access to features of the PlatformManager - * that are specific to the ESP32 platform. + * that are specific to the Bouffalo Lab platform. */ inline PlatformManagerImpl & PlatformMgrImpl(void) { diff --git a/src/platform/bouffalolab/common/SystemPlatformConfig.h b/src/platform/bouffalolab/common/SystemPlatformConfig.h index 4912f404626de3..80f21edc1fccfd 100644 --- a/src/platform/bouffalolab/common/SystemPlatformConfig.h +++ b/src/platform/bouffalolab/common/SystemPlatformConfig.h @@ -29,3 +29,6 @@ struct ChipDeviceEvent; #define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_EVENT_FUNCTIONS 1 #define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 #define CHIP_SYSTEM_CONFIG_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent * + +//#define CHIP_CONFIG_SHA256_CONTEXT_SIZE sizeof(bl_sha_ctx_t) +#define CHIP_CONFIG_SHA256_CONTEXT_SIZE ((1 + 5 + 18 + 16 + 16) * sizeof(unsigned int)) diff --git a/src/platform/bouffalolab/common/args.gni b/src/platform/bouffalolab/common/args.gni index e15c3f95daf34a..48159fd3b6b4b9 100644 --- a/src/platform/bouffalolab/common/args.gni +++ b/src/platform/bouffalolab/common/args.gni @@ -15,4 +15,6 @@ declare_args() { chip_enable_factory_data = false chip_enable_factory_data_test = false + + chip_enable_ethernet = false } diff --git a/src/platform/device.gni b/src/platform/device.gni index bf243f26524839..8bfaee12b86a01 100644 --- a/src/platform/device.gni +++ b/src/platform/device.gni @@ -86,10 +86,9 @@ declare_args() { if (chip_device_platform == "linux" || chip_device_platform == "esp32" || chip_device_platform == "mbed" || chip_device_platform == "psoc6" || chip_device_platform == "ameba" || chip_device_platform == "webos" || - chip_device_platform == "cc32xx" || chip_device_platform == "bl602" || - chip_device_platform == "mw320" || chip_device_platform == "beken" || - chip_device_platform == "mt793x" || chip_device_platform == "asr" || - chip_device_platform == "openiotsdk") { + chip_device_platform == "cc32xx" || chip_device_platform == "mw320" || + chip_device_platform == "beken" || chip_device_platform == "mt793x" || + chip_device_platform == "asr" || chip_device_platform == "openiotsdk") { chip_mdns = "minimal" } else if (chip_device_platform == "darwin" || chip_device_platform == "cc13x2_26x2" || @@ -116,14 +115,6 @@ declare_args() { chip_subscription_timeout_resumption = chip_persist_subscriptions } -if (chip_device_platform == "bl702" || chip_device_platform == "bl702l") { - if (chip_enable_openthread) { - chip_mdns = "platform" - } else { - chip_mdns = "minimal" - } -} - _chip_device_layer = "none" if (chip_device_platform == "cc13x2_26x2") { _chip_device_layer = "cc13xx_26xx/cc13x2_26x2" diff --git a/third_party/bouffalolab/bl602/bl_iot_sdk.gni b/third_party/bouffalolab/bl602/bl_iot_sdk.gni index be738a1820b508..3d649794d168a6 100644 --- a/third_party/bouffalolab/bl602/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl602/bl_iot_sdk.gni @@ -19,6 +19,9 @@ import("${chip_root}/src/lib/lib.gni") declare_args() { bl_iot_sdk_root = "${chip_root}/third_party/bouffalolab/repo" + + enable_debug_frame_ptr = false + debug_output_file = "" } assert(bl_iot_sdk_root != "", "bl_iot_sdk_root must be specified") @@ -39,12 +42,6 @@ template("bl_iot_sdk") { "BL602_USE_HAL_DRIVER=1", "CFG_CHIP_BL602", - - "MBEDTLS_CONFIG_FILE=\"bl602-chip-mbedtls-config.h\"", - - #dump backtrace - "CONF_ENABLE_FRAME_PTR=1", - "CONF_ENABLE_FUNC_BACKTRACE_ELF=out/bl602-light/chip-bl602-lighting-example.out", ] include_dirs = [] @@ -64,6 +61,11 @@ template("bl_iot_sdk") { "-include", rebase_path("${invoker.freertos_config}", root_build_dir), ] + + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + cflags = [ "-fno-omit-frame-pointer" ] + } } source_set("${sdk_target_name}_soc") { @@ -152,6 +154,15 @@ template("bl_iot_sdk") { source_set("${sdk_target_name}_bl602_freertos") { defines = [ "portasmHANDLE_INTERRUPT=interrupt_entry" ] + + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + defines += [ + "CONF_ENABLE_FRAME_PTR=1", + "CONF_ENABLE_FUNC_BACKTRACE_ELF=${invoker.debug_output_file}", + ] + } + include_dirs = [ "${bl_iot_sdk_root}/components/platform/soc/bl602/freertos_riscv_ram/portable/GCC/RISC-V/chip_specific_extensions/RV32F_float_abi_single" ] sources = [ @@ -522,7 +533,7 @@ template("bl_iot_sdk") { ] } - config("${sdk_target_name}_ble_config") { + config("${sdk_target_name}_config_ble") { include_dirs = [ "${bl_iot_sdk_root}/components/network/ble/blecontroller/ble_inc", "${bl_iot_sdk_root}/components/network/ble/blestack/src/include", @@ -613,7 +624,7 @@ template("bl_iot_sdk") { public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_hosal", - ":${sdk_target_name}_ble_config", + ":${sdk_target_name}_config_ble", ] cflags_c = [ @@ -849,9 +860,9 @@ template("bl_iot_sdk") { "MEMP_NUM_MLD6_GROUP=10", "PBUF_POOL_SIZE=20", "PBUF_POOL_BUFSIZE=1600", - "CONFIG_ENABLE_IPV6_ADDR_CALLBACK", - "CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT", - "CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT", + "MEMP_NUM_UDP_PCB=8", + "LWIP_NETIF_EXT_STATUS_CALLBACK", + "LWIP_HOOK_FILENAME=\"bl_route_hook.h\"", ] } diff --git a/third_party/bouffalolab/bl702/bl_iot_sdk.gni b/third_party/bouffalolab/bl702/bl_iot_sdk.gni index d6b5ac30fff066..832e2261f628ef 100644 --- a/third_party/bouffalolab/bl702/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702/bl_iot_sdk.gni @@ -20,6 +20,9 @@ import("${chip_root}/src/lib/lib.gni") declare_args() { bl_iot_sdk_root = "${chip_root}/third_party/bouffalolab/repo" + + enable_debug_frame_ptr = true + debug_output_file = "" } assert(bl_iot_sdk_root != "", "bl_iot_sdk_root must be specified") @@ -58,6 +61,11 @@ template("bl_iot_sdk") { "-include", rebase_path("${invoker.freertos_config}", root_build_dir), ] + + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + cflags = [ "-fno-omit-frame-pointer" ] + } } config("${sdk_target_name}_config_soc") { @@ -161,6 +169,14 @@ template("bl_iot_sdk") { source_set("${sdk_target_name}_bl702_freertos") { defines = [ "portasmHANDLE_INTERRUPT=interrupt_entry" ] + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + defines += [ + "CONF_ENABLE_FRAME_PTR=1", + "CONF_ENABLE_FUNC_BACKTRACE_ELF=${invoker.debug_output_file}", + ] + } + include_dirs = [ "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/GCC/RISC-V/chip_specific_extensions/RV32F_float_abi_single" ] sources = [ @@ -184,6 +200,14 @@ template("bl_iot_sdk") { "-Wno-old-style-declaration", ] + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + cflags_c += [ + "-Wno-incompatible-pointer-types", + "-Wno-int-conversion", + ] + } + public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_freertos", @@ -519,6 +543,7 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ctr_drbg.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecdh.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecdsa.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecjpake.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecp.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ecp_curves.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/entropy.c", @@ -535,6 +560,12 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/platform_util.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/sha256.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/sha512.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_ciphersuites.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_cli.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_cookie.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_msg.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_srv.c", + "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/ssl_tls.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/x509.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/x509_create.c", "${bl_iot_sdk_root}/components/security/mbedtls_lts/mbedtls/library/x509_crt.c", @@ -556,7 +587,7 @@ template("bl_iot_sdk") { ] } - config("${sdk_target_name}_ble_config") { + config("${sdk_target_name}_config_ble") { include_dirs = [ "${bl_iot_sdk_root}/components/network/ble/blecontroller/ble_inc", "${bl_iot_sdk_root}/components/network/ble/blestack/src/include", @@ -646,7 +677,7 @@ template("bl_iot_sdk") { ] public_configs = [ ":${sdk_target_name}_config", - ":${sdk_target_name}_ble_config", + ":${sdk_target_name}_config_ble", ] cflags_c = [ @@ -670,9 +701,6 @@ template("bl_iot_sdk") { "${chip_root}/third_party/openthread/repo/src/core", "${chip_root}/third_party/openthread/repo/examples/platforms", "${bl_iot_sdk_root}/components/network/thread/openthread_port/include", - ] - - include_dirs += [ "${bl_iot_sdk_root}/components/network/thread/openthread_utils/include", ] } @@ -692,7 +720,6 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_diag.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_entropy.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_linkmetric.c", - "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_logging.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_misc.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_radio.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_settings.c", @@ -802,7 +829,6 @@ template("bl_iot_sdk") { ] include_dirs += [ - "${bl_iot_sdk_root}/components/network/lwip/lwip-port/config", "${bl_iot_sdk_root}/components/network/lwip/src/include", "${bl_iot_sdk_root}/components/network/lwip/src/include/lwip/apps", "${bl_iot_sdk_root}/components/network/lwip/lwip-port", @@ -818,8 +844,9 @@ template("bl_iot_sdk") { "LWIP_IPV6_SCOPES=0", "PBUF_POOL_SIZE=20", "PBUF_POOL_BUFSIZE=1600", - "CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT", - "CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT", + "MEMP_NUM_UDP_PCB=8", + "LWIP_NETIF_EXT_STATUS_CALLBACK", + "LWIP_HOOK_FILENAME=\"bl_route_hook.h\"", ] } @@ -911,7 +938,6 @@ template("bl_iot_sdk") { ":${sdk_target_name}_BSP_Driver", ":${sdk_target_name}_bl702_freertos", ":${sdk_target_name}_ble", - ":${sdk_target_name}_ethernet", ":${sdk_target_name}_fs", ":${sdk_target_name}_hosal", ":${sdk_target_name}_libc", @@ -933,10 +959,6 @@ template("bl_iot_sdk") { public_deps += [ ":${sdk_target_name}_lwip" ] } - if (defined(invoker.enable_zigbee) && invoker.enable_zigbee) { - public_deps += [ ":${sdk_target_name}_zigbee" ] - } - if (defined(invoker.enable_cdc_module) && invoker.enable_cdc_module) { public_deps += [ ":${sdk_target_name}_bl702_usb_cdc" ] } diff --git a/third_party/bouffalolab/bl702l/bl_iot_sdk.gni b/third_party/bouffalolab/bl702l/bl_iot_sdk.gni index 89d35bc98bb1a5..391997f3a10ac3 100644 --- a/third_party/bouffalolab/bl702l/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702l/bl_iot_sdk.gni @@ -22,6 +22,9 @@ import("${mbedtls_root}/mbedtls.gni") declare_args() { bl_iot_sdk_root = "${chip_root}/third_party/bouffalolab/repo" + + enable_debug_frame_ptr = true + debug_output_file = "" } assert(bl_iot_sdk_root != "", "bl_iot_sdk_root must be specified") @@ -60,6 +63,11 @@ template("bl_iot_sdk") { "-include", rebase_path("${invoker.freertos_config}", root_build_dir), ] + + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + cflags = [ "-fno-omit-frame-pointer" ] + } } config("${sdk_target_name}_config_soc") { @@ -137,6 +145,11 @@ template("bl_iot_sdk") { source_set("${sdk_target_name}_bl702l_rom_a0") { defines = [ "portasmHANDLE_INTERRUPT=interrupt_entry" ] + if (defined(invoker.enable_debug_frame_ptr) && + invoker.enable_debug_frame_ptr) { + defines += [ "CONF_ENABLE_FRAME_PTR=1" ] + } + include_dirs = [ "${bl_iot_sdk_root}/components/platform/soc/bl702l/bl702l_std/BSP_Driver/regs" ] libs = [ "${bl_iot_sdk_root}/components/platform/soc/bl702l/bl702l_rom_a0/bl702l_rom_ext/lib/libbl702l_rom_ext.a" ] @@ -407,7 +420,7 @@ template("bl_iot_sdk") { ] } - config("${sdk_target_name}_ble_config") { + config("${sdk_target_name}_config_ble") { include_dirs = [ "${bl_iot_sdk_root}/components/network/ble/btblecontroller/btble_inc", "${bl_iot_sdk_root}/components/network/ble/blestack/src/include", @@ -518,7 +531,7 @@ template("bl_iot_sdk") { ] public_configs = [ ":${sdk_target_name}_config", - ":${sdk_target_name}_ble_config", + ":${sdk_target_name}_config_ble", ] cflags_c = [ @@ -564,7 +577,6 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_diag.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_entropy.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_linkmetric.c", - "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_logging.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_misc.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_radio.c", "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_settings.c", diff --git a/third_party/bouffalolab/common/bouffalolab_executable.gni b/third_party/bouffalolab/common/bouffalolab_executable.gni index 6e0684ea757d18..7410067891fcb4 100644 --- a/third_party/bouffalolab/common/bouffalolab_executable.gni +++ b/third_party/bouffalolab/common/bouffalolab_executable.gni @@ -39,12 +39,12 @@ template("bouffalolab_executable") { flashing_script_inputs = [ "${chip_root}/scripts/flashing/bouffalolab_firmware_utils.py", "${chip_root}/scripts/flashing/firmware_utils.py", - - "${chip_root}/examples/platform/bouffalolab/${invoker.bl_plat_name}/flash_config/partition_cfg_2M.toml", ] if (invoker.bl_plat_name == "bl602") { flashing_script_inputs += [ "${chip_root}/examples/platform/bouffalolab/${invoker.bl_plat_name}/flash_config/partition_cfg_4M.toml" ] + } else { + flashing_script_inputs += [ "${chip_root}/examples/platform/bouffalolab/${invoker.bl_plat_name}/flash_config/partition_cfg_2M.toml" ] } copy(flashing_runtime_target) { @@ -68,13 +68,17 @@ template("bouffalolab_executable") { } flashing_options += [ "--pt" ] - if (invoker.board == "BL602-IOT-DVK-3S" || invoker.bl_plat_name == "bl702" || - invoker.bl_plat_name == "bl702l") { + if (invoker.bl_plat_name == "bl602") { flashing_options += - [ rebase_path("partition_cfg_2M.toml", root_out_dir, root_out_dir) ] + [ rebase_path("partition_cfg_4M.toml", root_out_dir, root_out_dir) ] + } else if (defined(invoker.enable_openthread_border_router) && + invoker.enable_openthread_border_router) { + flashing_options += [ rebase_path("partition_cfg_2M_noOTA.toml", + root_out_dir, + root_out_dir) ] } else { flashing_options += - [ rebase_path("partition_cfg_4M.toml", root_out_dir, root_out_dir) ] + [ rebase_path("partition_cfg_2M.toml", root_out_dir, root_out_dir) ] } flashing_options += [ "--ota" ] diff --git a/third_party/bouffalolab/common/rsicv.gni b/third_party/bouffalolab/common/rsicv.gni index dc75aaa22232d6..7d056d5a311088 100644 --- a/third_party/bouffalolab/common/rsicv.gni +++ b/third_party/bouffalolab/common/rsicv.gni @@ -12,6 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build_overrides/chip.gni") + +import("${chip_root}/src/platform/device.gni") + riscv_arch = "rv32imfc" riscv_abi = "ilp32f" # riscv_cpu = "" From 20b058781e1a60f270e729b2270ff898904fc8fa Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 14 Sep 2023 16:18:00 +0200 Subject: [PATCH 100/134] [CI] Update scripts/tests/run_test_suite.py so it can run darwinframeworktool.py (#29130) * [MatterYamlTests] Allow chiptool.py to specify the specifications dirs * [darwin-framework-tool] Expose --storage-directory argument * [CI] Update scripts/tests/run_test_suite.py so it can run darwinframeworktool.py --- .../commands/common/CHIPCommandBridge.h | 2 ++ .../commands/interactive/InteractiveCommands.mm | 2 +- scripts/tests/run_test_suite.py | 7 +++++-- scripts/tests/yaml/chiptool.py | 7 +++++-- scripts/tests/yaml/darwinframeworktool.py | 7 +++++-- scripts/tests/yaml/tests_tool.py | 5 +++-- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h index 3a3a6d8d64efdd..0f5015e4711c71 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h @@ -45,6 +45,8 @@ class CHIPCommandBridge : public Command { AddArgument("paa-trust-store-path", &mPaaTrustStorePath, "Path to directory holding PAA certificate information. Can be absolute or relative to the current working " "directory."); + AddArgument( + "storage-directory", &mStorageDirectory, "This option does nothing. It is here for API compatibility with chip-tool."); AddArgument("commissioner-vendor-id", 0, UINT16_MAX, &mCommissionerVendorId, "The vendor id to use for darwin-framework-tool. If not provided, chip::VendorId::TestVendor1 (65521, 0xFFF1) will be " "used."); diff --git a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm index ab55be5a245cfe..6fe3522dcd909b 100644 --- a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm +++ b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm @@ -380,7 +380,7 @@ el_status_t StopFunction() ClearLine(); - *status = mHandler->RunInteractive(command); + *status = mHandler->RunInteractive(command, GetStorageDirectory()); return YES; } diff --git a/scripts/tests/run_test_suite.py b/scripts/tests/run_test_suite.py index 17124a6d9b24c1..6894693a0fa500 100755 --- a/scripts/tests/run_test_suite.py +++ b/scripts/tests/run_test_suite.py @@ -160,7 +160,7 @@ def main(context, dry_run, log_level, target, target_glob, target_skip_glob, # Figures out selected test that match the given name(s) if runtime == TestRunTime.CHIP_REPL_PYTHON: all_tests = [test for test in chiptest.AllReplYamlTests()] - elif runtime == TestRunTime.CHIP_TOOL_PYTHON: + elif runtime == TestRunTime.CHIP_TOOL_PYTHON and os.path.basename(chip_tool) != "darwin-framework-tool": all_tests = [test for test in chiptest.AllChipToolYamlTests()] else: all_tests = [test for test in chiptest.AllChipToolTests(chip_tool)] @@ -313,7 +313,10 @@ def cmd_run(context, iterations, all_clusters_app, lock_app, ota_provider_app, o chip_repl_yaml_tester = paths_finder.get('yamltest_with_chip_repl_tester.py') if chip_tool_with_python is None: - chip_tool_with_python = paths_finder.get('chiptool.py') + if context.obj.chip_tool and os.path.basename(context.obj.chip_tool) == "darwin-framework-tool": + chip_tool_with_python = paths_finder.get('darwinframeworktool.py') + else: + chip_tool_with_python = paths_finder.get('chiptool.py') # Command execution requires an array paths = chiptest.ApplicationPaths( diff --git a/scripts/tests/yaml/chiptool.py b/scripts/tests/yaml/chiptool.py index 60fc542d572311..f3a08aa8156d1a 100755 --- a/scripts/tests/yaml/chiptool.py +++ b/scripts/tests/yaml/chiptool.py @@ -26,6 +26,7 @@ _DEFAULT_EXTENSIONS_DIR = 'scripts/tests/yaml/extensions' _DEFAULT_PICS_FILE = 'src/app/tests/suites/certification/ci-pics-values' +_DEFAULT_SPECIFICATIONS_DIR = 'src/app/zap-templates/zcl/data-model/chip/*.xml' def chiptool_runner_options(f): @@ -45,6 +46,8 @@ def chiptool_runner_options(f): help='Add a delay between each test suite steps.')(f) f = click.option('--continueOnFailure', type=bool, default=False, show_default=True, help='Do not stop running the test suite on first error.')(f) + f = click.option('--specifications_paths', type=click.Path(), show_default=True, default=_DEFAULT_SPECIFICATIONS_DIR, + help='Path to a set of files containing clusters definitions.')(f) f = click.option('--PICS', type=click.Path(exists=True), show_default=True, default=_DEFAULT_PICS_FILE, help='Path to the PICS file to use.')(f) f = click.option('--additional_pseudo_clusters_directory', type=click.Path(), show_default=True, default=_DEFAULT_EXTENSIONS_DIR, @@ -80,14 +83,14 @@ def maybe_update_stop_on_error(ctx): @click.argument('commands', nargs=-1) @chiptool_runner_options @click.pass_context -def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, trace_file: str, trace_decode: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str): +def chiptool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, trace_file: str, trace_decode: bool, delay_in_ms: int, continueonfailure: bool, specifications_paths: str, pics: str, additional_pseudo_clusters_directory: str): success = False server_arguments = maybe_update_server_arguments(ctx) maybe_update_stop_on_error(ctx) if len(commands) > 1 and commands[0] == 'tests': - success = send_yaml_command(chiptool, commands[1], server_path, server_arguments, show_adapter_logs, pics, + success = send_yaml_command(chiptool, commands[1], server_path, server_arguments, show_adapter_logs, specifications_paths, pics, additional_pseudo_clusters_directory, commands[2:]) else: if server_path is None and server_name: diff --git a/scripts/tests/yaml/darwinframeworktool.py b/scripts/tests/yaml/darwinframeworktool.py index 77ab3d8b813716..64648e57d371f4 100755 --- a/scripts/tests/yaml/darwinframeworktool.py +++ b/scripts/tests/yaml/darwinframeworktool.py @@ -26,6 +26,7 @@ _DEFAULT_EXTENSIONS_DIR = 'scripts/tests/yaml/extensions' _DEFAULT_PICS_FILE = 'src/app/tests/suites/certification/ci-pics-values' +_DEFAULT_SPECIFICATIONS_DIR = 'src/app/zap-templates/zcl/data-model/chip/*.xml' def darwinframeworktool_runner_options(f): @@ -41,6 +42,8 @@ def darwinframeworktool_runner_options(f): help='Add a delay between each test suite steps.')(f) f = click.option('--continueOnFailure', type=bool, default=False, show_default=True, help='Do not stop running the test suite on first error.')(f) + f = click.option('--specifications_paths', type=click.Path(), show_default=True, default=_DEFAULT_SPECIFICATIONS_DIR, + help='Path to a set of files containing clusters definitions.')(f) f = click.option('--PICS', type=click.Path(exists=True), show_default=True, default=_DEFAULT_PICS_FILE, help='Path to the PICS file to use.')(f) f = click.option('--additional_pseudo_clusters_directory', type=click.Path(), show_default=True, default=_DEFAULT_EXTENSIONS_DIR, @@ -63,14 +66,14 @@ def maybe_update_stop_on_error(ctx): @click.argument('commands', nargs=-1) @darwinframeworktool_runner_options @click.pass_context -def darwinframeworktool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, delay_in_ms: int, continueonfailure: bool, pics: str, additional_pseudo_clusters_directory: str): +def darwinframeworktool_py(ctx, commands: List[str], server_path: str, server_name: str, server_arguments: str, show_adapter_logs: bool, delay_in_ms: int, continueonfailure: bool, specifications_paths: str, pics: str, additional_pseudo_clusters_directory: str): success = False server_arguments = ctx.params['server_arguments'] maybe_update_stop_on_error(ctx) if len(commands) > 1 and commands[0] == 'tests': - success = send_yaml_command(darwinframeworktool, commands[1], server_path, server_arguments, show_adapter_logs, pics, + success = send_yaml_command(darwinframeworktool, commands[1], server_path, server_arguments, show_adapter_logs, specifications_paths, pics, additional_pseudo_clusters_directory, commands[2:]) else: if server_path is None and server_name: diff --git a/scripts/tests/yaml/tests_tool.py b/scripts/tests/yaml/tests_tool.py index 65883a4bf8def5..a4baaf228b0604 100644 --- a/scripts/tests/yaml/tests_tool.py +++ b/scripts/tests/yaml/tests_tool.py @@ -26,8 +26,8 @@ @click.pass_context -def send_yaml_command(ctx, test_tool, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]): - kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'pics': pics, +def send_yaml_command(ctx, test_tool, test_name: str, server_path: str, server_arguments: str, show_adapter_logs: bool, specifications_paths: str, pics: str, additional_pseudo_clusters_directory: str, commands: List[str]): + kwargs = {'test_name': test_name, 'show_adapter_logs': show_adapter_logs, 'specifications_paths': specifications_paths, 'pics': pics, 'additional_pseudo_clusters_directory': additional_pseudo_clusters_directory} index = 0 @@ -37,6 +37,7 @@ def send_yaml_command(ctx, test_tool, test_name: str, server_path: str, server_a ctx.invoke(runner_base, **kwargs) del ctx.params['commands'] + del ctx.params['specifications_paths'] del ctx.params['pics'] del ctx.params['additional_pseudo_clusters_directory'] From 53885df82dfa4a2a14b0e9717b836318ec6c1d69 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 10:19:07 -0400 Subject: [PATCH 101/134] Remove CHIP_SYSTEM_CONFIG_USE_TIMER_POOL bits. (#29222) This is not a config macro we have anymore, and the code it guards does not compile, since System::Timer has no GetStatistics method. --- src/system/SystemStats.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/system/SystemStats.cpp b/src/system/SystemStats.cpp index 18b99c386bc5ad..c5be271ea16666 100644 --- a/src/system/SystemStats.cpp +++ b/src/system/SystemStats.cpp @@ -79,11 +79,6 @@ void UpdateSnapshot(Snapshot & aSnapshot) memcpy(&aSnapshot.mResourcesInUse, &sResourcesInUse, sizeof(aSnapshot.mResourcesInUse)); memcpy(&aSnapshot.mHighWatermarks, &sHighWatermarks, sizeof(aSnapshot.mHighWatermarks)); -#if CHIP_SYSTEM_CONFIG_USE_TIMER_POOL - chip::System::Timer::GetStatistics(aSnapshot.mResourcesInUse[kSystemLayer_NumTimers], - aSnapshot.mHighWatermarks[kSystemLayer_NumTimers]); -#endif // CHIP_SYSTEM_CONFIG_USE_TIMER_POOL - SYSTEM_STATS_UPDATE_LWIP_PBUF_COUNTS(); } From 3659bc64c930ea126b9eeb60dafd58335399f51a Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 10:20:05 -0400 Subject: [PATCH 102/134] Fix CHIPConfig.h not including InetConfig.h. (#29223) * Fix CHIPConfig.h not including InetConfig.h. We had various things that were testing config bits that InetConfig.h would pull in that never actually included InetConfig.h, because CHIPConfig.h did not include it. * Stop including inet things from CHIPCore.h. --- src/lib/core/BUILD.gn | 1 + src/lib/core/CHIPConfig.h | 4 ++-- src/lib/core/CHIPCore.h | 8 -------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/lib/core/BUILD.gn b/src/lib/core/BUILD.gn index 5a08f7d1935a23..60f56af7e5850b 100644 --- a/src/lib/core/BUILD.gn +++ b/src/lib/core/BUILD.gn @@ -75,6 +75,7 @@ source_set("chip_config_header") { public_deps = [ ":chip_buildconfig", "${chip_root}/src/ble:ble_config_header", + "${chip_root}/src/inet:inet_config_header", "${chip_root}/src/system:system_config_header", ] diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index 14453c98a02d73..59a6e8252356bf 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -42,8 +42,8 @@ #include #include -/* COMING SOON: making the INET Layer optional entails making this inclusion optional. */ -// #include "InetConfig.h" +#include + /* #if INET_CONFIG_ENABLE_TCP_ENDPOINT && INET_TCP_IDLE_CHECK_INTERVAL <= 0 #error "chip SDK requires INET_TCP_IDLE_CHECK_INTERVAL > 0" diff --git a/src/lib/core/CHIPCore.h b/src/lib/core/CHIPCore.h index 332978d881b2ca..bac6e473f39d43 100644 --- a/src/lib/core/CHIPCore.h +++ b/src/lib/core/CHIPCore.h @@ -31,14 +31,6 @@ #include -#if INET_CONFIG_ENABLE_TCP_ENDPOINT -#include -#endif // INET_CONFIG_ENABLE_TCP_ENDPOINT - -#if INET_CONFIG_ENABLE_UDP_ENDPOINT -#include -#endif // INET_CONFIG_ENABLE_UDP_ENDPOINT - #if CONFIG_NETWORK_LAYER_BLE #include #endif // CONFIG_NETWORK_LAYER_BLE From 1366fee13231e3fe9c85a6d23a700a9c2ccf919e Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 10:21:56 -0400 Subject: [PATCH 103/134] Remove remaining stray CHIP_CRYPTO_HSM checks. (#29212) These were apparently missed in https://github.com/project-chip/connectedhomeip/pull/27130. --- examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp | 3 --- examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp | 3 --- examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp | 3 --- src/credentials/CHIPCert.cpp | 3 --- src/credentials/FabricTable.h | 5 +---- .../nxp/crypto/se05x/CHIPCryptoPALHsm_se05x_spake2p.cpp | 2 +- 6 files changed, 2 insertions(+), 17 deletions(-) diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp index fbd0a6877e3a45..24d3f4cf4af629 100644 --- a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -51,9 +51,6 @@ #include "PWR_Interface.h" #include "app_config.h" -#if CHIP_CRYPTO_HSM -#include -#endif #ifdef ENABLE_HSM_DEVICE_ATTESTATION #include "DeviceAttestationSe05xCredsExample.h" #endif diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp index 5f67ac9f58b91c..cb6a5d53f3a2bd 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -52,9 +52,6 @@ #include "LEDWidget.h" #include "app_config.h" -#if CHIP_CRYPTO_HSM -#include -#endif #ifdef ENABLE_HSM_DEVICE_ATTESTATION #include "DeviceAttestationSe05xCredsExample.h" #endif diff --git a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp index 9e6afc3e77b6f1..e8513334fb96d7 100644 --- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp +++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp @@ -41,9 +41,6 @@ #include "PWR_Interface.h" #include "app_config.h" -#if CHIP_CRYPTO_HSM -#include -#endif #ifdef ENABLE_HSM_DEVICE_ATTESTATION #include "DeviceAttestationSe05xCredsExample.h" #endif diff --git a/src/credentials/CHIPCert.cpp b/src/credentials/CHIPCert.cpp index 1c0e9d7b281f0b..927030b11ff929 100644 --- a/src/credentials/CHIPCert.cpp +++ b/src/credentials/CHIPCert.cpp @@ -45,9 +45,6 @@ #include #include #include -#if CHIP_CRYPTO_HSM -#include -#endif namespace chip { namespace Credentials { diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h index 621ec354e50084..608cc60edad079 100644 --- a/src/credentials/FabricTable.h +++ b/src/credentials/FabricTable.h @@ -31,11 +31,8 @@ #include #include #include -#include -#if CHIP_CRYPTO_HSM -#include -#endif #include +#include #include #include #include diff --git a/src/platform/nxp/crypto/se05x/CHIPCryptoPALHsm_se05x_spake2p.cpp b/src/platform/nxp/crypto/se05x/CHIPCryptoPALHsm_se05x_spake2p.cpp index a60209f065aade..f1b13a54458cd6 100644 --- a/src/platform/nxp/crypto/se05x/CHIPCryptoPALHsm_se05x_spake2p.cpp +++ b/src/platform/nxp/crypto/se05x/CHIPCryptoPALHsm_se05x_spake2p.cpp @@ -351,7 +351,7 @@ CHIP_ERROR Spake2pHSM_P256_SHA256_HKDF_HMAC::ComputeRoundOne(const uint8_t * pab constexpr bool sw_rollback_verifier = false; #endif -#if ((CHIP_CRYPTO_HSM) && (!ENABLE_SE05X_SPAKE_PROVER)) +#if !ENABLE_SE05X_SPAKE_PROVER const bool sw_rollback_prover = (role == chip::Crypto::CHIP_SPAKE2P_ROLE::PROVER); #else constexpr bool sw_rollback_prover = false; From a831ad7dcc1e9d1f0e3f40aa9593531cfed7b5a1 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 14 Sep 2023 16:44:14 +0200 Subject: [PATCH 104/134] [MatterYamlTests] Fix a bunch of typos in the yaml tests (#29256) --- src/app/tests/suites/certification/Test_TC_OPCREDS_3_3.yaml | 2 +- src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml | 2 +- src/app/tests/suites/examples/Test_Example.yaml | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_3.yaml b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_3.yaml index 469f42d27ae55f..f7ca4a135ce56d 100644 --- a/src/app/tests/suites/certification/Test_TC_OPCREDS_3_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPCREDS_3_3.yaml @@ -745,7 +745,7 @@ tests: - label: "Step 10: Verify that the public Key extracted NOCValue of the AddNOC matches the Node Operational Public Key extracted from CSRResponse" - verifiaction: | + verification: | Not verifiable (out of scope) disabled: true diff --git a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml index 5e12a2d56b80a8..cf01ff44d05efe 100644 --- a/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_OPSTATE_2_2.yaml @@ -25,7 +25,7 @@ config: tests: - label: "Note" - verifications: | + verification: | This is a simulated example log for instructional purposes only. In real scenarios, the actual log may vary depending on the feature implementation in Reference App. disabled: true diff --git a/src/app/tests/suites/examples/Test_Example.yaml b/src/app/tests/suites/examples/Test_Example.yaml index 03641c43aa480b..1bc4e7ffa9785c 100644 --- a/src/app/tests/suites/examples/Test_Example.yaml +++ b/src/app/tests/suites/examples/Test_Example.yaml @@ -18,7 +18,6 @@ tests: command: "ExamplesCommand" response: # Validates the response variables of the commands saveAs: nameOfSaveVariable - value: 0 values: - name: "exampleResponseVariable" value: 1 From 4ff1d3b3f6b4ca9455e4fe1ada84945714100907 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 11:05:14 -0400 Subject: [PATCH 105/134] Fix -Wundef issues in src/inet. (#29221) * __MBED__ should be tested for via ifdef. * HAVE_SO_BINDTODEVICE should be an actual config macro. --- src/inet/InetConfig.h | 11 +++++++++++ src/inet/InetInterface.cpp | 4 ++-- src/inet/TCPEndPointImplSockets.cpp | 10 +++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/inet/InetConfig.h b/src/inet/InetConfig.h index 0631a7e14f77da..c3653a4216110f 100644 --- a/src/inet/InetConfig.h +++ b/src/inet/InetConfig.h @@ -272,4 +272,15 @@ #endif #endif // INET_CONFIG_UDP_SOCKET_PKTINFO +/** + * @def HAVE_SO_BINDTODEVICE + * + * @brief + * Should be set to 1 if the SO_BINDTODEVICE option to setsockopt is + * available. + */ +#ifndef HAVE_SO_BINDTODEVICE +#define HAVE_SO_BINDTODEVICE 0 +#endif + // clang-format on diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp index 3bc54093ff7d94..571c028fafa8d2 100644 --- a/src/inet/InetInterface.cpp +++ b/src/inet/InetInterface.cpp @@ -586,7 +586,7 @@ short InterfaceIterator::GetFlags() mIntfFlags = intfData.ifr_flags; mIntfFlagsCached = true; } -#if __MBED__ +#ifdef __MBED__ CloseIOCTLSocket(); #endif } @@ -670,7 +670,7 @@ uint8_t InterfaceAddressIterator::GetPrefixLength() { if (mCurAddr->ifa_addr->sa_family == AF_INET6) { -#if !__MBED__ +#ifndef __MBED__ struct sockaddr_in6 & netmask = *reinterpret_cast(mCurAddr->ifa_netmask); return NetmaskToPrefixLength(netmask.sin6_addr.s6_addr, 16); #else // __MBED__ diff --git a/src/inet/TCPEndPointImplSockets.cpp b/src/inet/TCPEndPointImplSockets.cpp index 384337e3342ab4..fc8c6e2da2a77e 100644 --- a/src/inet/TCPEndPointImplSockets.cpp +++ b/src/inet/TCPEndPointImplSockets.cpp @@ -797,7 +797,7 @@ void TCPEndPointImplSockets::HandlePendingIO(System::SocketEvents events) // The socket being writable indicates the connection has completed (successfully or otherwise). if (events.Has(System::SocketEventFlags::kWrite)) { -#if !__MBED__ +#ifndef __MBED__ // Get the connection result from the socket. int osConRes; socklen_t optLen = sizeof(osConRes); @@ -805,11 +805,11 @@ void TCPEndPointImplSockets::HandlePendingIO(System::SocketEvents events) { osConRes = errno; } -#else - // On Mbed OS, connect blocks and never returns EINPROGRESS - // The socket option SO_ERROR is not available. +#else // __MBED__ + // On Mbed OS, connect blocks and never returns EINPROGRESS + // The socket option SO_ERROR is not available. int osConRes = 0; -#endif +#endif // !__MBED__ CHIP_ERROR conRes = CHIP_ERROR_POSIX(osConRes); // Process the connection result. From 3400d1d6d86bae74f44098858a6cc707ac07332d Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 11:05:25 -0400 Subject: [PATCH 106/134] Fix -Wundef issues in device config. (#29229) The diff is hard to read, but the actual changes are: * Move the "Device DNS-SD Configuration" section to before the "Thread Configuration" section, because "Thread Configuration" uses some of the values DNS-SD configuration defines. * Add explicit defines for CHIP_DEVICE_LAYER_NONE and CHIP_DEVICE_CONFIG_ENABLE_NFC (setting them to 0 if not otherwise defined). --- src/include/platform/CHIPDeviceConfig.h | 411 ++++++++++++------------ 1 file changed, 214 insertions(+), 197 deletions(-) diff --git a/src/include/platform/CHIPDeviceConfig.h b/src/include/platform/CHIPDeviceConfig.h index f9c963da7eddda..fd8937dcc2302c 100644 --- a/src/include/platform/CHIPDeviceConfig.h +++ b/src/include/platform/CHIPDeviceConfig.h @@ -630,6 +630,198 @@ #define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT 10000 #endif +// -------------------- Device DNS-SD Configuration -------------------- + +/** + * CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS + * + * Time in seconds that a factory new device will advertise commissionable node discovery. + */ +#ifndef CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS +#define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS (15 * 60) +#endif + +/** + * CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES + * + * Maximum number of CHIP Commissioners or Commissionable Nodes that can be discovered + */ +#ifndef CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES +#define CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES 10 +#endif + +/** + * CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY + * + * Enable or disable whether this device advertises as a commissioner. + * + * Depends upon CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE set to 1 + * + * For Video Players, this value will be 1 + */ +#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0 +#endif + +/** + * CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE + * + * Enable including commissioner code (CHIPDeviceController.cpp) in the commissionee (Server.cpp) code. + * + * For Video Players, this value will be 1 + */ +#ifndef CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE +#define CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE 0 +#endif + +/** + * CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE + * + * See issue 23625. + * + * Needs to be 1 when the following is 1: + * CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE + */ +#ifndef CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE +#define CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE 0 +#endif + +/** + * CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT + * + * Enable or disable whether this device will attempt to + * discover commissioners and send Uder Directed Commissioning + * messages to them. + * + * For Video Player Clients, this value will be 1 + */ +#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT 0 +#endif + +/** + * CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY + * + * Enable or disable whether this device advertises when not in commissioning mode. + * + */ +#ifndef CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY +#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 0 +#endif + +/** + * CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS + * + * Default time in seconds that a device will advertise commissionable node discovery + * after commissioning mode ends. This value can be overridden by the user. + * + * Only valid when CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY==1 + */ +#define CHIP_DEVICE_CONFIG_DISCOVERY_DISABLED 0 +#define CHIP_DEVICE_CONFIG_DISCOVERY_NO_TIMEOUT -1 +#ifndef CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS +#define CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS (15 * 60) +#endif + +/** + * CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE + * + * Enable or disable including device type in commissionable node discovery. + * + * For Video Players, this value will often be 1 + */ +#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 0 +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_TYPE + * + * Type of device using the CHIP Device Type Identifier. + * + * Examples: + * 0xFFFF = 65535 = Invalid Device Type + * 0x0051 = 81 = Smart Plug + * 0x0022 = 34 = Speaker + * 0x0023 = 35 = Video Player + * + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_TYPE +#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 65535 // 65535 = Invalid Device Type +#endif + +/** + * CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME + * + * Enable or disable including device name in commissionable node discovery. + * + * For Video Players, this value will often be 1 + */ +#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 0 +#endif + +/** + * CHIP_DEVICE_CONFIG_DEVICE_NAME + * + * Name of device. + */ +#ifndef CHIP_DEVICE_CONFIG_DEVICE_NAME +#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Test Kitchen" +#endif + +/** + * CHIP_DEVICE_CONFIG_PAIRING_INITIAL_HINT + * + * Pairing Hint, bitmap value of methods to put device into pairing mode + * when it has not yet been commissioned. + * + * Bits: + * 0 - Power Cycle + * 5 - See Device Manual + */ +#ifndef CHIP_DEVICE_CONFIG_PAIRING_INITIAL_HINT +#define CHIP_DEVICE_CONFIG_PAIRING_INITIAL_HINT \ + (1 << CHIP_COMMISSIONING_HINT_INDEX_POWER_CYCLE | 1 << CHIP_COMMISSIONING_HINT_INDEX_SEE_MANUAL) +#endif + +/** + * CHIP_DEVICE_CONFIG_PAIRING_INITIAL_INSTRUCTION + * + * Pairing Instruction, when device has not yet been commissioned + * + * Meaning is depedent upon pairing hint value. + */ +#ifndef CHIP_DEVICE_CONFIG_PAIRING_INITIAL_INSTRUCTION +#define CHIP_DEVICE_CONFIG_PAIRING_INITIAL_INSTRUCTION "" +#endif + +/** + * CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_HINT + * + * Pairing Hint, bitmap value of methods to put device into pairing mode + * when it has already been commissioned. + * + * Bits: + * 2 - Visit Administrator UX (always true for secondary) + * 5 - See Device Manual + */ +#ifndef CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_HINT +#define CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_HINT \ + (1 << CHIP_COMMISSIONING_HINT_INDEX_SEE_ADMINISTRATOR_UX | 1 << CHIP_COMMISSIONING_HINT_INDEX_SEE_MANUAL) +#endif + +/** + * CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_INSTRUCTION + * + * Pairing Instruction, when device has not yet been commissioned + * + * Meaning is depedent upon pairing hint value. + */ +#ifndef CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_INSTRUCTION +#define CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_INSTRUCTION "" +#endif + // -------------------- Thread Configuration -------------------- /** @@ -1149,197 +1341,37 @@ #define CHIP_DEVICE_CONFIG_FIRMWARE_BUILD_TIME __TIME__ #endif -// -------------------- Device DNS-SD Configuration -------------------- - -/** - * CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS - * - * Time in seconds that a factory new device will advertise commissionable node discovery. - */ -#ifndef CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS -#define CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS (15 * 60) -#endif - -/** - * CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES - * - * Maximum number of CHIP Commissioners or Commissionable Nodes that can be discovered - */ -#ifndef CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES -#define CHIP_DEVICE_CONFIG_MAX_DISCOVERED_NODES 10 -#endif - -/** - * CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY - * - * Enable or disable whether this device advertises as a commissioner. - * - * Depends upon CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE set to 1 - * - * For Video Players, this value will be 1 - */ -#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY -#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY 0 -#endif - -/** - * CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE - * - * Enable including commissioner code (CHIPDeviceController.cpp) in the commissionee (Server.cpp) code. - * - * For Video Players, this value will be 1 - */ -#ifndef CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE -#define CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE 0 -#endif - -/** - * CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE - * - * See issue 23625. - * - * Needs to be 1 when the following is 1: - * CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE - */ -#ifndef CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE -#define CHIP_CONFIG_UNSAFE_SUBSCRIPTION_EXCHANGE_MANAGER_USE 0 -#endif - -/** - * CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT - * - * Enable or disable whether this device will attempt to - * discover commissioners and send Uder Directed Commissioning - * messages to them. - * - * For Video Player Clients, this value will be 1 - */ -#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT -#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT 0 -#endif - -/** - * CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY - * - * Enable or disable whether this device advertises when not in commissioning mode. - * - */ -#ifndef CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY -#define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 0 -#endif - -/** - * CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS - * - * Default time in seconds that a device will advertise commissionable node discovery - * after commissioning mode ends. This value can be overridden by the user. - * - * Only valid when CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY==1 - */ -#define CHIP_DEVICE_CONFIG_DISCOVERY_DISABLED 0 -#define CHIP_DEVICE_CONFIG_DISCOVERY_NO_TIMEOUT -1 -#ifndef CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS -#define CHIP_DEVICE_CONFIG_EXTENDED_DISCOVERY_TIMEOUT_SECS (15 * 60) -#endif - -/** - * CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE - * - * Enable or disable including device type in commissionable node discovery. - * - * For Video Players, this value will often be 1 - */ -#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE -#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 0 -#endif - -/** - * CHIP_DEVICE_CONFIG_DEVICE_TYPE - * - * Type of device using the CHIP Device Type Identifier. - * - * Examples: - * 0xFFFF = 65535 = Invalid Device Type - * 0x0051 = 81 = Smart Plug - * 0x0022 = 34 = Speaker - * 0x0023 = 35 = Video Player - * - */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_TYPE -#define CHIP_DEVICE_CONFIG_DEVICE_TYPE 65535 // 65535 = Invalid Device Type -#endif - -/** - * CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME - * - * Enable or disable including device name in commissionable node discovery. - * - * For Video Players, this value will often be 1 - */ -#ifndef CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME -#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_NAME 0 -#endif - -/** - * CHIP_DEVICE_CONFIG_DEVICE_NAME - * - * Name of device. - */ -#ifndef CHIP_DEVICE_CONFIG_DEVICE_NAME -#define CHIP_DEVICE_CONFIG_DEVICE_NAME "Test Kitchen" -#endif +// -------------------- App Platform Configuration -------------------- /** - * CHIP_DEVICE_CONFIG_PAIRING_INITIAL_HINT - * - * Pairing Hint, bitmap value of methods to put device into pairing mode - * when it has not yet been commissioned. + * CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED * - * Bits: - * 0 - Power Cycle - * 5 - See Device Manual + * Does this device support an app platform 1=Yes, 0=No */ -#ifndef CHIP_DEVICE_CONFIG_PAIRING_INITIAL_HINT -#define CHIP_DEVICE_CONFIG_PAIRING_INITIAL_HINT \ - (1 << CHIP_COMMISSIONING_HINT_INDEX_POWER_CYCLE | 1 << CHIP_COMMISSIONING_HINT_INDEX_SEE_MANUAL) +#ifndef CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED +#define CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED 0 #endif /** - * CHIP_DEVICE_CONFIG_PAIRING_INITIAL_INSTRUCTION - * - * Pairing Instruction, when device has not yet been commissioned + * CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT * - * Meaning is depedent upon pairing hint value. + * When app platform is enabled, max number of endpoints */ -#ifndef CHIP_DEVICE_CONFIG_PAIRING_INITIAL_INSTRUCTION -#define CHIP_DEVICE_CONFIG_PAIRING_INITIAL_INSTRUCTION "" +#ifndef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT +#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT 0 #endif /** - * CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_HINT - * - * Pairing Hint, bitmap value of methods to put device into pairing mode - * when it has already been commissioned. + * CHIP_DISPATCH_EVENT_LONG_DISPATCH_TIME_WARNING_THRESHOLD_MS * - * Bits: - * 2 - Visit Administrator UX (always true for secondary) - * 5 - See Device Manual + * Time threshold for events dispatching + * Set 0 to disable event dispatching time measurement */ -#ifndef CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_HINT -#define CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_HINT \ - (1 << CHIP_COMMISSIONING_HINT_INDEX_SEE_ADMINISTRATOR_UX | 1 << CHIP_COMMISSIONING_HINT_INDEX_SEE_MANUAL) +#ifndef CHIP_DISPATCH_EVENT_LONG_DISPATCH_TIME_WARNING_THRESHOLD_MS +#define CHIP_DISPATCH_EVENT_LONG_DISPATCH_TIME_WARNING_THRESHOLD_MS 100 #endif -/** - * CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_INSTRUCTION - * - * Pairing Instruction, when device has not yet been commissioned - * - * Meaning is depedent upon pairing hint value. - */ -#ifndef CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_INSTRUCTION -#define CHIP_DEVICE_CONFIG_PAIRING_SECONDARY_INSTRUCTION "" -#endif +// -------------------- Miscellaneous -------------------- /** * CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES @@ -1373,32 +1405,17 @@ #endif // CHIP_DEVICE_CONFIG_ENABLE_AUTOMATIC_CASE_RETRIES -// -------------------- App Platform Configuration -------------------- - /** - * CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED - * - * Does this device support an app platform 1=Yes, 0=No + * CHIP_DEVICE_LAYER_NONE aims to turn off the device layer, for platforms that + * implement that in some alternate way. */ -#ifndef CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED -#define CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED 0 +#ifndef CHIP_DEVICE_LAYER_NONE +#define CHIP_DEVICE_LAYER_NONE 0 #endif /** - * CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT - * - * When app platform is enabled, max number of endpoints + * CHIP_DEVICE_CONFIG_ENABLE_NFC enables NFC communication for commissioning. */ -#ifndef CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT -#define CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT 0 -#endif - -/** - * CHIP_DISPATCH_EVENT_LONG_DISPATCH_TIME_WARNING_THRESHOLD_MS - * - * Time threshold for events dispatching - * Set 0 to disable event dispatching time measurement - */ -#ifndef CHIP_DISPATCH_EVENT_LONG_DISPATCH_TIME_WARNING_THRESHOLD_MS -#define CHIP_DISPATCH_EVENT_LONG_DISPATCH_TIME_WARNING_THRESHOLD_MS 100 +#ifndef CHIP_DEVICE_CONFIG_ENABLE_NFC +#define CHIP_DEVICE_CONFIG_ENABLE_NFC 0 #endif From 72d6dda1a87abb030bea99de6d97eee5d4ae8b9b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 14 Sep 2023 14:20:11 -0400 Subject: [PATCH 107/134] Make sure all known CHIP_DEVICE_LAYER_TARGET_* are defined. (#29230) * Make sure all known CHIP_DEVICE_LAYER_TARGET_* are defined. To either 0 or 1 depending on whether they are actually the target. * Address review comment. --- src/inet/tests/TestInetCommonPosix.cpp | 2 +- src/lib/dnssd/platform/tests/TestPlatform.cpp | 2 +- src/platform/BUILD.gn | 190 ++++++++++-------- 3 files changed, 105 insertions(+), 89 deletions(-) diff --git a/src/inet/tests/TestInetCommonPosix.cpp b/src/inet/tests/TestInetCommonPosix.cpp index 31d0545d6e3859..2eb5ec3ed125a6 100644 --- a/src/inet/tests/TestInetCommonPosix.cpp +++ b/src/inet/tests/TestInetCommonPosix.cpp @@ -469,7 +469,7 @@ void ServiceEvents(uint32_t aSleepTimeMilliseconds) if (sRemainingSystemLayerEventDelay == 0) { -#if defined(CHIP_DEVICE_LAYER_TARGET_OPEN_IOT_SDK) +#if CHIP_DEVICE_LAYER_TARGET_OPEN_IOT_SDK // We need to terminate event loop after performance single step. // Event loop processing work items until StopEventLoopTask is called. // Scheduling StopEventLoop task guarantees correct operation of the loop. diff --git a/src/lib/dnssd/platform/tests/TestPlatform.cpp b/src/lib/dnssd/platform/tests/TestPlatform.cpp index 31940aeacee332..3b7f91b4d8ba85 100644 --- a/src/lib/dnssd/platform/tests/TestPlatform.cpp +++ b/src/lib/dnssd/platform/tests/TestPlatform.cpp @@ -25,7 +25,7 @@ #include -#if !defined(CHIP_DEVICE_LAYER_TARGET_FAKE) || CHIP_DEVICE_LAYER_TARGET_FAKE != 1 +#if CHIP_DEVICE_LAYER_TARGET_FAKE != 1 #error "This test is designed for use only with the fake platform" #endif diff --git a/src/platform/BUILD.gn b/src/platform/BUILD.gn index 86d5c3f4476fbb..292ab1cbd7ae77 100644 --- a/src/platform/BUILD.gn +++ b/src/platform/BUILD.gn @@ -158,171 +158,187 @@ if (chip_device_platform != "none" && chip_device_platform != "external") { } if (chip_device_platform == "cc13x2_26x2") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_CC13X2_26X2=1", - "CHIP_DEVICE_LAYER_TARGET=cc13xx_26xx/cc13x2_26x2", - ] + device_layer_target_define = "CC13X2_26X2" + defines += [ "CHIP_DEVICE_LAYER_TARGET=cc13xx_26xx/cc13x2_26x2" ] } else if (chip_device_platform == "cc13x4_26x4") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_CC13X4_26X4=1", - "CHIP_DEVICE_LAYER_TARGET=cc13xx_26xx/cc13x4_26x4", - ] + device_layer_target_define = "CC13X4_26X4" + defines += [ "CHIP_DEVICE_LAYER_TARGET=cc13xx_26xx/cc13x4_26x4" ] } else if (chip_device_platform == "cc32xx") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_CC32XX=1", - "CHIP_DEVICE_LAYER_TARGET=cc32xx", - ] + device_layer_target_define = "CC32XX" + defines += [ "CHIP_DEVICE_LAYER_TARGET=cc32xx" ] } else if (chip_device_platform == "darwin") { + device_layer_target_define = "DARWIN" defines += [ - "CHIP_DEVICE_LAYER_TARGET_DARWIN=1", "CHIP_DEVICE_LAYER_TARGET=Darwin", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] } else if (chip_device_platform == "efr32") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_EFR32=1", - "CHIP_DEVICE_LAYER_TARGET=silabs", - ] + device_layer_target_define = "EFR32" + defines += [ "CHIP_DEVICE_LAYER_TARGET=silabs" ] } else if (chip_device_platform == "SiWx917") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_EFR32=1", - "CHIP_DEVICE_LAYER_TARGET=silabs", - ] + device_layer_target_define = "EFR32" + defines += [ "CHIP_DEVICE_LAYER_TARGET=silabs" ] } else if (chip_device_platform == "esp32") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_ESP32=1", - "CHIP_DEVICE_LAYER_TARGET=ESP32", - ] + device_layer_target_define = "ESP32" + defines += [ "CHIP_DEVICE_LAYER_TARGET=ESP32" ] } else if (chip_device_platform == "psoc6") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_PSOC6=1", - "CHIP_DEVICE_LAYER_TARGET=Infineon/PSOC6", - ] + device_layer_target_define = "PSOC6" + defines += [ "CHIP_DEVICE_LAYER_TARGET=Infineon/PSOC6" ] } else if (chip_device_platform == "linux") { + device_layer_target_define = "LINUX" defines += [ - "CHIP_DEVICE_LAYER_TARGET_LINUX=1", "CHIP_DEVICE_LAYER_TARGET=Linux", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] } else if (chip_device_platform == "tizen") { + device_layer_target_define = "TIZEN" defines += [ - "CHIP_DEVICE_LAYER_TARGET_TIZEN=1", "CHIP_DEVICE_LAYER_TARGET=Tizen", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] } else if (chip_device_platform == "nrfconnect") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_NRFCONNECT=1", - "CHIP_DEVICE_LAYER_TARGET=nrfconnect", - ] + device_layer_target_define = "NRFCONNECT" + defines += [ "CHIP_DEVICE_LAYER_TARGET=nrfconnect" ] } else if (chip_device_platform == "qpg") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_QPG=1", - "CHIP_DEVICE_LAYER_TARGET=qpg", - ] + device_layer_target_define = "QPG" + defines += [ "CHIP_DEVICE_LAYER_TARGET=qpg" ] } else if (chip_device_platform == "k32w0") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_K32W=1", - "CHIP_DEVICE_LAYER_TARGET=nxp/k32w/k32w0", - ] + device_layer_target_define = "K32W" + defines += [ "CHIP_DEVICE_LAYER_TARGET=nxp/k32w/k32w0" ] } else if (chip_device_platform == "telink") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_TELINK=1", - "CHIP_DEVICE_LAYER_TARGET=telink", - ] + device_layer_target_define = "TELINK" + defines += [ "CHIP_DEVICE_LAYER_TARGET=telink" ] } else if (chip_device_platform == "mbed") { + device_layer_target_define = "MBED" defines += [ - "CHIP_DEVICE_LAYER_TARGET_MBED=1", "CHIP_DEVICE_LAYER_TARGET=mbed", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", "CHIP_DEVICE_ENABLE_DATA_MODEL=${chip_enable_data_model}", ] } else if (chip_device_platform == "bl602") { + device_layer_target_define = "BL602" defines += [ - "CHIP_DEVICE_LAYER_TARGET_BL602=1", "CHIP_DEVICE_LAYER_TARGET=bouffalolab/common", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] } else if (chip_device_platform == "bl702") { + device_layer_target_define = "BL702" defines += [ - "CHIP_DEVICE_LAYER_TARGET_BL702=1", "CHIP_DEVICE_LAYER_TARGET=bouffalolab/common", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] } else if (chip_device_platform == "bl702l") { + device_layer_target_define = "BL702L" defines += [ - "CHIP_DEVICE_LAYER_TARGET_BL702L=1", "CHIP_DEVICE_LAYER_TARGET=bouffalolab/common", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] } else if (chip_device_platform == "fake") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_FAKE=1", - "CHIP_DEVICE_LAYER_TARGET=fake", - ] + device_layer_target_define = "FAKE" + defines += [ "CHIP_DEVICE_LAYER_TARGET=fake" ] } else if (chip_device_platform == "android") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_ANDROID=1", - "CHIP_DEVICE_LAYER_TARGET=android", - ] + device_layer_target_define = "ANDROID" + defines += [ "CHIP_DEVICE_LAYER_TARGET=android" ] } else if (chip_device_platform == "ameba") { + device_layer_target_define = "AMEBA" defines += [ - "CHIP_DEVICE_LAYER_TARGET_AMEBA=1", "CHIP_DEVICE_LAYER_TARGET=Ameba", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] } else if (chip_device_platform == "cyw30739") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_CYW30739=1", - "CHIP_DEVICE_LAYER_TARGET=Infineon/CYW30739", - ] + device_layer_target_define = "CYW30739" + defines += [ "CHIP_DEVICE_LAYER_TARGET=Infineon/CYW30739" ] } else if (chip_device_platform == "webos") { + device_layer_target_define = "WEBOS" defines += [ - "CHIP_DEVICE_LAYER_TARGET_WEBOS=1", "CHIP_DEVICE_LAYER_TARGET=webos", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] defines -= [ "CHIP_DEVICE_CONFIG_ENABLE_WPA=${chip_device_config_enable_wpa}" ] } else if (chip_device_platform == "mw320") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_MW320=1", - "CHIP_DEVICE_LAYER_TARGET=nxp/mw320", - ] + device_layer_target_define = "MW320" + defines += [ "CHIP_DEVICE_LAYER_TARGET=nxp/mw320" ] } else if (chip_device_platform == "zephyr") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_ZEPHYR=1", - "CHIP_DEVICE_LAYER_TARGET=Zephyr", - ] + device_layer_target_define = "ZEPHYR" + defines += [ "CHIP_DEVICE_LAYER_TARGET=Zephyr" ] } else if (chip_device_platform == "beken") { + device_layer_target_define = "BEKEN" defines += [ - "CHIP_DEVICE_LAYER_TARGET_BEKEN=1", "CHIP_DEVICE_LAYER_TARGET=Beken", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] } else if (chip_device_platform == "mt793x") { + device_layer_target_define = "MT793X" defines += [ - "CHIP_DEVICE_LAYER_TARGET_MT793X=1", "CHIP_DEVICE_LAYER_TARGET=mt793x", "CHIP_DEVICE_CONFIG_ENABLE_WIFI=${chip_enable_wifi}", ] } else if (chip_device_platform == "openiotsdk") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_OPEN_IOT_SDK=1", - "CHIP_DEVICE_LAYER_TARGET=openiotsdk", - ] + device_layer_target_define = "OPEN_IOT_SDK" + defines += [ "CHIP_DEVICE_LAYER_TARGET=openiotsdk" ] } else if (chip_device_platform == "asr") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_ASR=1", - "CHIP_DEVICE_LAYER_TARGET=ASR", - ] + device_layer_target_define = "ASR" + defines += [ "CHIP_DEVICE_LAYER_TARGET=ASR" ] } else if (chip_device_platform == "stm32") { - defines += [ - "CHIP_DEVICE_LAYER_TARGET_STM32=1", - "CHIP_DEVICE_LAYER_TARGET=stm32", - ] + device_layer_target_define = "STM32" + defines += [ "CHIP_DEVICE_LAYER_TARGET=stm32" ] + } else { + device_layer_target_define = "" } + assert(device_layer_target_define != "", + "Unknown chip_device_platform value: '${chip_device_platform}'") + + found_device_layer_target_define = false + possible_device_layer_target_defines = [ + "CC13X2_26X2", + "CC13X4_26X4", + "CC32XX", + "DARWIN", + "EFR32", + "ESP32", + "PSOC6", + "LINUX", + "TIZEN", + "NRFCONNECT", + "QPG", + "K32W", + "TELINK", + "MBED", + "BL602", + "BL702", + "BL702L", + "FAKE", + "ANDROID", + "AMEBA", + "CYW30739", + "WEBOS", + "MW320", + "ZEPHYR", + "BEKEN", + "MT793X", + "OPEN_IOT_SDK", + "ASR", + "STM32", + ] + foreach(possible_device_layer_target_define, + possible_device_layer_target_defines) { + if (possible_device_layer_target_define == device_layer_target_define) { + found_device_layer_target_define = true + defines += [ + "CHIP_DEVICE_LAYER_TARGET_${possible_device_layer_target_define}=1", + ] + } else { + defines += [ + "CHIP_DEVICE_LAYER_TARGET_${possible_device_layer_target_define}=0", + ] + } + } + assert( + found_device_layer_target_define, + "possible_device_layer_target_defines list missing '${device_layer_target_define}'") + if (chip_device_config_device_software_version != "") { defines += [ "CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION=${chip_device_config_device_software_version}" ] } From 333b0e87dff4b66d5bb3c0499f7152e4b6f5625c Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 14 Sep 2023 20:26:13 +0200 Subject: [PATCH 108/134] [MatterYamlTests] Properly translate descriptionString to description for YAML tests running with darwin-framework-tool (#29251) [MatterYamlTests] Convert fabricIndex field properly when darwin-framework-tool is used and convert names that starts with an acronym properly as well --- .../matter_chip_tool_adapter/decoder.py | 64 ++++++++++++------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py index dc721b24268447..a7dd32b7d43a85 100644 --- a/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py +++ b/examples/chip-tool/py_matter_chip_tool_adapter/matter_chip_tool_adapter/decoder.py @@ -14,6 +14,7 @@ import base64 import json +import re # These constants represent the vocabulary used for the incoming JSON. _CLUSTER_ID = 'clusterId' @@ -43,6 +44,7 @@ # a field is used for a fabric scoped struct. _FABRIC_INDEX_FIELD_CODE = '254' _FABRIC_INDEX_FIELD_NAME = 'FabricIndex' +_FABRIC_INDEX_FIELD_NAME_DARWIN = 'fabricIndex' _FABRIC_INDEX_FIELD_TYPE = 'int8u' @@ -289,44 +291,60 @@ def run(self, specs, value, cluster_name: str, typename: str, array: bool): field_name = field.name field_type = field.data_type.name field_array = field.is_list - # chip-tool returns the field code as an integer but the test suite expects - # a field name. - # To not confuse the test suite, the field code is replaced by its field name - # equivalent and then removed. + + provided_field_name = field_name + if str(field_code) in value: - value[field_name] = self.run( - specs, - value[str(field_code)], - cluster_name, - field_type, - field_array + # chip-tool returns the field code as an integer but the test suite expects + # a field name. + # To not confuse the test suite, the field code is replaced by its field name + # equivalent and then removed. + provided_field_name = str(field_code) + else: + # darwin-framework-tool returns the field name but with a different casing than + # what the test suite expects. + # To not confuse the test suite, the field name is replaced by its field name + # equivalent from the spec and then removed. + + if field_name == 'Description' and 'descriptionString' in value: + # "Description" is returned as "descriptionString" since 'description' is a reserved keyword + # and can not be exposed in an objc struct. + provided_field_name = 'descriptionString' + + # If field_name starts with a sequence of capital letters lowercase all but the last one. + provided_field_name = re.sub( + '^([A-Z]+)([A-Z])', + lambda m: m.group(1).lower() + m.group(2), + provided_field_name ) - del value[str(field_code)] - - # darwin-framework-tool returns the field name but with a different casing than what - # the test suite expects. - # To not confuse the test suite, the field name is replaced by its field name - # equivalent from the spec and then removed. - wrong_casing_field_name = field_name[0].lower( - ) + field_name[1:] - if field_name not in value and field_name[0].upper() == field_name[0] and wrong_casing_field_name in value: + + # All field names in darwin-framework-tool start with a lowercase letter. + provided_field_name = provided_field_name[0].lower( + ) + provided_field_name[1:] + + if provided_field_name in value: value[field_name] = self.run( specs, - value[wrong_casing_field_name], + value[provided_field_name], cluster_name, field_type, field_array ) - del value[wrong_casing_field_name] + del value[provided_field_name] if specs.is_fabric_scoped(struct): + if _FABRIC_INDEX_FIELD_CODE in value: + key_name = _FABRIC_INDEX_FIELD_CODE + elif _FABRIC_INDEX_FIELD_NAME_DARWIN in value: + key_name = _FABRIC_INDEX_FIELD_NAME_DARWIN + value[_FABRIC_INDEX_FIELD_NAME] = self.run( specs, - value[_FABRIC_INDEX_FIELD_CODE], + value[key_name], cluster_name, _FABRIC_INDEX_FIELD_TYPE, False) - del value[_FABRIC_INDEX_FIELD_CODE] + del value[key_name] elif isinstance(value, list) and array: value = [self.run(specs, v, cluster_name, typename, False) From 3ae526d5c94bd57642ed3fb0cd02595ce88eb275 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Thu, 14 Sep 2023 22:05:59 +0300 Subject: [PATCH 109/134] [Telink] Cleanup CI (#29247) * [Telink] remove unused tools build files during app build * [Telink] restore required checkout_submodules * [Telink] rework due to CI syntax error * [Telink] use GLOBIGNORE instead of regular expression * [Telink] use separate folder (GLOBIGNORE doesn't work in CI) * [Telink] use just out folder --- .github/workflows/examples-telink.yaml | 12 +++++++++++- .../telink/chip-module/generate_factory_data.cmake | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index f7ddf8dc340e1d..ce56a06b25db37 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -102,11 +102,18 @@ jobs: - name: clean out build output run: rm -rf ./out - - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data + - name: Build tools required for Factory Data run: | ./scripts/checkout_submodules.py --allow-changing-global-git-config --shallow --platform linux ./scripts/build/gn_gen.sh ./scripts/run_in_build_env.sh "ninja -C ./out/$BUILD_TYPE chip-cert chip-tool spake2p" + mv ./out/$BUILD_TYPE/chip-cert ./out/$BUILD_TYPE/chip-tool ./out/$BUILD_TYPE/spake2p ./out + + - name: clean out build output (keep tools) + run: rm -rf ./out/telink* + + - name: Build example Telink (B91) Lighting App with RPC, Shell and Factory Data + run: | ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-light-rpc-shell-factory-data' build" .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ @@ -114,6 +121,9 @@ jobs: out/telink-tlsr9518adk80d-light-rpc-shell-factory-data/zephyr/zephyr.elf \ /tmp/bloat_reports/ + - name: clean out build output (keep tools) + run: rm -rf ./out/telink* + - name: Build example Telink (B92) Lighting App with RPC, Shell and Factory Data run: | ./scripts/run_in_build_env.sh \ diff --git a/config/telink/chip-module/generate_factory_data.cmake b/config/telink/chip-module/generate_factory_data.cmake index 7798f101982787..9ba1903266c2dc 100644 --- a/config/telink/chip-module/generate_factory_data.cmake +++ b/config/telink/chip-module/generate_factory_data.cmake @@ -69,7 +69,7 @@ else() endif() # find chip cert tool -find_program(chip_cert_exe NAMES chip-cert PATHS ${CHIP_ROOT}/out/telink REQUIRED) +find_program(chip_cert_exe NAMES chip-cert PATHS ${CHIP_ROOT}/out REQUIRED) string(APPEND script_args "--chip-cert-path ${chip_cert_exe}\n") # for development purpose user can use default certs instead of generating or providing them @@ -99,7 +99,7 @@ else() endif() # find chip tool requied for generating QRCode -find_program(chip_tool_exe NAMES chip-tool PATHS ${CHIP_ROOT}/out/telink REQUIRED) +find_program(chip_tool_exe NAMES chip-tool PATHS ${CHIP_ROOT}/out REQUIRED) string(APPEND script_args "--chip-tool-path ${chip_tool_exe}\n") # add Password-Authenticated Key Exchange parameters @@ -108,7 +108,7 @@ string(APPEND script_args "--discriminator ${CONFIG_CHIP_DEVICE_DISCRIMINATOR}\n string(APPEND script_args "--passcode ${CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE}\n") # request spake2p to generate a new spake2_verifier -find_program(spake_exe NAMES spake2p PATHS ${CHIP_ROOT}/out/telink REQUIRED) +find_program(spake_exe NAMES spake2p PATHS ${CHIP_ROOT}/out REQUIRED) string(APPEND script_args "--spake2-path ${spake_exe}\n") if(CONFIG_CHIP_DEVICE_ENABLE_KEY) From d4cbdbcd7c412e1f181675c4853060afcb7f31b0 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Thu, 14 Sep 2023 16:56:30 -0400 Subject: [PATCH 110/134] Fix conditions for kICDMsgAckSyncEvent (#29263) This event is posted even when the ICD feature is disabled. Fix the condition. --- src/messaging/ReliableMessageContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/messaging/ReliableMessageContext.cpp b/src/messaging/ReliableMessageContext.cpp index fcba107a734c5f..ab717e34259111 100644 --- a/src/messaging/ReliableMessageContext.cpp +++ b/src/messaging/ReliableMessageContext.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -58,7 +59,7 @@ void ReliableMessageContext::SetMessageNotAcked(bool messageNotAcked) { mFlags.Set(Flags::kFlagMessageNotAcked, messageNotAcked); -#if CONFIG_DEVICE_LAYER +#if CONFIG_DEVICE_LAYER && CHIP_CONFIG_ENABLE_ICD_SERVER DeviceLayer::ChipDeviceEvent event; event.Type = DeviceLayer::DeviceEventType::kICDMsgAckSyncEvent; event.AckSync.awaitingAck = messageNotAcked; From d104699384f97f9921f3e28ce77360ff04512ef3 Mon Sep 17 00:00:00 2001 From: Justin Wood Date: Thu, 14 Sep 2023 17:55:08 -0700 Subject: [PATCH 111/134] Darwin builds are failing, this requires a cast (#29268) * Casting properly * Update src/darwin/Framework/CHIP/MTRDevice.mm Co-authored-by: Boris Zbarsky * Update src/darwin/Framework/CHIP/MTRDevice.mm Co-authored-by: Boris Zbarsky * Restyled by clang-format --------- Co-authored-by: Boris Zbarsky Co-authored-by: Restyled.io --- src/darwin/Framework/CHIP/MTRDevice.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 7fbff236a2d9cb..ce68f134260bb1 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -293,11 +293,13 @@ - (void)_changeState:(MTRDeviceState)state _state = state; if (lastState != state) { if (state != MTRDeviceStateReachable) { - MTR_LOG_INFO("%@ State change %lu => %lu, set estimated start time to nil", self, lastState, state); + MTR_LOG_INFO("%@ State change %lu => %lu, set estimated start time to nil", self, static_cast(lastState), + static_cast(state)); _estimatedStartTime = nil; _estimatedStartTimeFromGeneralDiagnosticsUpTime = nil; } else { - MTR_LOG_INFO("%@ State change %lu => %lu", self, lastState, state); + MTR_LOG_INFO( + "%@ State change %lu => %lu", self, static_cast(lastState), static_cast(state)); } id delegate = _weakDelegate.strongObject; if (delegate) { From 4892ab8ece2c79bf08cffe2ec7dc1f637f383dd6 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 15 Sep 2023 06:34:49 -0400 Subject: [PATCH 112/134] Remove mInfo field from Cancelable by default. (#29262) * Remove mInfo field from Cancelable by default. It's big, and totally unused. The opt-in to enable it is for backwards compat. If we care about preserving compat while also ensuring that some internal Cancelable uses never have this field, that is also possible, but more complicated. * Apply suggestion from code review. Co-authored-by: Tennessee Carmel-Veilleux --------- Co-authored-by: Tennessee Carmel-Veilleux --- src/lib/core/BUILD.gn | 1 + src/lib/core/CHIPCallback.h | 8 ++++++++ src/lib/core/core.gni | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/lib/core/BUILD.gn b/src/lib/core/BUILD.gn index 60f56af7e5850b..cbefb82b3058ce 100644 --- a/src/lib/core/BUILD.gn +++ b/src/lib/core/BUILD.gn @@ -64,6 +64,7 @@ buildconfig_header("chip_buildconfig") { "CHIP_CONFIG_TRANSPORT_PW_TRACE_ENABLED=${chip_enable_transport_pw_trace}", "CHIP_CONFIG_MINMDNS_DYNAMIC_OPERATIONAL_RESPONDER_LIST=${chip_config_minmdns_dynamic_operational_responder_list}", "CHIP_CONFIG_MINMDNS_MAX_PARALLEL_RESOLVES=${chip_config_minmdns_max_parallel_resolves}", + "CHIP_CONFIG_CANCELABLE_HAS_INFO_STRING_FIELD=${chip_config_cancelable_has_info_string_field}", ] } diff --git a/src/lib/core/CHIPCallback.h b/src/lib/core/CHIPCallback.h index dd010eaa04abc3..9b73078886a492 100644 --- a/src/lib/core/CHIPCallback.h +++ b/src/lib/core/CHIPCallback.h @@ -26,6 +26,8 @@ #include #include +#include + namespace chip { namespace Callback { @@ -49,7 +51,13 @@ class Cancelable */ Cancelable * mNext; Cancelable * mPrev; + + // CHIP_CONFIG_CANCELABLE_HAS_INFO_STRING_FIELD allows consumers that were + // using this field to opt into having it (and the resulting memory bloat) + // while allowing everyone else to save the memory. +#if CHIP_CONFIG_CANCELABLE_HAS_INFO_STRING_FIELD alignas(uint64_t) char mInfo[24]; +#endif // CHIP_CONFIG_CANCELABLE_HAS_INFO_STRING_FIELD /** * @brief when non-null, indicates the Callback is registered with diff --git a/src/lib/core/core.gni b/src/lib/core/core.gni index 46c7b3ce72ad7b..5d4a46f41dd708 100644 --- a/src/lib/core/core.gni +++ b/src/lib/core/core.gni @@ -84,6 +84,10 @@ declare_args() { # When using minmdns, set the number of parallel resolves chip_config_minmdns_max_parallel_resolves = 2 + + # If set to true, adds a string "info" field to Cancelable. + # Only here for backwards compat. Generally, THIS SHOULD NOT BE SET TO TRUE. + chip_config_cancelable_has_info_string_field = false } if (chip_target_style == "") { From b15a6e6184ccdaa9121fe0b9508832bee3e79f70 Mon Sep 17 00:00:00 2001 From: Karsten Sperling <113487422+ksperling-apple@users.noreply.github.com> Date: Sat, 16 Sep 2023 03:58:46 +1200 Subject: [PATCH 113/134] Make constexpr constants in headers inline constexpr (#29279) * Make constexpr constants in headers inline constexpr This makes the linker deduplicate these constants, instead of emitting one definition per compilation unit. E.g. chip::System::Clock::kZero currently exists >10 times in the chip-tool binary. * Restyle --- .../commands/clusters/ComplexArgument.h | 4 +- .../commands/clusters/WriteAttributeCommand.h | 6 +- .../chip-tool/commands/common/CHIPCommand.h | 8 +- .../commands/common/CustomStringPrefix.h | 16 +-- .../commands/common/CHIPCommandBridge.h | 6 +- .../commands/tests/TestCommandBridge.h | 4 +- .../placeholder/linux/include/TestCommand.h | 6 +- .../telink/common/include/AppTaskCommon.h | 10 +- examples/shell/shell_common/include/Globals.h | 6 +- examples/tv-casting-app/linux/CastingUtils.h | 2 +- .../tv-casting-common/include/CastingServer.h | 2 +- .../include/PersistenceManager.h | 2 +- .../include/TargetEndpointInfo.h | 2 +- .../include/TargetVideoPlayerInfo.h | 2 +- src/app/EventLoggingTypes.h | 2 +- src/app/EventManagement.h | 6 +- src/app/InteractionModelRevision.h | 2 +- src/app/ReadHandler.h | 2 +- src/app/app-platform/ContentAppPlatform.h | 6 +- .../operational-state-cluster-objects.h | 8 +- src/app/clusters/scenes-server/SceneTable.h | 6 +- src/app/data-model/Encode.h | 4 +- src/app/data-model/Nullable.h | 2 +- src/app/icd/IcdMonitoringTable.h | 2 +- src/app/server/Server.h | 2 +- src/app/tests/integration/common.h | 24 ++-- .../interaction_model/InteractionModel.h | 2 +- src/app/util/mock/Constants.h | 8 +- src/app/util/privilege-storage.h | 10 +- src/ble/BleLayer.h | 16 +-- src/ble/BtpEngine.h | 8 +- src/controller/CHIPDeviceController.h | 2 +- .../CHIPDeviceControllerSystemState.h | 2 +- src/controller/CommissioneeDeviceProxy.h | 2 +- src/controller/CommissioningDelegate.h | 4 +- .../OperationalCredentialsDelegate.h | 4 +- .../DeviceAttestationConstructor.h | 4 +- src/crypto/CHIPCryptoPAL.h | 108 +++++++++--------- .../platform/CommissionableDataProvider.h | 6 +- src/include/platform/DiagnosticDataProvider.h | 10 +- src/include/platform/NetworkCommissioning.h | 2 +- src/include/platform/PersistedStorage.h | 2 +- .../platform/internal/DeviceNetworkInfo.h | 6 +- .../AddressResolve_DefaultImpl.h | 2 +- src/lib/core/DataModelTypes.h | 20 ++-- src/lib/core/GroupId.h | 20 ++-- src/lib/core/InPlace.h | 4 +- src/lib/core/NodeId.h | 28 ++--- src/lib/core/OTAImageHeader.h | 2 +- src/lib/core/Optional.h | 2 +- src/lib/core/PasscodeId.h | 2 +- src/lib/dnssd/Constants.h | 38 +++--- src/lib/dnssd/Resolver.h | 6 +- src/lib/dnssd/ServiceNaming.h | 14 +-- src/lib/dnssd/minimal_mdns/core/Constants.h | 4 +- .../minimal_mdns/tests/CheckOnlyServer.h | 2 +- src/lib/support/CommonPersistentData.h | 4 +- src/lib/support/PrivateHeap.h | 2 +- src/lib/support/ThreadOperationalDataset.h | 16 +-- src/messaging/ReliableMessageProtocolConfig.h | 2 +- src/messaging/tests/echo/common.h | 6 +- src/platform/ASR/NetworkCommissioningDriver.h | 8 +- .../Ameba/NetworkCommissioningDriver.h | 6 +- .../Beken/NetworkCommissioningDriver.h | 6 +- .../ESP32/NetworkCommissioningDriver.h | 6 +- .../PSOC6/NetworkCommissioningDriver.h | 8 +- .../android/DiagnosticDataProviderImpl.h | 6 +- .../BL602/NetworkCommissioningDriver.h | 6 +- .../BL702/NetworkCommissioningDriver.h | 6 +- .../mbed/NetworkCommissioningDriver.h | 6 +- .../mt793x/NetworkCommissioningWiFiDriver.h | 8 +- src/platform/nrfconnect/wifi/NrfWiFiDriver.h | 6 +- .../nxp/k32w/common/OTATlvProcessor.h | 6 +- src/platform/openiotsdk/KVPsaPsStore.h | 2 +- .../silabs/NetworkCommissioningWiFiDriver.h | 6 +- src/platform/silabs/SilabsConfig.h | 10 +- .../silabs/efr32/Efr32OpaqueKeypair.h | 8 +- src/protocols/bdx/BdxMessages.h | 4 +- src/protocols/bdx/BdxUri.h | 2 +- src/protocols/echo/Echo.h | 2 +- src/protocols/interaction_model/Constants.h | 4 +- .../secure_channel/CASEDestinationId.h | 4 +- src/protocols/secure_channel/Constants.h | 16 +-- src/protocols/secure_channel/PASESession.h | 6 +- .../secure_channel/RendezvousParameters.h | 2 +- .../user_directed_commissioning/UDCClients.h | 2 +- .../UserDirectedCommissioning.h | 4 +- src/setup_payload/AdditionalDataPayload.h | 4 +- src/setup_payload/SetupPayload.h | 16 +-- src/setup_payload/tests/TestHelpers.h | 10 +- src/system/SocketEvents.h | 2 +- src/system/SystemClock.h | 2 +- src/transport/SecureSessionTable.h | 4 +- src/transport/SessionManager.h | 2 +- src/transport/TraceMessage.h | 6 +- 95 files changed, 354 insertions(+), 354 deletions(-) diff --git a/examples/chip-tool/commands/clusters/ComplexArgument.h b/examples/chip-tool/commands/clusters/ComplexArgument.h index 7705ba50369a59..fa19553d0cab62 100644 --- a/examples/chip-tool/commands/clusters/ComplexArgument.h +++ b/examples/chip-tool/commands/clusters/ComplexArgument.h @@ -45,8 +45,8 @@ #include "JsonParser.h" -constexpr uint8_t kMaxLabelLength = UINT8_MAX; -constexpr const char kNullString[] = "null"; +inline constexpr uint8_t kMaxLabelLength = UINT8_MAX; +inline constexpr const char kNullString[] = "null"; class ComplexArgumentParser { diff --git a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h index 46a0b3dc4b37dd..76dc64ef6201db 100644 --- a/examples/chip-tool/commands/clusters/WriteAttributeCommand.h +++ b/examples/chip-tool/commands/clusters/WriteAttributeCommand.h @@ -23,9 +23,9 @@ #include "DataModelLogger.h" #include "ModelCommand.h" -constexpr const char * kWriteCommandKey = "write"; -constexpr const char * kWriteByIdCommandKey = "write-by-id"; -constexpr const char * kForceWriteCommandKey = "force-write"; +inline constexpr const char * kWriteCommandKey = "write"; +inline constexpr const char * kWriteByIdCommandKey = "write-by-id"; +inline constexpr const char * kForceWriteCommandKey = "force-write"; enum class WriteCommandType { diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index 9d7c3c1a741ea6..36732793653504 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -34,9 +34,9 @@ #pragma once -constexpr const char kIdentityAlpha[] = "alpha"; -constexpr const char kIdentityBeta[] = "beta"; -constexpr const char kIdentityGamma[] = "gamma"; +inline constexpr const char kIdentityAlpha[] = "alpha"; +inline constexpr const char kIdentityBeta[] = "beta"; +inline constexpr const char kIdentityGamma[] = "gamma"; // The null fabric commissioner is a commissioner that isn't on a fabric. // This is a legal configuration in which the commissioner delegates // operational communication and invocation of the commssioning complete @@ -46,7 +46,7 @@ constexpr const char kIdentityGamma[] = "gamma"; // commissioner portion of such an architecture. The null-fabric-commissioner // can carry a commissioning flow up until the point of operational channel // (CASE) communcation. -constexpr const char kIdentityNull[] = "null-fabric-commissioner"; +inline constexpr const char kIdentityNull[] = "null-fabric-commissioner"; class CHIPCommand : public Command { diff --git a/examples/chip-tool/commands/common/CustomStringPrefix.h b/examples/chip-tool/commands/common/CustomStringPrefix.h index 235e190fd8f924..63196f78dbe3da 100644 --- a/examples/chip-tool/commands/common/CustomStringPrefix.h +++ b/examples/chip-tool/commands/common/CustomStringPrefix.h @@ -22,17 +22,17 @@ #include -static constexpr char kJsonStringPrefix[] = "json:"; -constexpr size_t kJsonStringPrefixLen = ArraySize(kJsonStringPrefix) - 1; // Don't count the null +static constexpr char kJsonStringPrefix[] = "json:"; +inline constexpr size_t kJsonStringPrefixLen = ArraySize(kJsonStringPrefix) - 1; // Don't count the null -static constexpr char kBase64StringPrefix[] = "base64:"; -constexpr size_t kBase64StringPrefixLen = ArraySize(kBase64StringPrefix) - 1; // Don't count the null +static constexpr char kBase64StringPrefix[] = "base64:"; +inline constexpr size_t kBase64StringPrefixLen = ArraySize(kBase64StringPrefix) - 1; // Don't count the null -static constexpr char kHexStringPrefix[] = "hex:"; -constexpr size_t kHexStringPrefixLen = ArraySize(kHexStringPrefix) - 1; // Don't count the null +static constexpr char kHexStringPrefix[] = "hex:"; +inline constexpr size_t kHexStringPrefixLen = ArraySize(kHexStringPrefix) - 1; // Don't count the null -static constexpr char kStrStringPrefix[] = "str:"; -constexpr size_t kStrStringPrefixLen = ArraySize(kStrStringPrefix) - 1; // Don't count the null +static constexpr char kStrStringPrefix[] = "str:"; +inline constexpr size_t kStrStringPrefixLen = ArraySize(kStrStringPrefix) - 1; // Don't count the null inline bool IsJsonString(const char * str) { diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h index 0f5015e4711c71..4537f522081cff 100644 --- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h +++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h @@ -28,9 +28,9 @@ #pragma once -constexpr const char kIdentityAlpha[] = "alpha"; -constexpr const char kIdentityBeta[] = "beta"; -constexpr const char kIdentityGamma[] = "gamma"; +inline constexpr const char kIdentityAlpha[] = "alpha"; +inline constexpr const char kIdentityBeta[] = "beta"; +inline constexpr const char kIdentityGamma[] = "gamma"; class CHIPCommandBridge : public Command { public: diff --git a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h index b3d08ecf051774..abcc56dffbaf9d 100644 --- a/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h +++ b/examples/darwin-framework-tool/commands/tests/TestCommandBridge.h @@ -41,7 +41,7 @@ const char basePath[] = "./src/app/tests/suites/commands/delay/scripts/"; const char * getScriptsFolder() { return basePath; } } // namespace -constexpr const char * kDefaultKey = "default"; +inline constexpr const char * kDefaultKey = "default"; @interface TestDeviceControllerDelegate : NSObject @property TestCommandBridge * commandBridge; @@ -58,7 +58,7 @@ constexpr const char * kDefaultKey = "default"; NS_ASSUME_NONNULL_END -constexpr uint16_t kTimeoutInSeconds = 90; +inline constexpr uint16_t kTimeoutInSeconds = 90; class TestCommandBridge : public CHIPCommandBridge, public ValueChecker, diff --git a/examples/placeholder/linux/include/TestCommand.h b/examples/placeholder/linux/include/TestCommand.h index 7bd4d3b6e8497b..e078345f430643 100644 --- a/examples/placeholder/linux/include/TestCommand.h +++ b/examples/placeholder/linux/include/TestCommand.h @@ -35,9 +35,9 @@ #include #include -constexpr const char kIdentityAlpha[] = ""; -constexpr const char kIdentityBeta[] = ""; -constexpr const char kIdentityGamma[] = ""; +inline constexpr const char kIdentityAlpha[] = ""; +inline constexpr const char kIdentityBeta[] = ""; +inline constexpr const char kIdentityGamma[] = ""; class TestCommand : public TestRunner, public PICSChecker, diff --git a/examples/platform/telink/common/include/AppTaskCommon.h b/examples/platform/telink/common/include/AppTaskCommon.h index 74f1f879056ba5..09a8e898cd6a8d 100644 --- a/examples/platform/telink/common/include/AppTaskCommon.h +++ b/examples/platform/telink/common/include/AppTaskCommon.h @@ -53,11 +53,11 @@ using namespace ::chip::Credentials; using namespace ::chip::DeviceLayer; namespace { -constexpr EndpointId kExampleEndpointId = 1; -constexpr uint8_t kDefaultMinLevel = 0; -constexpr uint8_t kDefaultMaxLevel = 254; -constexpr uint8_t kButtonPushEvent = 1; -constexpr uint8_t kButtonReleaseEvent = 0; +inline constexpr EndpointId kExampleEndpointId = 1; +inline constexpr uint8_t kDefaultMinLevel = 0; +inline constexpr uint8_t kDefaultMaxLevel = 254; +inline constexpr uint8_t kButtonPushEvent = 1; +inline constexpr uint8_t kButtonReleaseEvent = 0; } // namespace class AppTaskCommon diff --git a/examples/shell/shell_common/include/Globals.h b/examples/shell/shell_common/include/Globals.h index fd2726c3e1f6ef..d91620ca0ad171 100644 --- a/examples/shell/shell_common/include/Globals.h +++ b/examples/shell/shell_common/include/Globals.h @@ -28,10 +28,10 @@ #include #if INET_CONFIG_ENABLE_TCP_ENDPOINT -constexpr size_t kMaxTcpActiveConnectionCount = 4; -constexpr size_t kMaxTcpPendingPackets = 4; +inline constexpr size_t kMaxTcpActiveConnectionCount = 4; +inline constexpr size_t kMaxTcpPendingPackets = 4; #endif -constexpr chip::System::Clock::Timeout kResponseTimeOut = chip::System::Clock::Seconds16(1); +inline constexpr chip::System::Clock::Timeout kResponseTimeOut = chip::System::Clock::Seconds16(1); extern chip::FabricTable gFabricTable; extern chip::secure_channel::MessageCounterManager gMessageCounterManager; diff --git a/examples/tv-casting-app/linux/CastingUtils.h b/examples/tv-casting-app/linux/CastingUtils.h index 13d9818662e3af..d87a8318948c76 100644 --- a/examples/tv-casting-app/linux/CastingUtils.h +++ b/examples/tv-casting-app/linux/CastingUtils.h @@ -26,7 +26,7 @@ #include "TargetEndpointInfo.h" #include "TargetVideoPlayerInfo.h" -constexpr uint32_t kCommissionerDiscoveryTimeoutInMs = 5 * 1000; +inline constexpr uint32_t kCommissionerDiscoveryTimeoutInMs = 5 * 1000; CHIP_ERROR ProcessClusterCommand(int argc, char ** argv); diff --git a/examples/tv-casting-app/tv-casting-common/include/CastingServer.h b/examples/tv-casting-app/tv-casting-common/include/CastingServer.h index fd427afc712639..f6078dd1a855f1 100644 --- a/examples/tv-casting-app/tv-casting-common/include/CastingServer.h +++ b/examples/tv-casting-app/tv-casting-common/include/CastingServer.h @@ -40,7 +40,7 @@ #include #include -constexpr chip::System::Clock::Seconds16 kCommissioningWindowTimeout = chip::System::Clock::Seconds16(3 * 60); +inline constexpr chip::System::Clock::Seconds16 kCommissioningWindowTimeout = chip::System::Clock::Seconds16(3 * 60); /** * @brief Represents a TV Casting server that can get the casting app commissioned diff --git a/examples/tv-casting-app/tv-casting-common/include/PersistenceManager.h b/examples/tv-casting-app/tv-casting-common/include/PersistenceManager.h index f0774c3d0a2c23..2e4b7c90167458 100644 --- a/examples/tv-casting-app/tv-casting-common/include/PersistenceManager.h +++ b/examples/tv-casting-app/tv-casting-common/include/PersistenceManager.h @@ -21,7 +21,7 @@ #include "TargetEndpointInfo.h" #include "TargetVideoPlayerInfo.h" -constexpr size_t kMaxCachedVideoPlayers = 32; +inline constexpr size_t kMaxCachedVideoPlayers = 32; class PersistenceManager : public chip::FabricTable::Delegate { diff --git a/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h b/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h index 31cfde0d02b3f6..f93251e327f7a0 100644 --- a/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h +++ b/examples/tv-casting-app/tv-casting-common/include/TargetEndpointInfo.h @@ -20,7 +20,7 @@ #include -constexpr size_t kMaxNumberOfClustersPerEndpoint = 10; +inline constexpr size_t kMaxNumberOfClustersPerEndpoint = 10; class TargetEndpointInfo { diff --git a/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h index bbc086ae64a52d..d027a19edfb512 100644 --- a/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h +++ b/examples/tv-casting-app/tv-casting-common/include/TargetVideoPlayerInfo.h @@ -25,7 +25,7 @@ #include -constexpr size_t kMaxNumberOfEndpoints = 5; +inline constexpr size_t kMaxNumberOfEndpoints = 5; class TargetVideoPlayerInfo; class VideoPlayerConnectionContext diff --git a/src/app/EventLoggingTypes.h b/src/app/EventLoggingTypes.h index 351774256d2a45..35fd37a25045ca 100644 --- a/src/app/EventLoggingTypes.h +++ b/src/app/EventLoggingTypes.h @@ -26,7 +26,7 @@ #include #include -constexpr size_t kNumPriorityLevel = 3; +inline constexpr size_t kNumPriorityLevel = 3; namespace chip { namespace app { diff --git a/src/app/EventManagement.h b/src/app/EventManagement.h index 2286328214a0c5..228c26cca94a68 100644 --- a/src/app/EventManagement.h +++ b/src/app/EventManagement.h @@ -70,9 +70,9 @@ namespace chip { namespace app { -constexpr const uint32_t kEventManagementProfile = 0x1; -constexpr const uint32_t kFabricIndexTag = 0x1; -constexpr size_t kMaxEventSizeReserve = 512; +inline constexpr const uint32_t kEventManagementProfile = 0x1; +inline constexpr const uint32_t kFabricIndexTag = 0x1; +inline constexpr size_t kMaxEventSizeReserve = 512; constexpr uint16_t kRequiredEventField = (1 << to_underlying(EventDataIB::Tag::kPriority)) | (1 << to_underlying(EventDataIB::Tag::kPath)); diff --git a/src/app/InteractionModelRevision.h b/src/app/InteractionModelRevision.h index 9cc9fc66de0796..529ac0f839c80e 100644 --- a/src/app/InteractionModelRevision.h +++ b/src/app/InteractionModelRevision.h @@ -32,4 +32,4 @@ #define CHIP_DEVICE_INTERACTION_MODEL_REVISION 11 #endif -constexpr uint8_t kInteractionModelRevisionTag = 0xFF; +inline constexpr uint8_t kInteractionModelRevisionTag = 0xFF; diff --git a/src/app/ReadHandler.h b/src/app/ReadHandler.h index ecdc0c1c0696c1..4c9ad469c782eb 100644 --- a/src/app/ReadHandler.h +++ b/src/app/ReadHandler.h @@ -52,7 +52,7 @@ #include // https://github.com/CHIP-Specifications/connectedhomeip-spec/blob/61a9d19e6af12fdfb0872bcff26d19de6c680a1a/src/Ch02_Architecture.adoc#1122-subscribe-interaction-limits -constexpr uint16_t kSubscriptionMaxIntervalPublisherLimit = 3600; // seconds (60 minutes) +inline constexpr uint16_t kSubscriptionMaxIntervalPublisherLimit = 3600; // seconds (60 minutes) namespace chip { namespace app { diff --git a/src/app/app-platform/ContentAppPlatform.h b/src/app/app-platform/ContentAppPlatform.h index 8ab9efab8250c6..593ec0706a5a15 100644 --- a/src/app/app-platform/ContentAppPlatform.h +++ b/src/app/app-platform/ContentAppPlatform.h @@ -49,9 +49,9 @@ EmberAfStatus AppPlatformExternalAttributeReadCallback(EndpointId endpoint, Clus EmberAfStatus AppPlatformExternalAttributeWriteCallback(EndpointId endpoint, ClusterId clusterId, const EmberAfAttributeMetadata * attributeMetadata, uint8_t * buffer); -constexpr EndpointId kTargetBindingClusterEndpointId = 0; -constexpr EndpointId kLocalVideoPlayerEndpointId = 1; -constexpr EndpointId kLocalSpeakerEndpointId = 2; +inline constexpr EndpointId kTargetBindingClusterEndpointId = 0; +inline constexpr EndpointId kLocalVideoPlayerEndpointId = 1; +inline constexpr EndpointId kLocalSpeakerEndpointId = 2; class DLL_EXPORT ContentAppFactory { diff --git a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h index 8fdd68cbd3851c..1910e00d20effb 100644 --- a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h +++ b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h @@ -27,10 +27,10 @@ namespace app { namespace Clusters { namespace OperationalState { -constexpr size_t kOperationalStateLabelMaxSize = 64u; -constexpr size_t kOperationalErrorLabelMaxSize = 64u; -constexpr size_t kOperationalErrorDetailsMaxSize = 64u; -constexpr size_t kOperationalPhaseNameMaxSize = 64u; +inline constexpr size_t kOperationalStateLabelMaxSize = 64u; +inline constexpr size_t kOperationalErrorLabelMaxSize = 64u; +inline constexpr size_t kOperationalErrorDetailsMaxSize = 64u; +inline constexpr size_t kOperationalPhaseNameMaxSize = 64u; /** * A class which represents the operational state of an Operational State cluster derivation instance. diff --git a/src/app/clusters/scenes-server/SceneTable.h b/src/app/clusters/scenes-server/SceneTable.h index b76ade0a15c665..e7fb2328d9ed98 100644 --- a/src/app/clusters/scenes-server/SceneTable.h +++ b/src/app/clusters/scenes-server/SceneTable.h @@ -33,9 +33,9 @@ typedef uint16_t SceneIndex; typedef uint32_t TransitionTimeMs; typedef uint32_t SceneTransitionTime; -constexpr GroupId kGlobalGroupSceneId = 0x0000; -constexpr SceneIndex kUndefinedSceneIndex = 0xffff; -constexpr SceneId kUndefinedSceneId = 0xff; +inline constexpr GroupId kGlobalGroupSceneId = 0x0000; +inline constexpr SceneIndex kUndefinedSceneIndex = 0xffff; +inline constexpr SceneId kUndefinedSceneId = 0xff; static constexpr size_t kIteratorsMax = CHIP_CONFIG_MAX_SCENES_CONCURRENT_ITERATORS; static constexpr size_t kSceneNameMaxLength = CHIP_CONFIG_SCENES_CLUSTER_MAXIMUM_NAME_LENGTH; diff --git a/src/app/data-model/Encode.h b/src/app/data-model/Encode.h index 84a32cf745983c..7cb8298e47ac72 100644 --- a/src/app/data-model/Encode.h +++ b/src/app/data-model/Encode.h @@ -37,10 +37,10 @@ template using VoidType = void; template -constexpr bool HasUnknownValue = false; +inline constexpr bool HasUnknownValue = false; template -constexpr bool HasUnknownValue> = true; +inline constexpr bool HasUnknownValue> = true; } // namespace detail /* diff --git a/src/app/data-model/Nullable.h b/src/app/data-model/Nullable.h index ad6bdaf9e2c172..dec7fc5eb9ef55 100644 --- a/src/app/data-model/Nullable.h +++ b/src/app/data-model/Nullable.h @@ -30,7 +30,7 @@ namespace DataModel { /** * NullNullable is an alias for NullOptional, for better readability. */ -constexpr auto NullNullable = NullOptional; +inline constexpr auto NullNullable = NullOptional; /* * Dedicated type for nullable things, to differentiate them from optional diff --git a/src/app/icd/IcdMonitoringTable.h b/src/app/icd/IcdMonitoringTable.h index 0bfb311207c0d5..86186aec594d07 100644 --- a/src/app/icd/IcdMonitoringTable.h +++ b/src/app/icd/IcdMonitoringTable.h @@ -25,7 +25,7 @@ namespace chip { -constexpr size_t kIcdMonitoringBufferSize = 40; +inline constexpr size_t kIcdMonitoringBufferSize = 40; struct IcdMonitoringEntry : public PersistentData { diff --git a/src/app/server/Server.h b/src/app/server/Server.h index e2bcbe83d363a8..2d9a78c58737b1 100644 --- a/src/app/server/Server.h +++ b/src/app/server/Server.h @@ -74,7 +74,7 @@ namespace chip { -constexpr size_t kMaxBlePendingPackets = 1; +inline constexpr size_t kMaxBlePendingPackets = 1; // // NOTE: Please do not alter the order of template specialization here as the logic diff --git a/src/app/tests/integration/common.h b/src/app/tests/integration/common.h index 4766b9d6160500..5d232476981a17 100644 --- a/src/app/tests/integration/common.h +++ b/src/app/tests/integration/common.h @@ -43,18 +43,18 @@ extern chip::SessionHolder gSession; extern chip::TestPersistentStorageDelegate gStorage; extern chip::Crypto::DefaultSessionKeystore gSessionKeystore; -constexpr chip::NodeId kTestNodeId = 0x1ULL; -constexpr chip::NodeId kTestNodeId1 = 0x2ULL; -constexpr chip::ClusterId kTestClusterId = 6; -constexpr chip::CommandId kTestCommandId = 40; -constexpr chip::EndpointId kTestEndpointId = 1; -constexpr chip::GroupId kTestGroupId = 0; -constexpr chip::FieldId kTestFieldId1 = 1; -constexpr chip::FieldId kTestFieldId2 = 2; -constexpr uint8_t kTestFieldValue1 = 1; -constexpr uint8_t kTestFieldValue2 = 2; -constexpr chip::EventId kTestChangeEvent1 = 1; -constexpr chip::EventId kTestChangeEvent2 = 2; +inline constexpr chip::NodeId kTestNodeId = 0x1ULL; +inline constexpr chip::NodeId kTestNodeId1 = 0x2ULL; +inline constexpr chip::ClusterId kTestClusterId = 6; +inline constexpr chip::CommandId kTestCommandId = 40; +inline constexpr chip::EndpointId kTestEndpointId = 1; +inline constexpr chip::GroupId kTestGroupId = 0; +inline constexpr chip::FieldId kTestFieldId1 = 1; +inline constexpr chip::FieldId kTestFieldId2 = 2; +inline constexpr uint8_t kTestFieldValue1 = 1; +inline constexpr uint8_t kTestFieldValue2 = 2; +inline constexpr chip::EventId kTestChangeEvent1 = 1; +inline constexpr chip::EventId kTestChangeEvent2 = 2; void InitializeChip(void); void ShutdownChip(void); void TLVPrettyPrinter(const char * aFormat, ...); diff --git a/src/app/tests/suites/commands/interaction_model/InteractionModel.h b/src/app/tests/suites/commands/interaction_model/InteractionModel.h index c52ff744fac791..da3c3378a45d90 100644 --- a/src/app/tests/suites/commands/interaction_model/InteractionModel.h +++ b/src/app/tests/suites/commands/interaction_model/InteractionModel.h @@ -28,7 +28,7 @@ #include #include -constexpr uint8_t kMaxAllowedPaths = 64; +inline constexpr uint8_t kMaxAllowedPaths = 64; namespace chip { namespace test_utils { diff --git a/src/app/util/mock/Constants.h b/src/app/util/mock/Constants.h index a9017a58fba2da..803dff5b7f8f12 100644 --- a/src/app/util/mock/Constants.h +++ b/src/app/util/mock/Constants.h @@ -30,10 +30,10 @@ namespace chip { namespace Test { -constexpr EndpointId kMockEndpoint1 = 0xFFFE; -constexpr EndpointId kMockEndpoint2 = 0xFFFD; -constexpr EndpointId kMockEndpoint3 = 0xFFFC; -constexpr EndpointId kMockEndpointMin = 0xFFF1; +inline constexpr EndpointId kMockEndpoint1 = 0xFFFE; +inline constexpr EndpointId kMockEndpoint2 = 0xFFFD; +inline constexpr EndpointId kMockEndpoint3 = 0xFFFC; +inline constexpr EndpointId kMockEndpointMin = 0xFFF1; constexpr AttributeId MockAttributeId(const uint16_t & id) { diff --git a/src/app/util/privilege-storage.h b/src/app/util/privilege-storage.h index 5253769e019ea3..02d55488fd0780 100644 --- a/src/app/util/privilege-storage.h +++ b/src/app/util/privilege-storage.h @@ -18,11 +18,11 @@ #include -constexpr int kMatterAccessPrivilegeView = 0; -constexpr int kMatterAccessPrivilegeOperate = 1; -constexpr int kMatterAccessPrivilegeManage = 2; -constexpr int kMatterAccessPrivilegeAdminister = 3; -constexpr int kMatterAccessPrivilegeMaxValue = kMatterAccessPrivilegeAdminister; +inline constexpr int kMatterAccessPrivilegeView = 0; +inline constexpr int kMatterAccessPrivilegeOperate = 1; +inline constexpr int kMatterAccessPrivilegeManage = 2; +inline constexpr int kMatterAccessPrivilegeAdminister = 3; +inline constexpr int kMatterAccessPrivilegeMaxValue = kMatterAccessPrivilegeAdminister; int MatterGetAccessPrivilegeForReadAttribute(chip::ClusterId cluster, chip::AttributeId attribute); int MatterGetAccessPrivilegeForWriteAttribute(chip::ClusterId cluster, chip::AttributeId attribute); diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h index 1f9dec2860a696..5ded6c82cc2b46 100644 --- a/src/ble/BleLayer.h +++ b/src/ble/BleLayer.h @@ -92,17 +92,17 @@ typedef enum kBleTransportProtocolVersion_V4 = 4 // BTP as defined by CHIP v1.0 } BleTransportProtocolVersion; -constexpr size_t kCapabilitiesRequestMagicnumLength = 2; -constexpr size_t kCapabilitiesRequestL2capMtuLength = 2; -constexpr size_t kCapabilitiesRequestSupportedVersionsLength = 4; -constexpr size_t kCapabilitiesRequestWindowSizeLength = 1; +inline constexpr size_t kCapabilitiesRequestMagicnumLength = 2; +inline constexpr size_t kCapabilitiesRequestL2capMtuLength = 2; +inline constexpr size_t kCapabilitiesRequestSupportedVersionsLength = 4; +inline constexpr size_t kCapabilitiesRequestWindowSizeLength = 1; constexpr size_t kCapabilitiesRequestLength = (kCapabilitiesRequestMagicnumLength + kCapabilitiesRequestL2capMtuLength + kCapabilitiesRequestSupportedVersionsLength + kCapabilitiesRequestWindowSizeLength); -constexpr size_t kCapabilitiesResponseMagicnumLength = 2; -constexpr size_t kCapabilitiesResponseL2capMtuLength = 2; -constexpr size_t kCapabilitiesResponseSelectedProtocolVersionLength = 1; -constexpr size_t kCapabilitiesResponseWindowSizeLength = 1; +inline constexpr size_t kCapabilitiesResponseMagicnumLength = 2; +inline constexpr size_t kCapabilitiesResponseL2capMtuLength = 2; +inline constexpr size_t kCapabilitiesResponseSelectedProtocolVersionLength = 1; +inline constexpr size_t kCapabilitiesResponseWindowSizeLength = 1; constexpr size_t kCapabilitiesResponseLength(kCapabilitiesResponseMagicnumLength + kCapabilitiesResponseL2capMtuLength + kCapabilitiesResponseSelectedProtocolVersionLength + kCapabilitiesResponseWindowSizeLength); diff --git a/src/ble/BtpEngine.h b/src/ble/BtpEngine.h index 4d32cf7342da94..7ec59e35a60c62 100644 --- a/src/ble/BtpEngine.h +++ b/src/ble/BtpEngine.h @@ -43,10 +43,10 @@ namespace chip { namespace Ble { -constexpr size_t kTransferProtocolHeaderFlagsSize = 1; // Size in bytes of enocded BTP fragment header flag bits -constexpr size_t kTransferProtocolSequenceNumSize = 1; // Size in bytes of encoded BTP sequence number -constexpr size_t kTransferProtocolAckSize = 1; // Size in bytes of encoded BTP fragment acknowledgement number -constexpr size_t kTransferProtocolMsgLenSize = 2; // Size in byte of encoded BTP total fragmented message length +inline constexpr size_t kTransferProtocolHeaderFlagsSize = 1; // Size in bytes of enocded BTP fragment header flag bits +inline constexpr size_t kTransferProtocolSequenceNumSize = 1; // Size in bytes of encoded BTP sequence number +inline constexpr size_t kTransferProtocolAckSize = 1; // Size in bytes of encoded BTP fragment acknowledgement number +inline constexpr size_t kTransferProtocolMsgLenSize = 2; // Size in byte of encoded BTP total fragmented message length constexpr size_t kTransferProtocolMaxHeaderSize = kTransferProtocolHeaderFlagsSize + kTransferProtocolAckSize + kTransferProtocolSequenceNumSize + kTransferProtocolMsgLenSize; diff --git a/src/controller/CHIPDeviceController.h b/src/controller/CHIPDeviceController.h index b328ef68d9a47c..6d61ee8fb636d7 100644 --- a/src/controller/CHIPDeviceController.h +++ b/src/controller/CHIPDeviceController.h @@ -81,7 +81,7 @@ namespace Controller { using namespace chip::Protocols::UserDirectedCommissioning; -constexpr uint16_t kNumMaxActiveDevices = CHIP_CONFIG_CONTROLLER_MAX_ACTIVE_DEVICES; +inline constexpr uint16_t kNumMaxActiveDevices = CHIP_CONFIG_CONTROLLER_MAX_ACTIVE_DEVICES; // Raw functions for cluster callbacks void OnBasicFailure(void * context, CHIP_ERROR err); diff --git a/src/controller/CHIPDeviceControllerSystemState.h b/src/controller/CHIPDeviceControllerSystemState.h index 6692fc6ecbc308..5c1731651cd2a1 100644 --- a/src/controller/CHIPDeviceControllerSystemState.h +++ b/src/controller/CHIPDeviceControllerSystemState.h @@ -54,7 +54,7 @@ namespace chip { -constexpr size_t kMaxDeviceTransportBlePendingPackets = 1; +inline constexpr size_t kMaxDeviceTransportBlePendingPackets = 1; using DeviceTransportMgr = TransportMgr networkCommissioningStatus; }; -constexpr uint16_t kDefaultFailsafeTimeout = 60; +inline constexpr uint16_t kDefaultFailsafeTimeout = 60; // Per spec, all commands that are sent with the failsafe armed need at least // a 30s timeout. -constexpr System::Clock::Timeout kMinimumCommissioningStepTimeout = System::Clock::Seconds16(30); +inline constexpr System::Clock::Timeout kMinimumCommissioningStepTimeout = System::Clock::Seconds16(30); class CommissioningParameters { diff --git a/src/controller/OperationalCredentialsDelegate.h b/src/controller/OperationalCredentialsDelegate.h index 5d51f820bf7ef7..1a7a8c45b64696 100644 --- a/src/controller/OperationalCredentialsDelegate.h +++ b/src/controller/OperationalCredentialsDelegate.h @@ -33,8 +33,8 @@ typedef void (*OnNOCChainGeneration)(void * context, CHIP_ERROR status, const By const ByteSpan & rcac, Optional ipk, Optional adminSubject); -constexpr uint32_t kMaxCHIPDERCertLength = 600; -constexpr size_t kCSRNonceLength = 32; +inline constexpr uint32_t kMaxCHIPDERCertLength = 600; +inline constexpr size_t kCSRNonceLength = 32; /// Callbacks for CHIP operational credentials generation class DLL_EXPORT OperationalCredentialsDelegate diff --git a/src/credentials/DeviceAttestationConstructor.h b/src/credentials/DeviceAttestationConstructor.h index b8404ef57577cc..7880199a6bb94d 100644 --- a/src/credentials/DeviceAttestationConstructor.h +++ b/src/credentials/DeviceAttestationConstructor.h @@ -24,10 +24,10 @@ namespace chip { namespace Credentials { // As per specifications section 11.22.5.1. Constant RESP_MAX -constexpr size_t kMaxRspLen = 900; +inline constexpr size_t kMaxRspLen = 900; // CSRNonce and AttestationNonce need to be this size -constexpr size_t kExpectedAttestationNonceSize = 32; +inline constexpr size_t kExpectedAttestationNonceSize = 32; /** * @brief Take the attestation elements buffer and return each component separately. diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index 9e276b9eea4359..5b661f189f2964 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -42,78 +42,78 @@ namespace chip { namespace Crypto { -constexpr size_t kMax_x509_Certificate_Length = 600; - -constexpr size_t kP256_FE_Length = 32; -constexpr size_t kP256_ECDSA_Signature_Length_Raw = (2 * kP256_FE_Length); -constexpr size_t kP256_Point_Length = (2 * kP256_FE_Length + 1); -constexpr size_t kSHA256_Hash_Length = 32; -constexpr size_t kSHA1_Hash_Length = 20; -constexpr size_t kSubjectKeyIdentifierLength = kSHA1_Hash_Length; -constexpr size_t kAuthorityKeyIdentifierLength = kSHA1_Hash_Length; -constexpr size_t kMaxCertificateSerialNumberLength = 20; -constexpr size_t kMaxCertificateDistinguishedNameLength = 200; -constexpr size_t kMaxCRLDistributionPointURLLength = 100; - -constexpr const char * kValidCDPURIHttpPrefix = "http://"; -constexpr const char * kValidCDPURIHttpsPrefix = "https://"; - -constexpr size_t CHIP_CRYPTO_GROUP_SIZE_BYTES = kP256_FE_Length; -constexpr size_t CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES = kP256_Point_Length; - -constexpr size_t CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES = 16; -constexpr size_t CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES = 16; - -constexpr size_t kMax_ECDH_Secret_Length = kP256_FE_Length; -constexpr size_t kMax_ECDSA_Signature_Length = kP256_ECDSA_Signature_Length_Raw; -constexpr size_t kMAX_FE_Length = kP256_FE_Length; -constexpr size_t kMAX_Point_Length = kP256_Point_Length; -constexpr size_t kMAX_Hash_Length = kSHA256_Hash_Length; +inline constexpr size_t kMax_x509_Certificate_Length = 600; + +inline constexpr size_t kP256_FE_Length = 32; +inline constexpr size_t kP256_ECDSA_Signature_Length_Raw = (2 * kP256_FE_Length); +inline constexpr size_t kP256_Point_Length = (2 * kP256_FE_Length + 1); +inline constexpr size_t kSHA256_Hash_Length = 32; +inline constexpr size_t kSHA1_Hash_Length = 20; +inline constexpr size_t kSubjectKeyIdentifierLength = kSHA1_Hash_Length; +inline constexpr size_t kAuthorityKeyIdentifierLength = kSHA1_Hash_Length; +inline constexpr size_t kMaxCertificateSerialNumberLength = 20; +inline constexpr size_t kMaxCertificateDistinguishedNameLength = 200; +inline constexpr size_t kMaxCRLDistributionPointURLLength = 100; + +inline constexpr const char * kValidCDPURIHttpPrefix = "http://"; +inline constexpr const char * kValidCDPURIHttpsPrefix = "https://"; + +inline constexpr size_t CHIP_CRYPTO_GROUP_SIZE_BYTES = kP256_FE_Length; +inline constexpr size_t CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES = kP256_Point_Length; + +inline constexpr size_t CHIP_CRYPTO_AEAD_MIC_LENGTH_BYTES = 16; +inline constexpr size_t CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES = 16; + +inline constexpr size_t kMax_ECDH_Secret_Length = kP256_FE_Length; +inline constexpr size_t kMax_ECDSA_Signature_Length = kP256_ECDSA_Signature_Length_Raw; +inline constexpr size_t kMAX_FE_Length = kP256_FE_Length; +inline constexpr size_t kMAX_Point_Length = kP256_Point_Length; +inline constexpr size_t kMAX_Hash_Length = kSHA256_Hash_Length; // Minimum required CSR length buffer length is relatively small since it's a single // P256 key and no metadata/extensions are expected to be honored by the CA. -constexpr size_t kMIN_CSR_Buffer_Size = 255; +inline constexpr size_t kMIN_CSR_Buffer_Size = 255; [[deprecated("This constant is no longer used by common code and should be replaced by kMIN_CSR_Buffer_Size. Checks that a CSR is " "<= kMAX_CSR_Buffer_size must be updated. This remains to keep valid buffers working from previous public API " "usage.")]] constexpr size_t kMAX_CSR_Buffer_Size = 255; -constexpr size_t CHIP_CRYPTO_HASH_LEN_BYTES = kSHA256_Hash_Length; +inline constexpr size_t CHIP_CRYPTO_HASH_LEN_BYTES = kSHA256_Hash_Length; -constexpr size_t kSpake2p_Min_PBKDF_Salt_Length = 16; -constexpr size_t kSpake2p_Max_PBKDF_Salt_Length = 32; -constexpr uint32_t kSpake2p_Min_PBKDF_Iterations = 1000; -constexpr uint32_t kSpake2p_Max_PBKDF_Iterations = 100000; +inline constexpr size_t kSpake2p_Min_PBKDF_Salt_Length = 16; +inline constexpr size_t kSpake2p_Max_PBKDF_Salt_Length = 32; +inline constexpr uint32_t kSpake2p_Min_PBKDF_Iterations = 1000; +inline constexpr uint32_t kSpake2p_Max_PBKDF_Iterations = 100000; -constexpr size_t kP256_PrivateKey_Length = CHIP_CRYPTO_GROUP_SIZE_BYTES; -constexpr size_t kP256_PublicKey_Length = CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES; +inline constexpr size_t kP256_PrivateKey_Length = CHIP_CRYPTO_GROUP_SIZE_BYTES; +inline constexpr size_t kP256_PublicKey_Length = CHIP_CRYPTO_PUBLIC_KEY_SIZE_BYTES; -constexpr size_t kAES_CCM128_Key_Length = 128u / 8u; -constexpr size_t kAES_CCM128_Block_Length = kAES_CCM128_Key_Length; -constexpr size_t kAES_CCM128_Nonce_Length = 13; -constexpr size_t kAES_CCM128_Tag_Length = 16; +inline constexpr size_t kAES_CCM128_Key_Length = 128u / 8u; +inline constexpr size_t kAES_CCM128_Block_Length = kAES_CCM128_Key_Length; +inline constexpr size_t kAES_CCM128_Nonce_Length = 13; +inline constexpr size_t kAES_CCM128_Tag_Length = 16; -constexpr size_t CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES = kAES_CCM128_Nonce_Length; +inline constexpr size_t CHIP_CRYPTO_AEAD_NONCE_LENGTH_BYTES = kAES_CCM128_Nonce_Length; /* These sizes are hardcoded here to remove header dependency on underlying crypto library * in a public interface file. The validity of these sizes is verified by static_assert in * the implementation files. */ -constexpr size_t kMAX_Spake2p_Context_Size = 1024; -constexpr size_t kMAX_P256Keypair_Context_Size = 512; +inline constexpr size_t kMAX_Spake2p_Context_Size = 1024; +inline constexpr size_t kMAX_P256Keypair_Context_Size = 512; -constexpr size_t kEmitDerIntegerWithoutTagOverhead = 1; // 1 sign stuffer -constexpr size_t kEmitDerIntegerOverhead = 3; // Tag + Length byte + 1 sign stuffer +inline constexpr size_t kEmitDerIntegerWithoutTagOverhead = 1; // 1 sign stuffer +inline constexpr size_t kEmitDerIntegerOverhead = 3; // Tag + Length byte + 1 sign stuffer -constexpr size_t kMAX_Hash_SHA256_Context_Size = CHIP_CONFIG_SHA256_CONTEXT_SIZE; +inline constexpr size_t kMAX_Hash_SHA256_Context_Size = CHIP_CONFIG_SHA256_CONTEXT_SIZE; -constexpr size_t kSpake2p_WS_Length = kP256_FE_Length + 8; -constexpr size_t kSpake2p_VerifierSerialized_Length = kP256_FE_Length + kP256_Point_Length; +inline constexpr size_t kSpake2p_WS_Length = kP256_FE_Length + 8; +inline constexpr size_t kSpake2p_VerifierSerialized_Length = kP256_FE_Length + kP256_Point_Length; -constexpr char kVIDPrefixForCNEncoding[] = "Mvid:"; -constexpr char kPIDPrefixForCNEncoding[] = "Mpid:"; -constexpr size_t kVIDandPIDHexLength = sizeof(uint16_t) * 2; -constexpr size_t kMax_CommonNameAttr_Length = 64; +inline constexpr char kVIDPrefixForCNEncoding[] = "Mvid:"; +inline constexpr char kPIDPrefixForCNEncoding[] = "Mpid:"; +inline constexpr size_t kVIDandPIDHexLength = sizeof(uint16_t) * 2; +inline constexpr size_t kMax_CommonNameAttr_Length = 64; /* * Overhead to encode a raw ECDSA signature in X9.62 format in ASN.1 DER @@ -131,14 +131,14 @@ constexpr size_t kMax_CommonNameAttr_Length = 64; * * There is 1 sequence of 2 integers. Overhead is SEQ_OVERHEAD + (2 * INT_OVERHEAD) = 3 + (2 * 3) = 9. */ -constexpr size_t kMax_ECDSA_X9Dot62_Asn1_Overhead = 9; -constexpr size_t kMax_ECDSA_Signature_Length_Der = kMax_ECDSA_Signature_Length + kMax_ECDSA_X9Dot62_Asn1_Overhead; +inline constexpr size_t kMax_ECDSA_X9Dot62_Asn1_Overhead = 9; +inline constexpr size_t kMax_ECDSA_Signature_Length_Der = kMax_ECDSA_Signature_Length + kMax_ECDSA_X9Dot62_Asn1_Overhead; static_assert(kMax_ECDH_Secret_Length >= kP256_FE_Length, "ECDH shared secret is too short for crypto suite"); static_assert(kMax_ECDSA_Signature_Length >= kP256_ECDSA_Signature_Length_Raw, "ECDSA signature buffer length is too short for crypto suite"); -constexpr size_t kCompressedFabricIdentifierSize = 8; +inline constexpr size_t kCompressedFabricIdentifierSize = 8; /** * Spake2+ parameters for P256 diff --git a/src/include/platform/CommissionableDataProvider.h b/src/include/platform/CommissionableDataProvider.h index 6a51023f1aef03..95fa3faf5d99d4 100644 --- a/src/include/platform/CommissionableDataProvider.h +++ b/src/include/platform/CommissionableDataProvider.h @@ -22,10 +22,10 @@ namespace chip { // The largest value of the 12-bit Payload discriminator -constexpr uint16_t kMaxDiscriminatorValue = 0xFFF; +inline constexpr uint16_t kMaxDiscriminatorValue = 0xFFF; -constexpr uint32_t kMinSetupPasscode = 1; -constexpr uint32_t kMaxSetupPasscode = 0x5F5E0FE; +inline constexpr uint32_t kMinSetupPasscode = 1; +inline constexpr uint32_t kMaxSetupPasscode = 0x5F5E0FE; namespace DeviceLayer { diff --git a/src/include/platform/DiagnosticDataProvider.h b/src/include/platform/DiagnosticDataProvider.h index 04820d3488debb..12eacf0a6d2b60 100644 --- a/src/include/platform/DiagnosticDataProvider.h +++ b/src/include/platform/DiagnosticDataProvider.h @@ -36,12 +36,12 @@ namespace DeviceLayer { static constexpr size_t kMaxThreadNameLength = 8; // 48-bit IEEE MAC Address or a 64-bit IEEE MAC Address (e.g. EUI-64). -constexpr size_t kMaxHardwareAddrSize = 8; +inline constexpr size_t kMaxHardwareAddrSize = 8; -constexpr size_t kMaxIPv4AddrSize = 4; -constexpr size_t kMaxIPv6AddrSize = 16; -constexpr size_t kMaxIPv4AddrCount = 4; -constexpr size_t kMaxIPv6AddrCount = 8; +inline constexpr size_t kMaxIPv4AddrSize = 4; +inline constexpr size_t kMaxIPv6AddrSize = 16; +inline constexpr size_t kMaxIPv4AddrCount = 4; +inline constexpr size_t kMaxIPv6AddrCount = 8; using BootReasonType = app::Clusters::GeneralDiagnostics::BootReasonEnum; diff --git a/src/include/platform/NetworkCommissioning.h b/src/include/platform/NetworkCommissioning.h index 7a9cbc3c6db8c0..8ae56f3cd80d0b 100644 --- a/src/include/platform/NetworkCommissioning.h +++ b/src/include/platform/NetworkCommissioning.h @@ -47,7 +47,7 @@ namespace DeviceLayer { */ namespace NetworkCommissioning { -constexpr size_t kMaxNetworkIDLen = 32; +inline constexpr size_t kMaxNetworkIDLen = 32; // TODO: This is exactly the same as the one in GroupDataProvider, this could be moved to src/lib/support template diff --git a/src/include/platform/PersistedStorage.h b/src/include/platform/PersistedStorage.h index 91a8eae88981e8..f6bebd2e32050c 100644 --- a/src/include/platform/PersistedStorage.h +++ b/src/include/platform/PersistedStorage.h @@ -57,7 +57,7 @@ struct EmptyKey } // namespace internal -constexpr Key kEmptyKey = internal::EmptyKey::value; +inline constexpr Key kEmptyKey = internal::EmptyKey::value; /** * @brief diff --git a/src/include/platform/internal/DeviceNetworkInfo.h b/src/include/platform/internal/DeviceNetworkInfo.h index 7e218914066e76..62c8d72a75858d 100644 --- a/src/include/platform/internal/DeviceNetworkInfo.h +++ b/src/include/platform/internal/DeviceNetworkInfo.h @@ -30,9 +30,9 @@ namespace Internal { * Constants for common network metadata entries */ // ---- WiFi-specific Limits ---- -constexpr size_t kMaxWiFiSSIDLength = 32; -constexpr size_t kMaxWiFiKeyLength = 64; -constexpr size_t kWiFiBSSIDLength = 6; +inline constexpr size_t kMaxWiFiSSIDLength = 32; +inline constexpr size_t kMaxWiFiKeyLength = 64; +inline constexpr size_t kWiFiBSSIDLength = 6; /** * Ids for well-known network provision types. diff --git a/src/lib/address_resolve/AddressResolve_DefaultImpl.h b/src/lib/address_resolve/AddressResolve_DefaultImpl.h index ac6d7dd8d1f4d0..5445b6d1b89995 100644 --- a/src/lib/address_resolve/AddressResolve_DefaultImpl.h +++ b/src/lib/address_resolve/AddressResolve_DefaultImpl.h @@ -26,7 +26,7 @@ namespace chip { namespace AddressResolve { namespace Impl { -constexpr uint8_t kNodeLookupResultsLen = CHIP_CONFIG_MDNS_RESOLVE_LOOKUP_RESULTS; +inline constexpr uint8_t kNodeLookupResultsLen = CHIP_CONFIG_MDNS_RESOLVE_LOOKUP_RESULTS; enum class NodeLookupResult { diff --git a/src/lib/core/DataModelTypes.h b/src/lib/core/DataModelTypes.h index 5ae16fa51f6544..dfbc5ef16ad400 100644 --- a/src/lib/core/DataModelTypes.h +++ b/src/lib/core/DataModelTypes.h @@ -49,21 +49,21 @@ typedef uint8_t InteractionModelRevision; typedef uint32_t SubscriptionId; typedef uint8_t SceneId; -constexpr CompressedFabricId kUndefinedCompressedFabricId = 0ULL; -constexpr FabricId kUndefinedFabricId = 0ULL; +inline constexpr CompressedFabricId kUndefinedCompressedFabricId = 0ULL; +inline constexpr FabricId kUndefinedFabricId = 0ULL; -constexpr FabricIndex kUndefinedFabricIndex = 0; -constexpr FabricIndex kMinValidFabricIndex = 1; -constexpr FabricIndex kMaxValidFabricIndex = UINT8_MAX - 1; +inline constexpr FabricIndex kUndefinedFabricIndex = 0; +inline constexpr FabricIndex kMinValidFabricIndex = 1; +inline constexpr FabricIndex kMaxValidFabricIndex = UINT8_MAX - 1; -constexpr EndpointId kInvalidEndpointId = 0xFFFF; -constexpr EndpointId kRootEndpointId = 0; -constexpr ListIndex kInvalidListIndex = 0xFFFF; // List index is a uint16 thus 0xFFFF is a invalid list index. -constexpr KeysetId kInvalidKeysetId = 0xFFFF; +inline constexpr EndpointId kInvalidEndpointId = 0xFFFF; +inline constexpr EndpointId kRootEndpointId = 0; +inline constexpr ListIndex kInvalidListIndex = 0xFFFF; // List index is a uint16 thus 0xFFFF is a invalid list index. +inline constexpr KeysetId kInvalidKeysetId = 0xFFFF; // Invalid IC identifier is provisional. Value will most likely change when identifying token is defined // https://github.com/project-chip/connectedhomeip/issues/24251 -constexpr uint64_t kInvalidIcId = 0; +inline constexpr uint64_t kInvalidIcId = 0; // These are MEIs, 0xFFFF is not a valid manufacturer code, // thus 0xFFFF'FFFF is not a valid MEI. diff --git a/src/lib/core/GroupId.h b/src/lib/core/GroupId.h index c1168b1cd71f3a..598a02d6a512a8 100644 --- a/src/lib/core/GroupId.h +++ b/src/lib/core/GroupId.h @@ -23,20 +23,20 @@ namespace chip { using GroupId = uint16_t; -constexpr GroupId kUndefinedGroupId = 0; +inline constexpr GroupId kUndefinedGroupId = 0; -constexpr GroupId kMinUniversalGroupId = 0xFF00; -constexpr GroupId kMaxUniversalGroupId = 0xFFFF; +inline constexpr GroupId kMinUniversalGroupId = 0xFF00; +inline constexpr GroupId kMaxUniversalGroupId = 0xFFFF; -constexpr GroupId kMinApplicationGroupId = 0x0001; -constexpr GroupId kMaxApplicationGroupId = 0xFEFF; +inline constexpr GroupId kMinApplicationGroupId = 0x0001; +inline constexpr GroupId kMaxApplicationGroupId = 0xFEFF; -constexpr GroupId kAllNodes = 0xFFFF; -constexpr GroupId kAllNonSleepy = 0xFFFE; -constexpr GroupId kAllProxies = 0xFFFD; +inline constexpr GroupId kAllNodes = 0xFFFF; +inline constexpr GroupId kAllNonSleepy = 0xFFFE; +inline constexpr GroupId kAllProxies = 0xFFFD; -constexpr GroupId kMinUniversalGroupIdReserved = 0xFF00; -constexpr GroupId kMaxUniversalGroupIdReserved = 0xFFFC; +inline constexpr GroupId kMinUniversalGroupIdReserved = 0xFF00; +inline constexpr GroupId kMaxUniversalGroupIdReserved = 0xFFFC; constexpr bool IsOperationalGroupId(GroupId aGroupId) { diff --git a/src/lib/core/InPlace.h b/src/lib/core/InPlace.h index 6ac2cb0c9b2c62..14ce5773101412 100644 --- a/src/lib/core/InPlace.h +++ b/src/lib/core/InPlace.h @@ -31,7 +31,7 @@ struct InPlaceType { explicit InPlaceType() = default; }; -constexpr InPlaceType InPlace{}; +inline constexpr InPlaceType InPlace{}; template struct InPlaceTemplateType @@ -39,6 +39,6 @@ struct InPlaceTemplateType explicit InPlaceTemplateType() = default; }; template -constexpr InPlaceTemplateType InPlaceTemplate{}; +inline constexpr InPlaceTemplateType InPlaceTemplate{}; } // namespace chip diff --git a/src/lib/core/NodeId.h b/src/lib/core/NodeId.h index a16868ccb900ba..7b518f09f0cc28 100644 --- a/src/lib/core/NodeId.h +++ b/src/lib/core/NodeId.h @@ -28,35 +28,35 @@ namespace chip { // methods. using NodeId = uint64_t; -constexpr NodeId kUndefinedNodeId = 0ULL; +inline constexpr NodeId kUndefinedNodeId = 0ULL; // The range of possible NodeId values has some pieces carved out for special // uses. -constexpr NodeId kMinGroupNodeId = 0xFFFF'FFFF'FFFF'0000ULL; +inline constexpr NodeId kMinGroupNodeId = 0xFFFF'FFFF'FFFF'0000ULL; // The max group id is complicated, depending on how we want to count the // various special group ids. Let's not define it for now, until we have use // cases. -constexpr NodeId kMaskGroupId = 0x0000'0000'0000'FFFFULL; +inline constexpr NodeId kMaskGroupId = 0x0000'0000'0000'FFFFULL; -constexpr NodeId kMinTemporaryLocalId = 0xFFFF'FFFE'0000'0000ULL; +inline constexpr NodeId kMinTemporaryLocalId = 0xFFFF'FFFE'0000'0000ULL; // We use the largest available temporary local id to represent // kPlaceholderNodeId, so the range is narrowed compared to the spec. -constexpr NodeId kMaxTemporaryLocalId = 0xFFFF'FFFE'FFFF'FFFEULL; -constexpr NodeId kPlaceholderNodeId = 0xFFFF'FFFE'FFFF'FFFFULL; +inline constexpr NodeId kMaxTemporaryLocalId = 0xFFFF'FFFE'FFFF'FFFEULL; +inline constexpr NodeId kPlaceholderNodeId = 0xFFFF'FFFE'FFFF'FFFFULL; -constexpr NodeId kMinCASEAuthTag = 0xFFFF'FFFD'0000'0000ULL; -constexpr NodeId kMaxCASEAuthTag = 0xFFFF'FFFD'FFFF'FFFFULL; -constexpr NodeId kMaskCASEAuthTag = 0x0000'0000'FFFF'FFFFULL; +inline constexpr NodeId kMinCASEAuthTag = 0xFFFF'FFFD'0000'0000ULL; +inline constexpr NodeId kMaxCASEAuthTag = 0xFFFF'FFFD'FFFF'FFFFULL; +inline constexpr NodeId kMaskCASEAuthTag = 0x0000'0000'FFFF'FFFFULL; -constexpr NodeId kMinPAKEKeyId = 0xFFFF'FFFB'0000'0000ULL; -constexpr NodeId kMaxPAKEKeyId = 0xFFFF'FFFB'FFFF'FFFFULL; -constexpr NodeId kMaskPAKEKeyId = 0x0000'0000'0000'FFFFULL; -constexpr NodeId kMaskUnusedPAKEKeyId = 0x0000'0000'FFFF'0000ULL; +inline constexpr NodeId kMinPAKEKeyId = 0xFFFF'FFFB'0000'0000ULL; +inline constexpr NodeId kMaxPAKEKeyId = 0xFFFF'FFFB'FFFF'FFFFULL; +inline constexpr NodeId kMaskPAKEKeyId = 0x0000'0000'0000'FFFFULL; +inline constexpr NodeId kMaskUnusedPAKEKeyId = 0x0000'0000'FFFF'0000ULL; // There are more reserved ranges here, not assigned to anything yet, going down // all the way to 0xFFFF'FFF0'0000'0000ULL -constexpr NodeId kMaxOperationalNodeId = 0xFFFF'FFEF'FFFF'FFFFULL; +inline constexpr NodeId kMaxOperationalNodeId = 0xFFFF'FFEF'FFFF'FFFFULL; constexpr bool IsOperationalNodeId(NodeId aNodeId) { diff --git a/src/lib/core/OTAImageHeader.h b/src/lib/core/OTAImageHeader.h index 4d3eea420432c6..f9fa8868530fd8 100644 --- a/src/lib/core/OTAImageHeader.h +++ b/src/lib/core/OTAImageHeader.h @@ -26,7 +26,7 @@ namespace chip { /// File signature (aka magic number) of a valid Matter OTA image -constexpr uint32_t kOTAImageFileIdentifier = 0x1BEEF11E; +inline constexpr uint32_t kOTAImageFileIdentifier = 0x1BEEF11E; enum class OTAImageDigestType : uint8_t { diff --git a/src/lib/core/Optional.h b/src/lib/core/Optional.h index 4edae30093c038..3b673e36fa7071 100644 --- a/src/lib/core/Optional.h +++ b/src/lib/core/Optional.h @@ -35,7 +35,7 @@ struct NullOptionalType { explicit NullOptionalType() = default; }; -constexpr NullOptionalType NullOptional{}; +inline constexpr NullOptionalType NullOptional{}; /** * Pairs an object with a boolean value to determine if the object value diff --git a/src/lib/core/PasscodeId.h b/src/lib/core/PasscodeId.h index f49aa19ea26b0e..e1322978f249e0 100644 --- a/src/lib/core/PasscodeId.h +++ b/src/lib/core/PasscodeId.h @@ -25,6 +25,6 @@ namespace chip { // methods. using PasscodeId = uint16_t; -constexpr PasscodeId kDefaultCommissioningPasscodeId = 0; +inline constexpr PasscodeId kDefaultCommissioningPasscodeId = 0; } // namespace chip diff --git a/src/lib/dnssd/Constants.h b/src/lib/dnssd/Constants.h index d1805058b1e8ba..f34bdfa3da52b8 100644 --- a/src/lib/dnssd/Constants.h +++ b/src/lib/dnssd/Constants.h @@ -29,18 +29,18 @@ namespace Dnssd { * Matter DNS host settings */ -constexpr size_t kHostNameMaxLength = 16; // MAC or 802.15.4 Extended Address in hex +inline constexpr size_t kHostNameMaxLength = 16; // MAC or 802.15.4 Extended Address in hex /* * Matter DNS service subtypes */ -constexpr size_t kSubTypeShortDiscriminatorMaxLength = 4; // _S

-constexpr size_t kSubTypeLongDiscriminatorMaxLength = 6; // _L -constexpr size_t kSubTypeVendorIdMaxLength = 7; // _V -constexpr size_t kSubTypeDeviceTypeMaxLength = 12; // _T -constexpr size_t kSubTypeCommissioningModeMaxLength = 3; // _CM -constexpr size_t kSubTypeCompressedFabricIdMaxLength = 18; // _I<16-hex-digits> +inline constexpr size_t kSubTypeShortDiscriminatorMaxLength = 4; // _S
+inline constexpr size_t kSubTypeLongDiscriminatorMaxLength = 6; // _L +inline constexpr size_t kSubTypeVendorIdMaxLength = 7; // _V +inline constexpr size_t kSubTypeDeviceTypeMaxLength = 12; // _T +inline constexpr size_t kSubTypeCommissioningModeMaxLength = 3; // _CM +inline constexpr size_t kSubTypeCompressedFabricIdMaxLength = 18; // _I<16-hex-digits> /* * Matter operational node service settings @@ -50,10 +50,10 @@ namespace Operational { #define SUBTYPES (std::initializer_list{ kSubTypeCompressedFabricIdMaxLength }) -constexpr size_t kInstanceNameMaxLength = 33; // - in hex (16 + 1 + 16) -constexpr size_t kSubTypeMaxNumber = SUBTYPES.size(); -constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES); -constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES); +inline constexpr size_t kInstanceNameMaxLength = 33; // - in hex (16 + 1 + 16) +inline constexpr size_t kSubTypeMaxNumber = SUBTYPES.size(); +inline constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES); +inline constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES); #undef SUBTYPES @@ -69,10 +69,10 @@ namespace Commission { (std::initializer_list{ kSubTypeShortDiscriminatorMaxLength, kSubTypeLongDiscriminatorMaxLength, \ kSubTypeVendorIdMaxLength, kSubTypeDeviceTypeMaxLength, kSubTypeCommissioningModeMaxLength }) -constexpr size_t kInstanceNameMaxLength = 16; // 64-bit random number in hex -constexpr size_t kSubTypeMaxNumber = SUBTYPES.size(); -constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES); -constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES); +inline constexpr size_t kInstanceNameMaxLength = 16; // 64-bit random number in hex +inline constexpr size_t kSubTypeMaxNumber = SUBTYPES.size(); +inline constexpr size_t kSubTypeMaxLength = std::max(SUBTYPES); +inline constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES); #undef SUBTYPES @@ -84,10 +84,10 @@ constexpr size_t kSubTypeTotalLength = chip::Sum(SUBTYPES); namespace Common { -constexpr size_t kInstanceNameMaxLength = std::max(Operational::kInstanceNameMaxLength, Commission::kInstanceNameMaxLength); -constexpr size_t kSubTypeMaxNumber = std::max(Operational::kSubTypeMaxNumber, Commission::kSubTypeMaxNumber); -constexpr size_t kSubTypeMaxLength = std::max(Operational::kSubTypeMaxLength, Commission::kSubTypeMaxLength); -constexpr size_t kSubTypeTotalLength = std::max(Operational::kSubTypeTotalLength, Commission::kSubTypeTotalLength); +inline constexpr size_t kInstanceNameMaxLength = std::max(Operational::kInstanceNameMaxLength, Commission::kInstanceNameMaxLength); +inline constexpr size_t kSubTypeMaxNumber = std::max(Operational::kSubTypeMaxNumber, Commission::kSubTypeMaxNumber); +inline constexpr size_t kSubTypeMaxLength = std::max(Operational::kSubTypeMaxLength, Commission::kSubTypeMaxLength); +inline constexpr size_t kSubTypeTotalLength = std::max(Operational::kSubTypeTotalLength, Commission::kSubTypeTotalLength); } // namespace Common diff --git a/src/lib/dnssd/Resolver.h b/src/lib/dnssd/Resolver.h index a9039352c64b36..81c8e975480347 100644 --- a/src/lib/dnssd/Resolver.h +++ b/src/lib/dnssd/Resolver.h @@ -139,9 +139,9 @@ struct OperationalNodeData void Reset() { peerId = PeerId(); } }; -constexpr size_t kMaxDeviceNameLen = 32; -constexpr size_t kMaxRotatingIdLen = 50; -constexpr size_t kMaxPairingInstructionLen = 128; +inline constexpr size_t kMaxDeviceNameLen = 32; +inline constexpr size_t kMaxRotatingIdLen = 50; +inline constexpr size_t kMaxPairingInstructionLen = 128; /// Data that is specific to commisionable/commissioning node discovery struct CommissionNodeData diff --git a/src/lib/dnssd/ServiceNaming.h b/src/lib/dnssd/ServiceNaming.h index 10e5abba465774..5f4c2e6c2ea948 100644 --- a/src/lib/dnssd/ServiceNaming.h +++ b/src/lib/dnssd/ServiceNaming.h @@ -28,13 +28,13 @@ namespace chip { namespace Dnssd { -constexpr char kSubtypeServiceNamePart[] = "_sub"; -constexpr char kCommissionableServiceName[] = "_matterc"; -constexpr char kOperationalServiceName[] = "_matter"; -constexpr char kCommissionerServiceName[] = "_matterd"; -constexpr char kOperationalProtocol[] = "_tcp"; -constexpr char kCommissionProtocol[] = "_udp"; -constexpr char kLocalDomain[] = "local"; +inline constexpr char kSubtypeServiceNamePart[] = "_sub"; +inline constexpr char kCommissionableServiceName[] = "_matterc"; +inline constexpr char kOperationalServiceName[] = "_matter"; +inline constexpr char kCommissionerServiceName[] = "_matterd"; +inline constexpr char kOperationalProtocol[] = "_tcp"; +inline constexpr char kCommissionProtocol[] = "_udp"; +inline constexpr char kLocalDomain[] = "local"; // each includes space for a null terminator, which becomes a . when the names are appended. constexpr size_t kMaxCommissionableServiceNameSize = diff --git a/src/lib/dnssd/minimal_mdns/core/Constants.h b/src/lib/dnssd/minimal_mdns/core/Constants.h index 30f2d4b0ddd0b9..bf2a309143cd7c 100644 --- a/src/lib/dnssd/minimal_mdns/core/Constants.h +++ b/src/lib/dnssd/minimal_mdns/core/Constants.h @@ -44,10 +44,10 @@ enum class QType : uint16_t }; /// Flag encoded in QCLASS requesting unicast answers -constexpr uint16_t kQClassUnicastAnswerFlag = 0x8000; +inline constexpr uint16_t kQClassUnicastAnswerFlag = 0x8000; // Flag used to indicate receiver should flush cache rather than appending. Used for Response RR's. // See https://datatracker.ietf.org/doc/html/rfc6762#section-10.2. -constexpr uint16_t kQClassResponseFlushBit = 0x8000; +inline constexpr uint16_t kQClassResponseFlushBit = 0x8000; enum class QClass : uint16_t { diff --git a/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h b/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h index e82dc5ee6c3492..f7b34f10591e9d 100644 --- a/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h +++ b/src/lib/dnssd/minimal_mdns/tests/CheckOnlyServer.h @@ -38,7 +38,7 @@ namespace mdns { namespace Minimal { namespace test { -constexpr QNamePart kIgnoreQNameParts[] = { "IGNORE", "THIS" }; +inline constexpr QNamePart kIgnoreQNameParts[] = { "IGNORE", "THIS" }; namespace { bool StringMatches(const BytesRange & br, const char * str) { diff --git a/src/lib/support/CommonPersistentData.h b/src/lib/support/CommonPersistentData.h index df0acff14616e4..64056a69dbe290 100644 --- a/src/lib/support/CommonPersistentData.h +++ b/src/lib/support/CommonPersistentData.h @@ -27,7 +27,7 @@ namespace chip { namespace CommonPersistentData { -constexpr uint8_t kdefaultUndefinedEntry = 0; +inline constexpr uint8_t kdefaultUndefinedEntry = 0; /// @brief Generic class to implement storage of a list persistently /// @tparam EntryType : Type of entry depends on the stored data @@ -74,7 +74,7 @@ struct StoredDataList : public PersistentData } }; -constexpr size_t kPersistentFabricBufferMax = 32; +inline constexpr size_t kPersistentFabricBufferMax = 32; struct FabricList : StoredDataList { // Subclasses need to define UpdateKey to be whatever fabric list key they diff --git a/src/lib/support/PrivateHeap.h b/src/lib/support/PrivateHeap.h index 864497a845a226..33334265d5e080 100644 --- a/src/lib/support/PrivateHeap.h +++ b/src/lib/support/PrivateHeap.h @@ -67,6 +67,6 @@ struct PrivateHeapBlockHeader } // namespace internal -constexpr size_t kPrivateHeapAllocationAlignment = std::alignment_of::value; +inline constexpr size_t kPrivateHeapAllocationAlignment = std::alignment_of::value; #endif // ifdef __cplusplus diff --git a/src/lib/support/ThreadOperationalDataset.h b/src/lib/support/ThreadOperationalDataset.h index 9fbfd1b1b3c547..e4de3ddaa8d2c5 100644 --- a/src/lib/support/ThreadOperationalDataset.h +++ b/src/lib/support/ThreadOperationalDataset.h @@ -29,16 +29,16 @@ namespace Thread { class ThreadTLV; -constexpr size_t kChannel_NotSpecified = UINT8_MAX; -constexpr size_t kPANId_NotSpecified = UINT16_MAX; +inline constexpr size_t kChannel_NotSpecified = UINT8_MAX; +inline constexpr size_t kPANId_NotSpecified = UINT16_MAX; -constexpr size_t kSizeOperationalDataset = 254; +inline constexpr size_t kSizeOperationalDataset = 254; -constexpr size_t kSizeNetworkName = 16; -constexpr size_t kSizeExtendedPanId = 8; -constexpr size_t kSizeMasterKey = 16; -constexpr size_t kSizeMeshLocalPrefix = 8; -constexpr size_t kSizePSKc = 16; +inline constexpr size_t kSizeNetworkName = 16; +inline constexpr size_t kSizeExtendedPanId = 8; +inline constexpr size_t kSizeMasterKey = 16; +inline constexpr size_t kSizeMeshLocalPrefix = 8; +inline constexpr size_t kSizePSKc = 16; /** * This class provides methods to manipulate Thread operational dataset. diff --git a/src/messaging/ReliableMessageProtocolConfig.h b/src/messaging/ReliableMessageProtocolConfig.h index 6a570ba25f93e7..bd0e421933a3a1 100644 --- a/src/messaging/ReliableMessageProtocolConfig.h +++ b/src/messaging/ReliableMessageProtocolConfig.h @@ -167,7 +167,7 @@ namespace chip { #endif #endif // CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST -constexpr System::Clock::Milliseconds32 kDefaultActiveTime = System::Clock::Milliseconds16(4000); +inline constexpr System::Clock::Milliseconds32 kDefaultActiveTime = System::Clock::Milliseconds16(4000); /** * @brief diff --git a/src/messaging/tests/echo/common.h b/src/messaging/tests/echo/common.h index 03d2431d3b7a8a..8158884c5c4321 100644 --- a/src/messaging/tests/echo/common.h +++ b/src/messaging/tests/echo/common.h @@ -31,9 +31,9 @@ #include #include -constexpr size_t kMaxTcpActiveConnectionCount = 4; -constexpr size_t kMaxTcpPendingPackets = 4; -constexpr size_t kNetworkSleepTimeMsecs = (100 * 1000); +inline constexpr size_t kMaxTcpActiveConnectionCount = 4; +inline constexpr size_t kMaxTcpPendingPackets = 4; +inline constexpr size_t kNetworkSleepTimeMsecs = (100 * 1000); extern chip::FabricTable gFabricTable; extern chip::SessionManager gSessionManager; diff --git a/src/platform/ASR/NetworkCommissioningDriver.h b/src/platform/ASR/NetworkCommissioningDriver.h index 954f0c886be2d5..7fc9e0c10b49ad 100644 --- a/src/platform/ASR/NetworkCommissioningDriver.h +++ b/src/platform/ASR/NetworkCommissioningDriver.h @@ -33,10 +33,10 @@ namespace DeviceLayer { namespace NetworkCommissioning { namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; -constexpr uint8_t kWiFiMaxNetworks = 15; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +inline constexpr uint8_t kWiFiMaxNetworks = 15; } // namespace class ASRScanResponseIterator : public Iterator diff --git a/src/platform/Ameba/NetworkCommissioningDriver.h b/src/platform/Ameba/NetworkCommissioningDriver.h index 3942b89627741f..0525ac4910f5ec 100644 --- a/src/platform/Ameba/NetworkCommissioningDriver.h +++ b/src/platform/Ameba/NetworkCommissioningDriver.h @@ -25,9 +25,9 @@ namespace DeviceLayer { namespace NetworkCommissioning { namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; } // namespace class AmebaScanResponseIterator : public Iterator diff --git a/src/platform/Beken/NetworkCommissioningDriver.h b/src/platform/Beken/NetworkCommissioningDriver.h index 5f83d0d928e39d..860a165601c20b 100644 --- a/src/platform/Beken/NetworkCommissioningDriver.h +++ b/src/platform/Beken/NetworkCommissioningDriver.h @@ -26,9 +26,9 @@ namespace DeviceLayer { namespace NetworkCommissioning { namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; } // namespace class BKScanResponseIterator : public Iterator diff --git a/src/platform/ESP32/NetworkCommissioningDriver.h b/src/platform/ESP32/NetworkCommissioningDriver.h index 7a261654d4f71e..5a2ca8f44d61c1 100644 --- a/src/platform/ESP32/NetworkCommissioningDriver.h +++ b/src/platform/ESP32/NetworkCommissioningDriver.h @@ -26,9 +26,9 @@ namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 30; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 30; } // namespace BitFlags ConvertSecurityType(wifi_auth_mode_t authMode); diff --git a/src/platform/Infineon/PSOC6/NetworkCommissioningDriver.h b/src/platform/Infineon/PSOC6/NetworkCommissioningDriver.h index d7f5683d516356..3bd1a02f99a91f 100644 --- a/src/platform/Infineon/PSOC6/NetworkCommissioningDriver.h +++ b/src/platform/Infineon/PSOC6/NetworkCommissioningDriver.h @@ -26,10 +26,10 @@ namespace DeviceLayer { namespace NetworkCommissioning { namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; -constexpr uint8_t kWiFiMaxNetworks = 15; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +inline constexpr uint8_t kWiFiMaxNetworks = 15; } // namespace class P6ScanResponseIterator : public Iterator diff --git a/src/platform/android/DiagnosticDataProviderImpl.h b/src/platform/android/DiagnosticDataProviderImpl.h index 26903d5d3ad3a4..7086b6c1a5a651 100644 --- a/src/platform/android/DiagnosticDataProviderImpl.h +++ b/src/platform/android/DiagnosticDataProviderImpl.h @@ -26,9 +26,9 @@ #include namespace { -constexpr int offPremiseServicesReachableUnknown = 0; -constexpr int offPremiseServicesReachableYes = 1; -constexpr int offPremiseServicesReachableNo = 2; +inline constexpr int offPremiseServicesReachableUnknown = 0; +inline constexpr int offPremiseServicesReachableYes = 1; +inline constexpr int offPremiseServicesReachableNo = 2; } // namespace namespace chip { diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h index 5ae1c9a610ef73..f6ebab8ea5e443 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h @@ -26,9 +26,9 @@ namespace NetworkCommissioning { void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg); namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; } // namespace class BLScanResponseIterator : public Iterator diff --git a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h index 5c9e5637857a14..8e5557b8787438 100644 --- a/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL702/NetworkCommissioningDriver.h @@ -27,9 +27,9 @@ namespace NetworkCommissioning { void NetworkEventHandler(const ChipDeviceEvent * event, intptr_t arg); namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; } // namespace class BLScanResponseIterator : public Iterator diff --git a/src/platform/mbed/NetworkCommissioningDriver.h b/src/platform/mbed/NetworkCommissioningDriver.h index 017f69218267a1..9e61d4640ac4f5 100644 --- a/src/platform/mbed/NetworkCommissioningDriver.h +++ b/src/platform/mbed/NetworkCommissioningDriver.h @@ -29,9 +29,9 @@ namespace NetworkCommissioning { #include namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; } // namespace class MbedScanResponseIterator : public Iterator diff --git a/src/platform/mt793x/NetworkCommissioningWiFiDriver.h b/src/platform/mt793x/NetworkCommissioningWiFiDriver.h index ac810727d92808..85822801c4212a 100644 --- a/src/platform/mt793x/NetworkCommissioningWiFiDriver.h +++ b/src/platform/mt793x/NetworkCommissioningWiFiDriver.h @@ -25,10 +25,10 @@ namespace DeviceLayer { namespace NetworkCommissioning { namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; -constexpr uint8_t kMaxWiFiScanAPs = 30; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +inline constexpr uint8_t kMaxWiFiScanAPs = 30; } // namespace template diff --git a/src/platform/nrfconnect/wifi/NrfWiFiDriver.h b/src/platform/nrfconnect/wifi/NrfWiFiDriver.h index 7b57607b306822..d1fc765a72ac26 100644 --- a/src/platform/nrfconnect/wifi/NrfWiFiDriver.h +++ b/src/platform/nrfconnect/wifi/NrfWiFiDriver.h @@ -25,9 +25,9 @@ namespace chip { namespace DeviceLayer { namespace NetworkCommissioning { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 35; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 35; class NrfWiFiScanResponseIterator : public Iterator { diff --git a/src/platform/nxp/k32w/common/OTATlvProcessor.h b/src/platform/nxp/k32w/common/OTATlvProcessor.h index 400e23e8f9a4e1..534da067148da8 100644 --- a/src/platform/nxp/k32w/common/OTATlvProcessor.h +++ b/src/platform/nxp/k32w/common/OTATlvProcessor.h @@ -42,10 +42,10 @@ namespace chip { #define CHIP_OTA_PROCESSOR_START_IMAGE CHIP_ERROR_TLV_PROCESSOR(0x0D) // Descriptor constants -constexpr size_t kVersionStringSize = 64; -constexpr size_t kBuildDateSize = 64; +inline constexpr size_t kVersionStringSize = 64; +inline constexpr size_t kBuildDateSize = 64; -constexpr uint16_t requestedOtaMaxBlockSize = 1024; +inline constexpr uint16_t requestedOtaMaxBlockSize = 1024; /** * Used alongside RegisterDescriptorCallback to register diff --git a/src/platform/openiotsdk/KVPsaPsStore.h b/src/platform/openiotsdk/KVPsaPsStore.h index 7e68bdbd32491b..acd3f695765650 100644 --- a/src/platform/openiotsdk/KVPsaPsStore.h +++ b/src/platform/openiotsdk/KVPsaPsStore.h @@ -44,7 +44,7 @@ using namespace chip::Platform::PersistedStorage; // '01' = Matter region // '02' = the sub region group base offset (Factory, Config, Counter or KVS) // '14' = the id offset inside the group. -constexpr Key kMatterPsaPaKeyRegion = 0x010000U; +inline constexpr Key kMatterPsaPaKeyRegion = 0x010000U; constexpr inline Key GetPsaPaKey(Key group, uint8_t id) { return kMatterPsaPaKeyRegion | (group) << 8 | id; diff --git a/src/platform/silabs/NetworkCommissioningWiFiDriver.h b/src/platform/silabs/NetworkCommissioningWiFiDriver.h index fd73568a6ba98b..55148e3700091d 100644 --- a/src/platform/silabs/NetworkCommissioningWiFiDriver.h +++ b/src/platform/silabs/NetworkCommissioningWiFiDriver.h @@ -25,9 +25,9 @@ namespace DeviceLayer { namespace NetworkCommissioning { namespace { -constexpr uint8_t kMaxWiFiNetworks = 1; -constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; -constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; +inline constexpr uint8_t kMaxWiFiNetworks = 1; +inline constexpr uint8_t kWiFiScanNetworksTimeOutSeconds = 10; +inline constexpr uint8_t kWiFiConnectNetworkTimeoutSeconds = 20; } // namespace template diff --git a/src/platform/silabs/SilabsConfig.h b/src/platform/silabs/SilabsConfig.h index 391d6a71682e28..d5742c7c077d9d 100644 --- a/src/platform/silabs/SilabsConfig.h +++ b/src/platform/silabs/SilabsConfig.h @@ -62,11 +62,11 @@ namespace Internal { // '08' = Matter nvm3 region // '72' = the sub region group base offset (Factory, Config, Counter or KVS) // '01' = the id offset inside the group. -constexpr uint32_t kUserNvm3KeyDomainLoLimit = 0x000000U; // User Domain NVM3 Key Range lower limit -constexpr uint32_t kUserNvm3KeyDomainHiLimit = 0x00FFFFU; // User Domain NVM3 Key Range Maximum limit -constexpr uint32_t kMatterNvm3KeyDomain = 0x080000U; -constexpr uint32_t kMatterNvm3KeyLoLimit = 0x087200U; // Do not modify without Silabs GSDK team approval -constexpr uint32_t kMatterNvm3KeyHiLimit = 0x087FFFU; // Do not modify without Silabs GSDK team approval +inline constexpr uint32_t kUserNvm3KeyDomainLoLimit = 0x000000U; // User Domain NVM3 Key Range lower limit +inline constexpr uint32_t kUserNvm3KeyDomainHiLimit = 0x00FFFFU; // User Domain NVM3 Key Range Maximum limit +inline constexpr uint32_t kMatterNvm3KeyDomain = 0x080000U; +inline constexpr uint32_t kMatterNvm3KeyLoLimit = 0x087200U; // Do not modify without Silabs GSDK team approval +inline constexpr uint32_t kMatterNvm3KeyHiLimit = 0x087FFFU; // Do not modify without Silabs GSDK team approval constexpr inline uint32_t SilabsConfigKey(uint8_t keyBaseOffset, uint8_t id) { return kMatterNvm3KeyDomain | static_cast(keyBaseOffset) << 8 | id; diff --git a/src/platform/silabs/efr32/Efr32OpaqueKeypair.h b/src/platform/silabs/efr32/Efr32OpaqueKeypair.h index 91dd43d04c312c..9b17d42b590fbe 100644 --- a/src/platform/silabs/efr32/Efr32OpaqueKeypair.h +++ b/src/platform/silabs/efr32/Efr32OpaqueKeypair.h @@ -25,10 +25,10 @@ namespace DeviceLayer { namespace Internal { typedef uint16_t EFR32OpaqueKeyId; -constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdUnknown = 0xFFFFU; // Do not modify, will impact existing deployments -constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdVolatile = 0xFFFEU; // Do not modify, will impact existing deployments -constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMin = 0x0U; // Do not modify, will impact existing deployments -constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMax = 0x1FFU; // Do not decrease, will impact existing deployments +inline constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdUnknown = 0xFFFFU; // Do not modify, will impact existing deployments +inline constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdVolatile = 0xFFFEU; // Do not modify, will impact existing deployments +inline constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMin = 0x0U; // Do not modify, will impact existing deployments +inline constexpr EFR32OpaqueKeyId kEFR32OpaqueKeyIdPersistentMax = 0x1FFU; // Do not decrease, will impact existing deployments enum class EFR32OpaqueKeyUsages : uint8_t { diff --git a/src/protocols/bdx/BdxMessages.h b/src/protocols/bdx/BdxMessages.h index 72e1ad2969ab5d..753520eab455d6 100644 --- a/src/protocols/bdx/BdxMessages.h +++ b/src/protocols/bdx/BdxMessages.h @@ -33,9 +33,9 @@ namespace chip { namespace bdx { -constexpr uint16_t kMaxFileDesignatorLen = 0xFF; +inline constexpr uint16_t kMaxFileDesignatorLen = 0xFF; -constexpr const char * kProtocolName = "BDX"; +inline constexpr const char * kProtocolName = "BDX"; enum class MessageType : uint8_t { diff --git a/src/protocols/bdx/BdxUri.h b/src/protocols/bdx/BdxUri.h index 776ccffe0973b0..8e072892f6fbcd 100644 --- a/src/protocols/bdx/BdxUri.h +++ b/src/protocols/bdx/BdxUri.h @@ -22,7 +22,7 @@ namespace chip { namespace bdx { -constexpr const char kScheme[] = "bdx://"; +inline constexpr const char kScheme[] = "bdx://"; /** * Parses the URI into NodeId and File Designator diff --git a/src/protocols/echo/Echo.h b/src/protocols/echo/Echo.h index 510bad30c24ca9..08690e2ae45abc 100644 --- a/src/protocols/echo/Echo.h +++ b/src/protocols/echo/Echo.h @@ -38,7 +38,7 @@ namespace chip { namespace Protocols { namespace Echo { -constexpr const char * kProtocolName = "Echo"; +inline constexpr const char * kProtocolName = "Echo"; /** * Echo Protocol Message Types diff --git a/src/protocols/interaction_model/Constants.h b/src/protocols/interaction_model/Constants.h index 77839513fa66d1..d5b33e3f23ff2b 100644 --- a/src/protocols/interaction_model/Constants.h +++ b/src/protocols/interaction_model/Constants.h @@ -45,12 +45,12 @@ namespace chip { namespace Protocols { namespace InteractionModel { -constexpr const char * kProtocolName = "IM"; +inline constexpr const char * kProtocolName = "IM"; /** * Version of the Interaction Model used by the node. */ -constexpr uint16_t kVersion = 0; +inline constexpr uint16_t kVersion = 0; /** * Interaction Model Protocol Message Types diff --git a/src/protocols/secure_channel/CASEDestinationId.h b/src/protocols/secure_channel/CASEDestinationId.h index 1be4a7cf88fe22..104d44a76d0715 100644 --- a/src/protocols/secure_channel/CASEDestinationId.h +++ b/src/protocols/secure_channel/CASEDestinationId.h @@ -28,8 +28,8 @@ namespace chip { -constexpr uint16_t kSigmaParamRandomNumberSize = 32; -constexpr uint16_t kIPKSize = Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES; +inline constexpr uint16_t kSigmaParamRandomNumberSize = 32; +inline constexpr uint16_t kIPKSize = Crypto::CHIP_CRYPTO_SYMMETRIC_KEY_LENGTH_BYTES; CHIP_ERROR GenerateCaseDestinationId(const ByteSpan & ipk, const ByteSpan & initiatorRandom, const ByteSpan & rootPubKey, FabricId fabricId, NodeId nodeId, MutableByteSpan & outDestinationId); diff --git a/src/protocols/secure_channel/Constants.h b/src/protocols/secure_channel/Constants.h index 2e0b104599e1dc..57465a4e3414a6 100644 --- a/src/protocols/secure_channel/Constants.h +++ b/src/protocols/secure_channel/Constants.h @@ -43,7 +43,7 @@ namespace chip { namespace Protocols { namespace SecureChannel { -constexpr const char * kProtocolName = "SecureChannel"; +inline constexpr const char * kProtocolName = "SecureChannel"; /** * SecureChannel Protocol Message Types @@ -74,15 +74,15 @@ enum class MsgType : uint8_t }; // Placeholder value for the ProtocolCode field when the GeneralCode is Success or Continue. -constexpr uint16_t kProtocolCodeSuccess = 0x0000; -constexpr uint16_t kProtocolCodeNoSharedRoot = 0x0001; -constexpr uint16_t kProtocolCodeInvalidParam = 0x0002; -constexpr uint16_t kProtocolCodeCloseSession = 0x0003; -constexpr uint16_t kProtocolCodeBusy = 0x0004; -constexpr uint16_t kProtocolCodeSessionNotFound = 0x0005; +inline constexpr uint16_t kProtocolCodeSuccess = 0x0000; +inline constexpr uint16_t kProtocolCodeNoSharedRoot = 0x0001; +inline constexpr uint16_t kProtocolCodeInvalidParam = 0x0002; +inline constexpr uint16_t kProtocolCodeCloseSession = 0x0003; +inline constexpr uint16_t kProtocolCodeBusy = 0x0004; +inline constexpr uint16_t kProtocolCodeSessionNotFound = 0x0005; // Placeholder value for the ProtocolCode field when there is no additional protocol-specific code to provide more information. -constexpr uint16_t kProtocolCodeGeneralFailure = 0xFFFF; +inline constexpr uint16_t kProtocolCodeGeneralFailure = 0xFFFF; /** * Status Report - General Status Codes used to convey protocol-agnostic status info. diff --git a/src/protocols/secure_channel/PASESession.h b/src/protocols/secure_channel/PASESession.h index 39508d8342d7b8..02d8fa7d6636f8 100644 --- a/src/protocols/secure_channel/PASESession.h +++ b/src/protocols/secure_channel/PASESession.h @@ -44,7 +44,7 @@ namespace chip { extern const char * kSpake2pI2RSessionInfo; extern const char * kSpake2pR2ISessionInfo; -constexpr uint16_t kPBKDFParamRandomNumberSize = 32; +inline constexpr uint16_t kPBKDFParamRandomNumberSize = 32; using namespace Crypto; @@ -239,7 +239,7 @@ class DLL_EXPORT PASESession : public Messaging::UnsolicitedMessageHandler, }; // The following constants are node IDs that test devices and test controllers use. -constexpr chip::NodeId kTestControllerNodeId = 112233; -constexpr chip::NodeId kTestDeviceNodeId = 12344321; +inline constexpr chip::NodeId kTestControllerNodeId = 112233; +inline constexpr chip::NodeId kTestDeviceNodeId = 12344321; } // namespace chip diff --git a/src/protocols/secure_channel/RendezvousParameters.h b/src/protocols/secure_channel/RendezvousParameters.h index e563166f8acff0..a82628a483b2e9 100644 --- a/src/protocols/secure_channel/RendezvousParameters.h +++ b/src/protocols/secure_channel/RendezvousParameters.h @@ -33,7 +33,7 @@ namespace chip { const uint16_t kMaxRendezvousDiscriminatorValue = 0xFFF; // The largest supported value for sleepy idle interval and sleepy active interval -constexpr uint32_t kMaxSleepyInterval = 3600000; +inline constexpr uint32_t kMaxSleepyInterval = 3600000; class RendezvousParameters { diff --git a/src/protocols/user_directed_commissioning/UDCClients.h b/src/protocols/user_directed_commissioning/UDCClients.h index 47833bce421274..2edcdf3df2e74c 100644 --- a/src/protocols/user_directed_commissioning/UDCClients.h +++ b/src/protocols/user_directed_commissioning/UDCClients.h @@ -26,7 +26,7 @@ namespace Protocols { namespace UserDirectedCommissioning { // UDC client state times out after 1 hour. This may need to be tweaked. -constexpr const System::Clock::Timestamp kUDCClientTimeout = System::Clock::Milliseconds64(60 * 60 * 1000); +inline constexpr const System::Clock::Timestamp kUDCClientTimeout = System::Clock::Milliseconds64(60 * 60 * 1000); /** * Handles a set of UDC Client Processing States. diff --git a/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h b/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h index e21c933455e594..8e22014e36aaf6 100644 --- a/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h +++ b/src/protocols/user_directed_commissioning/UserDirectedCommissioning.h @@ -41,10 +41,10 @@ namespace chip { namespace Protocols { namespace UserDirectedCommissioning { -constexpr const char * kProtocolName = "UserDirectedCommissioning"; +inline constexpr const char * kProtocolName = "UserDirectedCommissioning"; // Cache contains 16 clients. This may need to be tweaked. -constexpr uint8_t kMaxUDCClients = 16; +inline constexpr uint8_t kMaxUDCClients = 16; /** * User Directed Commissioning Protocol Message Types diff --git a/src/setup_payload/AdditionalDataPayload.h b/src/setup_payload/AdditionalDataPayload.h index ede62352fadd45..78ba0137100aba 100644 --- a/src/setup_payload/AdditionalDataPayload.h +++ b/src/setup_payload/AdditionalDataPayload.h @@ -40,8 +40,8 @@ namespace chip { namespace SetupPayloadData { -constexpr uint8_t kRotatingDeviceIdLength = 18; -constexpr uint8_t kRotatingDeviceIdTag = 0x00; +inline constexpr uint8_t kRotatingDeviceIdLength = 18; +inline constexpr uint8_t kRotatingDeviceIdTag = 0x00; struct AdditionalDataPayload { diff --git a/src/setup_payload/SetupPayload.h b/src/setup_payload/SetupPayload.h index 4892e9ea0d2a23..0bb21698341279 100644 --- a/src/setup_payload/SetupPayload.h +++ b/src/setup_payload/SetupPayload.h @@ -68,14 +68,14 @@ const int kManualSetupVendorIdCharLength = 5; const int kManualSetupProductIdCharLength = 5; // Spec 5.1.4.2 CHIP-Common Reserved Tags -constexpr uint8_t kSerialNumberTag = 0x00; -constexpr uint8_t kPBKDFIterationsTag = 0x01; -constexpr uint8_t kBPKFSaltTag = 0x02; -constexpr uint8_t kNumberOFDevicesTag = 0x03; -constexpr uint8_t kCommissioningTimeoutTag = 0x04; - -constexpr uint32_t kSetupPINCodeMaximumValue = 99999998; -constexpr uint32_t kSetupPINCodeUndefinedValue = 0; +inline constexpr uint8_t kSerialNumberTag = 0x00; +inline constexpr uint8_t kPBKDFIterationsTag = 0x01; +inline constexpr uint8_t kBPKFSaltTag = 0x02; +inline constexpr uint8_t kNumberOFDevicesTag = 0x03; +inline constexpr uint8_t kCommissioningTimeoutTag = 0x04; + +inline constexpr uint32_t kSetupPINCodeMaximumValue = 99999998; +inline constexpr uint32_t kSetupPINCodeUndefinedValue = 0; // clang-format off const int kTotalPayloadDataSizeInBits = diff --git a/src/setup_payload/tests/TestHelpers.h b/src/setup_payload/tests/TestHelpers.h index dedd9040ae205e..8e83b512df26d1 100644 --- a/src/setup_payload/tests/TestHelpers.h +++ b/src/setup_payload/tests/TestHelpers.h @@ -30,16 +30,16 @@ namespace chip { const uint16_t kSmallBufferSizeInBytes = 1; const uint16_t kDefaultBufferSizeInBytes = 512; -const uint8_t kOptionalDefaultStringTag = 0x82; // Vendor "test" tag -constexpr char kOptionalDefaultStringValue[] = "myData"; +const uint8_t kOptionalDefaultStringTag = 0x82; // Vendor "test" tag +inline constexpr char kOptionalDefaultStringValue[] = "myData"; const uint8_t kOptionalDefaultIntTag = 0x83; // Vendor "test" tag const uint32_t kOptionalDefaultIntValue = 12; -constexpr char kSerialNumberDefaultStringValue[] = "123456789"; -const uint32_t kSerialNumberDefaultUInt32Value = 123456789; +inline constexpr char kSerialNumberDefaultStringValue[] = "123456789"; +const uint32_t kSerialNumberDefaultUInt32Value = 123456789; -constexpr const char * kDefaultPayloadQRCode = "MT:M5L90MP500K64J00000"; +inline constexpr const char * kDefaultPayloadQRCode = "MT:M5L90MP500K64J00000"; inline SetupPayload GetDefaultPayload() { diff --git a/src/system/SocketEvents.h b/src/system/SocketEvents.h index 508bbdcf759483..390fe78f597884 100644 --- a/src/system/SocketEvents.h +++ b/src/system/SocketEvents.h @@ -34,7 +34,7 @@ using SocketEvents = BitFlags; using SocketWatchToken = intptr_t; using SocketWatchCallback = void (*)(SocketEvents events, intptr_t data); -constexpr int kInvalidFd = -1; +inline constexpr int kInvalidFd = -1; } // namespace System } // namespace chip diff --git a/src/system/SystemClock.h b/src/system/SystemClock.h index 566e23d9738bc7..77196f995bbc89 100644 --- a/src/system/SystemClock.h +++ b/src/system/SystemClock.h @@ -68,7 +68,7 @@ using Seconds64 = std::chrono::duration; using Seconds32 = std::chrono::duration; using Seconds16 = std::chrono::duration; -constexpr Seconds16 kZero{ 0 }; +inline constexpr Seconds16 kZero{ 0 }; namespace Literals { diff --git a/src/transport/SecureSessionTable.h b/src/transport/SecureSessionTable.h index c84fc94ea3a5d8..aff58c4e5fe0b0 100644 --- a/src/transport/SecureSessionTable.h +++ b/src/transport/SecureSessionTable.h @@ -26,8 +26,8 @@ namespace chip { namespace Transport { -constexpr uint16_t kMaxSessionID = UINT16_MAX; -constexpr uint16_t kUnsecuredSessionId = 0; +inline constexpr uint16_t kMaxSessionID = UINT16_MAX; +inline constexpr uint16_t kUnsecuredSessionId = 0; /** * Handles a set of sessions. diff --git a/src/transport/SessionManager.h b/src/transport/SessionManager.h index e383c39d27a29c..5f2e6f7603cad0 100644 --- a/src/transport/SessionManager.h +++ b/src/transport/SessionManager.h @@ -528,7 +528,7 @@ namespace MessagePacketBuffer { /** * Maximum size of a message footer, in bytes. */ -constexpr uint16_t kMaxFooterSize = kMaxTagLen; +inline constexpr uint16_t kMaxFooterSize = kMaxTagLen; /** * Allocates a packet buffer with space for message headers and footers. diff --git a/src/transport/TraceMessage.h b/src/transport/TraceMessage.h index bf6cbaef99c861..d2be9478c53408 100644 --- a/src/transport/TraceMessage.h +++ b/src/transport/TraceMessage.h @@ -75,9 +75,9 @@ namespace chip { namespace trace { -constexpr const char * kTraceMessageEvent = "SecureMsg"; -constexpr const char * kTraceMessageSentDataFormat = "SecMsgSent"; -constexpr const char * kTraceMessageReceivedDataFormat = "SecMsgReceived"; +inline constexpr const char * kTraceMessageEvent = "SecureMsg"; +inline constexpr const char * kTraceMessageSentDataFormat = "SecMsgSent"; +inline constexpr const char * kTraceMessageReceivedDataFormat = "SecMsgReceived"; struct TraceSecureMessageSentData { From ef5bda7467a829f45990336a9fc179ada05a63f3 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 15 Sep 2023 13:07:38 -0400 Subject: [PATCH 114/134] Stop logging errors on receving a redundant standalone ack. (#29166) If we had the following message flow: 1. Send a message that is the last message on an exchange. 2. Before we get the ack retransmit the message. 3. Get acks for both messages. we would log an error on the second ack, since there was no exchagne to dispatch it to, so it would just get dropped. But dropping a standalone ack for an exchange that no longer exists is fine; in the case above the exchange no longer exists because the first ack it got allowed us to clean it up. --- src/messaging/ExchangeMgr.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/messaging/ExchangeMgr.cpp b/src/messaging/ExchangeMgr.cpp index 1ffce3e3de0316..dddc9c6fd4ce8f 100644 --- a/src/messaging/ExchangeMgr.cpp +++ b/src/messaging/ExchangeMgr.cpp @@ -300,9 +300,17 @@ void ExchangeManager::OnMessageReceived(const PacketHeader & packetHeader, const // an ack to the peer. else if (!payloadHeader.NeedsAck()) { - // Using same error message for all errors to reduce code size. - ChipLogError(ExchangeManager, "OnMessageReceived failed, err = %" CHIP_ERROR_FORMAT, - CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR.Format()); + // We can easily get standalone acks here: any time we fail to get a + // timely ack for the last message in an exchange and retransmit it, + // then get acks for both the message and the retransmit, the second ack + // will end up in this block. That's not really an error condition, so + // there is no need to log an error in that case. + if (!payloadHeader.HasMessageType(Protocols::SecureChannel::MsgType::StandaloneAck)) + { + // Using same error message for all errors to reduce code size. + ChipLogError(ExchangeManager, "OnMessageReceived failed, err = %" CHIP_ERROR_FORMAT, + CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR.Format()); + } return; } From 15f54da67d08f40b18d366433c492b7c1c8dd89a Mon Sep 17 00:00:00 2001 From: wyhong <30567533+wy-hh@users.noreply.github.com> Date: Sat, 16 Sep 2023 03:04:01 +0800 Subject: [PATCH 115/134] [Bouffalolab] Load BLE TX power configuration from flash (#29276) * load ble tx power from flash configuration * change config name * fix compile error * fix restyle --- third_party/bouffalolab/bl602/bl_iot_sdk.gni | 2 ++ third_party/bouffalolab/bl702/bl_iot_sdk.gni | 14 +++++++++++++- third_party/bouffalolab/bl702l/bl_iot_sdk.gni | 17 ++++++++++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/third_party/bouffalolab/bl602/bl_iot_sdk.gni b/third_party/bouffalolab/bl602/bl_iot_sdk.gni index 3d649794d168a6..80801c984036ff 100644 --- a/third_party/bouffalolab/bl602/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl602/bl_iot_sdk.gni @@ -203,6 +203,7 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_hosal") { + defines = [ "CFG_BLE_ENABLE" ] sources = [ "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/bl_adc.c", "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/bl_boot2.c", @@ -282,6 +283,7 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_fs", ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", + ":${sdk_target_name}_config_ble", ] public_configs = [ ":${sdk_target_name}_config", diff --git a/third_party/bouffalolab/bl702/bl_iot_sdk.gni b/third_party/bouffalolab/bl702/bl_iot_sdk.gni index 832e2261f628ef..a4e19a9db15813 100644 --- a/third_party/bouffalolab/bl702/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702/bl_iot_sdk.gni @@ -260,6 +260,11 @@ template("bl_iot_sdk") { "DISABLE_PRINT=1", ] + if (defined(invoker.chip_config_network_layer_ble) && + invoker.chip_config_network_layer_ble) { + defines += [ "CFG_BLE_ENABLE" ] + } + sources = [ "${bl_iot_sdk_root}/components/platform/hosal/bl702_hal/bl_adc.c", "${bl_iot_sdk_root}/components/platform/hosal/bl702_hal/bl_boot2.c", @@ -331,6 +336,12 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", ] + + if (defined(invoker.chip_config_network_layer_ble) && + invoker.chip_config_network_layer_ble) { + configs += [ ":${sdk_target_name}_config_ble" ] + } + public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_hosal", @@ -752,6 +763,8 @@ template("bl_iot_sdk") { include_dirs = [ "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_ethernet/Inc", ] + + cflags_cc = [ "-Wno-conversion" ] } source_set("${sdk_target_name}_ethernet") { @@ -813,7 +826,6 @@ template("bl_iot_sdk") { public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_wifi", - ":${sdk_target_name}_config_lwip", ] cflags = [ diff --git a/third_party/bouffalolab/bl702l/bl_iot_sdk.gni b/third_party/bouffalolab/bl702l/bl_iot_sdk.gni index 391997f3a10ac3..c84a3b2cb8d8af 100644 --- a/third_party/bouffalolab/bl702l/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702l/bl_iot_sdk.gni @@ -188,6 +188,11 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_hosal") { + if (defined(invoker.chip_config_network_layer_ble) && + invoker.chip_config_network_layer_ble) { + defines = [ "CFG_BLE_ENABLE" ] + } + sources = [ "${bl_iot_sdk_root}/components/platform/hosal/bl702l_hal/bl_adc.c", "${bl_iot_sdk_root}/components/platform/hosal/bl702l_hal/bl_boot2.c", @@ -258,6 +263,11 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_fs", ":${sdk_target_name}_config_utils", ] + if (defined(invoker.chip_config_network_layer_ble) && + invoker.chip_config_network_layer_ble) { + configs += [ ":${sdk_target_name}_config_ble" ] + } + public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_hosal", @@ -688,7 +698,6 @@ template("bl_iot_sdk") { group(sdk_target_name) { public_deps = [ ":${sdk_target_name}_bl702l_rom_a0", - ":${sdk_target_name}_ble", ":${sdk_target_name}_fs", ":${sdk_target_name}_hosal", ":${sdk_target_name}_libc", @@ -699,6 +708,12 @@ template("bl_iot_sdk") { ":${sdk_target_name}_utils", ] public_configs = [ ":${sdk_target_name}_config_BSP_Driver" ] + + if (defined(invoker.chip_config_network_layer_ble) && + invoker.chip_config_network_layer_ble) { + public_deps += [ ":${sdk_target_name}_ble" ] + } + if (defined(invoker.chip_enable_openthread) && invoker.chip_enable_openthread) { public_deps += [ ":${sdk_target_name}_openthread_port" ] From 6991483c0f04b13ab71a5babf64ffaad46a09fac Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Fri, 15 Sep 2023 15:25:24 -0400 Subject: [PATCH 116/134] Increase Heap if using PW RPC (#29293) --- examples/platform/silabs/FreeRTOSConfig.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/platform/silabs/FreeRTOSConfig.h b/examples/platform/silabs/FreeRTOSConfig.h index e904f1930a6a61..bce38a6a579039 100644 --- a/examples/platform/silabs/FreeRTOSConfig.h +++ b/examples/platform/silabs/FreeRTOSConfig.h @@ -223,18 +223,24 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configSUPPORT_STATIC_ALLOCATION (1) #define configSUPPORT_DYNAMIC_ALLOCATION (1) +#ifdef PW_RPC_ENABLED +#define EXTRA_HEAP_k 10 +#else +#define EXTRA_HEAP_k 0 +#endif + #ifndef configTOTAL_HEAP_SIZE #ifdef SL_WIFI #ifdef DIC_ENABLE -#define configTOTAL_HEAP_SIZE ((size_t)(68 * 1024)) +#define configTOTAL_HEAP_SIZE ((size_t)((68 + EXTRA_HEAP_k) * 1024)) #else -#define configTOTAL_HEAP_SIZE ((size_t)(42 * 1024)) +#define configTOTAL_HEAP_SIZE ((size_t)((42 + EXTRA_HEAP_k) * 1024)) #endif // DIC #else // SL_WIFI #if SL_CONFIG_OPENTHREAD_LIB == 1 -#define configTOTAL_HEAP_SIZE ((size_t)(40 * 1024)) +#define configTOTAL_HEAP_SIZE ((size_t)((40 + EXTRA_HEAP_k) * 1024)) #else -#define configTOTAL_HEAP_SIZE ((size_t)(38 * 1024)) +#define configTOTAL_HEAP_SIZE ((size_t)((38 + EXTRA_HEAP_k) * 1024)) #endif // SL_CONFIG_OPENTHREAD_LIB #endif // configTOTAL_HEAP_SIZE #endif // configTOTAL_HEAP_SIZE From 25fc34db7c0edee0648d4e2a5608aa3aade73777 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 15 Sep 2023 15:31:24 -0400 Subject: [PATCH 117/134] Fix chip-tool threading asserts if an interactive command times out. (#29277) * Fix chip-tool threading asserts if an interactive command times out. Since the Matter event loop is still running in interacive mode, we need to do the command cleanup on that event loop. * Fixes https://github.com/project-chip/connectedhomeip/issues/29275 * Fixes https://github.com/project-chip/connectedhomeip/issues/27535 * Address review comment. --- .../chip-tool/commands/common/CHIPCommand.cpp | 86 +++++++++++++------ .../chip-tool/commands/common/CHIPCommand.h | 12 +++ src/app/CommandSender.cpp | 10 ++- src/app/CommandSender.h | 1 + src/app/ReadClient.cpp | 5 ++ src/app/WriteClient.h | 11 ++- 6 files changed, 98 insertions(+), 27 deletions(-) diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp index d348211af7e9e7..944360fb2eea3a 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.cpp +++ b/examples/chip-tool/commands/common/CHIPCommand.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED #include "TraceDecoder.h" @@ -222,17 +223,17 @@ CHIP_ERROR CHIPCommand::Run() CHIP_ERROR err = StartWaiting(GetWaitDuration()); - bool deferCleanup = (IsInteractive() && DeferInteractiveCleanup()); - - Shutdown(); - - if (deferCleanup) + if (IsInteractive()) { - sDeferredCleanups.insert(this); + bool timedOut; + // Give it 2 hours to run our cleanup; that should never get hit in practice. + CHIP_ERROR cleanupErr = RunOnMatterQueue(RunCommandCleanup, chip::System::Clock::Seconds16(7200), &timedOut); + VerifyOrDie(cleanupErr == CHIP_NO_ERROR); + VerifyOrDie(!timedOut); } else { - Cleanup(); + CleanupAfterRun(); } MaybeTearDownStack(); @@ -504,6 +505,56 @@ void CHIPCommand::RunQueuedCommand(intptr_t commandArg) } } +void CHIPCommand::RunCommandCleanup(intptr_t commandArg) +{ + auto * command = reinterpret_cast(commandArg); + command->CleanupAfterRun(); + command->StopWaiting(); +} + +void CHIPCommand::CleanupAfterRun() +{ + assertChipStackLockedByCurrentThread(); + bool deferCleanup = (IsInteractive() && DeferInteractiveCleanup()); + + Shutdown(); + + if (deferCleanup) + { + sDeferredCleanups.insert(this); + } + else + { + Cleanup(); + } +} + +CHIP_ERROR CHIPCommand::RunOnMatterQueue(MatterWorkCallback callback, chip::System::Clock::Timeout timeout, bool * timedOut) +{ + { + std::lock_guard lk(cvWaitingForResponseMutex); + mWaitingForResponse = true; + } + + auto err = chip::DeviceLayer::PlatformMgr().ScheduleWork(callback, reinterpret_cast(this)); + if (CHIP_NO_ERROR != err) + { + { + std::lock_guard lk(cvWaitingForResponseMutex); + mWaitingForResponse = false; + } + return err; + } + + auto waitingUntil = std::chrono::system_clock::now() + std::chrono::duration_cast(timeout); + { + std::unique_lock lk(cvWaitingForResponseMutex); + *timedOut = !cvWaitingForResponse.wait_until(lk, waitingUntil, [this]() { return !this->mWaitingForResponse; }); + } + + return CHIP_NO_ERROR; +} + #if !CONFIG_USE_SEPARATE_EVENTLOOP static void OnResponseTimeout(chip::System::Layer *, void * appState) { @@ -526,28 +577,15 @@ CHIP_ERROR CHIPCommand::StartWaiting(chip::System::Clock::Timeout duration) } else { - { - std::lock_guard lk(cvWaitingForResponseMutex); - mWaitingForResponse = true; - } - - auto err = chip::DeviceLayer::PlatformMgr().ScheduleWork(RunQueuedCommand, reinterpret_cast(this)); + bool timedOut; + CHIP_ERROR err = RunOnMatterQueue(RunQueuedCommand, duration, &timedOut); if (CHIP_NO_ERROR != err) { - { - std::lock_guard lk(cvWaitingForResponseMutex); - mWaitingForResponse = false; - } return err; } - - auto waitingUntil = std::chrono::system_clock::now() + std::chrono::duration_cast(duration); + if (timedOut) { - std::unique_lock lk(cvWaitingForResponseMutex); - if (!cvWaitingForResponse.wait_until(lk, waitingUntil, [this]() { return !this->mWaitingForResponse; })) - { - mCommandExitStatus = CHIP_ERROR_TIMEOUT; - } + mCommandExitStatus = CHIP_ERROR_TIMEOUT; } } if (!IsInteractive()) diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h index 36732793653504..f1cd84439eae49 100644 --- a/examples/chip-tool/commands/common/CHIPCommand.h +++ b/examples/chip-tool/commands/common/CHIPCommand.h @@ -220,6 +220,18 @@ class CHIPCommand : public Command static const chip::Credentials::AttestationTrustStore * sTrustStore; static void RunQueuedCommand(intptr_t commandArg); + typedef decltype(RunQueuedCommand) MatterWorkCallback; + static void RunCommandCleanup(intptr_t commandArg); + + // Do cleanup after a commmand is done running. Must happen with the + // Matter stack locked. + void CleanupAfterRun(); + + // Run the given callback on the Matter thread. Return whether we managed + // to successfully dispatch it to the Matter thread. If we did, *timedOut + // will be set to whether we timed out or whether our mWaitingForResponse + // got set to false by the callback itself. + CHIP_ERROR RunOnMatterQueue(MatterWorkCallback callback, chip::System::Clock::Timeout timeout, bool * timedOut); CHIP_ERROR mCommandExitStatus = CHIP_ERROR_INTERNAL; diff --git a/src/app/CommandSender.cpp b/src/app/CommandSender.cpp index 5daceaf05a088a..d579845d2e5d5a 100644 --- a/src/app/CommandSender.cpp +++ b/src/app/CommandSender.cpp @@ -26,6 +26,7 @@ #include "InteractionModelEngine.h" #include "StatusResponse.h" #include +#include #include #include @@ -36,7 +37,14 @@ CommandSender::CommandSender(Callback * apCallback, Messaging::ExchangeManager * bool aSuppressResponse) : mExchangeCtx(*this), mpCallback(apCallback), mpExchangeMgr(apExchangeMgr), mSuppressResponse(aSuppressResponse), mTimedRequest(aIsTimedRequest) -{} +{ + assertChipStackLockedByCurrentThread(); +} + +CommandSender::~CommandSender() +{ + assertChipStackLockedByCurrentThread(); +} CHIP_ERROR CommandSender::AllocateBuffer() { diff --git a/src/app/CommandSender.h b/src/app/CommandSender.h index 6da9b053856c82..194c4535457562 100644 --- a/src/app/CommandSender.h +++ b/src/app/CommandSender.h @@ -123,6 +123,7 @@ class CommandSender final : public Messaging::ExchangeDelegate */ CommandSender(Callback * apCallback, Messaging::ExchangeManager * apExchangeMgr, bool aIsTimedRequest = false, bool aSuppressResponse = false); + ~CommandSender(); CHIP_ERROR PrepareCommand(const CommandPathParams & aCommandPathParams, bool aStartDataStruct = true); CHIP_ERROR FinishCommand(bool aEndDataStruct = true); TLV::TLVWriter * GetCommandDataIBTLVWriter(); diff --git a/src/app/ReadClient.cpp b/src/app/ReadClient.cpp index caac866aeba08c..373d2051d3457f 100644 --- a/src/app/ReadClient.cpp +++ b/src/app/ReadClient.cpp @@ -32,6 +32,7 @@ #include #include #include +#include namespace chip { namespace app { @@ -44,6 +45,8 @@ ReadClient::ReadClient(InteractionModelEngine * apImEngine, Messaging::ExchangeM mpCallback(apCallback), mOnConnectedCallback(HandleDeviceConnected, this), mOnConnectionFailureCallback(HandleDeviceConnectionFailure, this) { + assertChipStackLockedByCurrentThread(); + mpExchangeMgr = apExchangeMgr; mInteractionType = aInteractionType; @@ -89,6 +92,8 @@ void ReadClient::StopResubscription() ReadClient::~ReadClient() { + assertChipStackLockedByCurrentThread(); + if (IsSubscriptionType()) { StopResubscription(); diff --git a/src/app/WriteClient.h b/src/app/WriteClient.h index 2323adc8a337e9..90f0f3a24b6c1a 100644 --- a/src/app/WriteClient.h +++ b/src/app/WriteClient.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -127,16 +128,22 @@ class WriteClient : public Messaging::ExchangeDelegate mpExchangeMgr(apExchangeMgr), mExchangeCtx(*this), mpCallback(apCallback), mTimedWriteTimeoutMs(aTimedWriteTimeoutMs), mSuppressResponse(aSuppressResponse) - {} + { + assertChipStackLockedByCurrentThread(); + } #if CONFIG_BUILD_FOR_HOST_UNIT_TEST WriteClient(Messaging::ExchangeManager * apExchangeMgr, Callback * apCallback, const Optional & aTimedWriteTimeoutMs, uint16_t aReservedSize) : mpExchangeMgr(apExchangeMgr), mExchangeCtx(*this), mpCallback(apCallback), mTimedWriteTimeoutMs(aTimedWriteTimeoutMs), mReservedSize(aReservedSize) - {} + { + assertChipStackLockedByCurrentThread(); + } #endif + ~WriteClient() { assertChipStackLockedByCurrentThread(); } + /** * Encode an attribute value that can be directly encoded using DataModel::Encode. Will create a new chunk when necessary. */ From 64df62c323e2e1a9ee8034a378a17aab9397d7a8 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Fri, 15 Sep 2023 15:43:52 -0400 Subject: [PATCH 118/134] Add Status Screen and Update default bitmap (#29195) --- examples/lighting-app/silabs/src/AppTask.cpp | 2 +- examples/lock-app/silabs/src/AppTask.cpp | 2 +- examples/platform/silabs/BaseApplication.cpp | 17 ++- .../platform/silabs/display/demo-ui-bitmaps.h | 73 ++++-------- examples/platform/silabs/display/lcd.cpp | 110 +++++++++++++++--- examples/platform/silabs/display/lcd.h | 28 ++++- examples/pump-app/silabs/src/AppTask.cpp | 2 +- .../smoke-co-alarm-app/silabs/src/AppTask.cpp | 2 +- examples/window-app/silabs/src/AppTask.cpp | 2 +- 9 files changed, 164 insertions(+), 74 deletions(-) diff --git a/examples/lighting-app/silabs/src/AppTask.cpp b/examples/lighting-app/silabs/src/AppTask.cpp index bb27d8c702bff5..542dc2fbfd55c8 100644 --- a/examples/lighting-app/silabs/src/AppTask.cpp +++ b/examples/lighting-app/silabs/src/AppTask.cpp @@ -101,7 +101,7 @@ CHIP_ERROR AppTask::Init() if (!ConnectivityMgr().IsThreadProvisioned()) #endif /* !SL_WIFI */ { - GetLCD().ShowQRCode(true, true); + GetLCD().ShowQRCode(true); } #endif // QR_CODE_ENABLED #endif diff --git a/examples/lock-app/silabs/src/AppTask.cpp b/examples/lock-app/silabs/src/AppTask.cpp index 7d86fec80a07d9..4e8527f4f4fa1a 100644 --- a/examples/lock-app/silabs/src/AppTask.cpp +++ b/examples/lock-app/silabs/src/AppTask.cpp @@ -190,7 +190,7 @@ CHIP_ERROR AppTask::Init() if (!ConnectivityMgr().IsThreadProvisioned()) #endif /* !SL_WIFI */ { - GetLCD().ShowQRCode(true, true); + GetLCD().ShowQRCode(true); } #endif // QR_CODE_ENABLED #endif diff --git a/examples/platform/silabs/BaseApplication.cpp b/examples/platform/silabs/BaseApplication.cpp index 09556e899b79a3..665c65bcda6a15 100644 --- a/examples/platform/silabs/BaseApplication.cpp +++ b/examples/platform/silabs/BaseApplication.cpp @@ -400,6 +400,7 @@ bool BaseApplication::ActivateStatusLedPatterns() return isPatternSet; } +// TODO Move State Monitoring elsewhere void BaseApplication::LightEventHandler() { // Collect connectivity and configuration state from the CHIP stack. Because @@ -420,8 +421,17 @@ void BaseApplication::LightEventHandler() sIsAttached = ConnectivityMgr().IsThreadAttached(); #endif /* CHIP_ENABLE_OPENTHREAD */ sHaveBLEConnections = (ConnectivityMgr().NumBLEConnections() != 0); + +#ifdef DISPLAY_ENABLED + SilabsLCD::DisplayStatus_t status; + status.connected = sIsEnabled && sIsAttached; + status.advertising = chip::Server::GetInstance().GetCommissioningWindowManager().IsCommissioningWindowOpen(); + status.nbFabric = chip::Server::GetInstance().GetFabricTable().FabricCount(); + slLCD.SetStatus(status); +#endif PlatformMgr().UnlockChipStack(); } + #endif // CHIP_CONFIG_ENABLE_ICD_SERVER #if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))) @@ -473,9 +483,8 @@ void BaseApplication::ButtonHandler(AppEvent * aEvent) mFunction = kFunction_NoneSelected; OutputQrCode(false); -#ifdef QR_CODE_ENABLED - // TOGGLE QRCode/LCD demo UI - slLCD.ToggleQRCode(); +#ifdef DISPLAY_ENABLED + slLCD.CycleScreens(); #endif #ifdef SL_WIFI @@ -732,7 +741,7 @@ void BaseApplication::OutputQrCode(bool refreshLCD) if (refreshLCD) { slLCD.SetQRCode((uint8_t *) setupPayload.data(), setupPayload.size()); - slLCD.ShowQRCode(true, true); + slLCD.ShowQRCode(true); } #endif // QR_CODE_ENABLED diff --git a/examples/platform/silabs/display/demo-ui-bitmaps.h b/examples/platform/silabs/display/demo-ui-bitmaps.h index 4b3650e39d6603..b5a6103a8fddb2 100644 --- a/examples/platform/silabs/display/demo-ui-bitmaps.h +++ b/examples/platform/silabs/display/demo-ui-bitmaps.h @@ -98,63 +98,38 @@ 0x7F, 0xFC, 0xFC, 0xFC, 0xE3, 0xF1, 0x87, 0x87, 0xC7, 0xDE, 0x88, 0x33, 0xC7, 0xCF, 0xFC, 0xFF, 0xFF, 0x03 #ifndef ON_DEMO_BITMAP // Unknown demo.... + #define ON_DEMO_BITMAP \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xC0, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, \ - 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xF0, 0x0F, \ - 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFC, 0x3F, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFE, 0x7F, 0xFE, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x1F, 0xF8, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x0F, 0xF0, \ - 0x0F, 0xFF, 0xFF, 0xFF, 0x7F, 0xE0, 0x07, 0xE0, 0x07, 0xFE, 0xFF, 0xFF, 0x7F, 0xC0, 0x03, 0xC0, 0x03, 0xFE, 0xFF, 0xFF, \ - 0x7F, 0xC0, 0x03, 0xC0, 0x03, 0xFE, 0xFF, 0xFF, 0x3F, 0xC0, 0x03, 0xC0, 0x03, 0xFC, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, \ - 0x00, 0xFC, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, \ - 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, \ - 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, \ - 0x8F, 0x01, 0x80, 0x01, 0x80, 0xF1, 0xFF, 0xFF, 0xCF, 0x03, 0xC0, 0x03, 0xC0, 0xF3, 0xFF, 0xFF, 0xEF, 0x07, 0xE0, 0x07, \ - 0xE0, 0xF7, 0xFF, 0xFF, 0xFF, 0x0F, 0xF0, 0x0F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0xF8, 0x1F, 0xF8, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0x3F, 0xFC, 0x3F, 0xFC, 0xFF, 0xFF, 0xFF, 0x7F, 0x7E, 0x7E, 0x7E, 0x7E, 0xFE, 0xFF, 0xFF, 0x3F, 0xFC, 0x3F, 0xFC, \ - 0x3F, 0xFC, 0xFF, 0xFF, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0xFF, 0xFF, 0x1F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF8, 0xFF, 0xFF, \ - 0x1F, 0xE0, 0x07, 0xE0, 0x07, 0xF8, 0xFF, 0xFF, 0x3F, 0xC0, 0x03, 0xC0, 0x03, 0xFC, 0xFF, 0xFF, 0x3F, 0x80, 0x01, 0x80, \ - 0x01, 0xFC, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, \ - 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, \ - 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xB9, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB1, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB5, \ + 0xF9, 0x0D, 0x30, 0x0C, 0xC3, 0xFF, 0xFF, 0xB5, 0xF6, 0x6D, 0xF6, 0x6D, 0x9B, 0xFF, 0xFF, 0xAD, 0xF6, 0x6D, 0x36, 0x6C, \ + 0x83, 0xFF, 0xFF, 0x8D, 0xF6, 0x6D, 0xB6, 0x6D, 0xFB, 0xFF, 0xFF, 0x9D, 0xF9, 0x6D, 0x36, 0x0C, 0x83, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xE1, 0xFF, 0xFF, 0xE7, 0x99, 0xF9, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xE7, 0x99, \ + 0xF9, 0xFF, 0xFF, 0x7D, 0x6E, 0xC3, 0xE0, 0x99, 0xF9, 0xFF, 0xFF, 0xA1, 0x6D, 0xDB, 0xE6, 0x99, 0xF9, 0xFF, 0xFF, 0xBD, \ + 0x6D, 0xDB, 0xE6, 0x99, 0xF9, 0xFF, 0xFF, 0xBD, 0x6D, 0xDB, 0xE6, 0xFF, 0xFF, 0xFF, 0xFF, 0x7D, 0x9E, 0xDB, 0xE0, 0x99, \ + 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF #endif #ifndef OFF_DEMO_BITMAP // Unknown demo.... -#define OFF_DEMO_BITMAP \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0xFF, 0x7F, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xC0, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x00, 0x00, \ - 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, \ - 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0x01, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, \ - 0x00, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, \ - 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, \ - 0x00, 0xFC, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, \ - 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, \ - 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, \ - 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, \ - 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, \ - 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0x00, \ - 0x00, 0xF0, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, \ - 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0xFF, 0x3F, 0x00, 0x00, 0x00, \ - 0x00, 0xFC, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xFF, \ - 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x00, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0x00, 0x00, \ - 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0x00, 0x00, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x00, 0x00, 0xF0, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0x1F, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF +#define OFF_DEMO_BITMAP ON_DEMO_BITMAP #endif #endif // SILABS_DEMO_UI_BITMAPS_H diff --git a/examples/platform/silabs/display/lcd.cpp b/examples/platform/silabs/display/lcd.cpp index 6a06be1c28f6c8..7a18951dd54b06 100644 --- a/examples/platform/silabs/display/lcd.cpp +++ b/examples/platform/silabs/display/lcd.cpp @@ -125,12 +125,10 @@ int SilabsLCD::Update(void) void SilabsLCD::WriteDemoUI(bool state) { -#ifdef QR_CODE_ENABLED - if (mShowQRCode) + if (mCurrentScreen != DemoScreen) { - mShowQRCode = false; + mCurrentScreen = DemoScreen; } -#endif dState.mainState = state; WriteDemoUI(); } @@ -149,11 +147,102 @@ void SilabsLCD::WriteDemoUI() } } +void SilabsLCD::WriteStatus() +{ + uint8_t lineNb = 0; + char str[20]; + + GLIB_clear(&glibContext); + sprintf(str, "# Fabrics : %d", mStatus.nbFabric); + GLIB_drawStringOnLine(&glibContext, str, lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); + + if (strlen(mStatus.networkName) >= sizeof(str)) + { + memcpy(str, mStatus.networkName, sizeof(str) - 1); + str[sizeof(str) - 1] = '\0'; + } + else + { + memcpy(str, mStatus.networkName, sizeof(str)); + } + +#if SL_WIFI + GLIB_drawStringOnLine(&glibContext, "SSID : ", lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); + GLIB_drawStringOnLine(&glibContext, str, lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); +#else + GLIB_drawStringOnLine(&glibContext, "PANID : ", lineNb, GLIB_ALIGN_LEFT, 0, 0, true); + GLIB_drawStringOnLine(&glibContext, str, lineNb++, GLIB_ALIGN_LEFT, 64, 0, true); +#if CHIP_DEVICE_CONFIG_THREAD_FTD + GLIB_drawStringOnLine(&glibContext, "OT Type : FTD", lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); +#else + GLIB_drawStringOnLine(&glibContext, "OT Type : MTD", lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); +#endif // FTD +#endif + GLIB_drawStringOnLine(&glibContext, "", lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); + sprintf(str, "Connected : %c", mStatus.connected ? 'Y' : 'N'); + GLIB_drawStringOnLine(&glibContext, str, lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); + sprintf(str, "Advertising : %c", mStatus.advertising ? 'Y' : 'N'); + GLIB_drawStringOnLine(&glibContext, str, lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); +#if CHIP_CONFIG_ENABLE_ICD_SERVER + GLIB_drawStringOnLine(&glibContext, "Is ICD : Y", lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); +#else + GLIB_drawStringOnLine(&glibContext, "Is ICD : N", lineNb++, GLIB_ALIGN_LEFT, 0, 0, true); +#endif + + updateDisplay(); +} + void SilabsLCD::SetCustomUI(customUICB cb) { customUI = cb; } +void SilabsLCD::SetScreen(Screen_e screen) +{ + if (screen >= InvalidScreen) + { + return; + } + + switch (screen) + { + case DemoScreen: + WriteDemoUI(); + break; + case StatusScreen: + WriteStatus(); + break; + case QRCodeScreen: + WriteQRCode(); + break; + default: + break; + } +} + +void SilabsLCD::CycleScreens(void) +{ +#ifdef QR_CODE_ENABLED + if (mCurrentScreen < QRCodeScreen) +#elif + if (mCurrentScreen < StatusScreen) +#endif + { + mCurrentScreen++; + } + else + { + mCurrentScreen = DemoScreen; + } + + SetScreen(static_cast(mCurrentScreen)); +} + +void SilabsLCD::SetStatus(DisplayStatus_t & status) +{ + mStatus = status; +} + #ifdef QR_CODE_ENABLED void SilabsLCD::WriteQRCode() { @@ -194,19 +283,14 @@ void SilabsLCD::SetQRCode(uint8_t * str, uint32_t size) } } -void SilabsLCD::ShowQRCode(bool show, bool forceRefresh) +void SilabsLCD::ShowQRCode(bool show) { - if (show != mShowQRCode || forceRefresh) + if (mCurrentScreen != QRCodeScreen) { - (show) ? WriteQRCode() : WriteDemoUI(); - mShowQRCode = show; + mCurrentScreen = QRCodeScreen; } -} -void SilabsLCD::ToggleQRCode(void) -{ - (mShowQRCode) ? WriteDemoUI() : WriteQRCode(); - mShowQRCode = !mShowQRCode; + WriteQRCode(); } void SilabsLCD::LCDFillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h) diff --git a/examples/platform/silabs/display/lcd.h b/examples/platform/silabs/display/lcd.h index d375b7a133c9aa..085dd7ef8d6240 100644 --- a/examples/platform/silabs/display/lcd.h +++ b/examples/platform/silabs/display/lcd.h @@ -33,6 +33,22 @@ class SilabsLCD { public: + typedef enum screen + { + DemoScreen = 0, + StatusScreen, + QRCodeScreen, + InvalidScreen, + } Screen_e; + + typedef struct dStatus + { + uint8_t nbFabric = 0; + bool connected = false; + char networkName[50] = { "TODO" }; + bool advertising = false; + } DisplayStatus_t; + typedef void (*customUICB)(GLIB_Context_t * context); CHIP_ERROR Init(uint8_t * name = nullptr, bool initialState = false); void * Context(); @@ -42,10 +58,13 @@ class SilabsLCD void WriteDemoUI(bool state); void SetCustomUI(customUICB cb); + void SetScreen(Screen_e screen); + void CycleScreens(void); + void SetStatus(DisplayStatus_t & status); + #ifdef QR_CODE_ENABLED void SetQRCode(uint8_t * str, uint32_t size); - void ShowQRCode(bool show, bool forceRefresh = false); - void ToggleQRCode(void); + void ShowQRCode(bool show); #endif private: @@ -57,10 +76,10 @@ class SilabsLCD void WriteQRCode(); void WriteDemoUI(); + void WriteStatus(); #ifdef QR_CODE_ENABLED void LCDFillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h); char mQRCodeBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1]; - bool mShowQRCode = true; #endif GLIB_Context_t glibContext; @@ -71,4 +90,7 @@ class SilabsLCD #endif customUICB customUI = nullptr; DemoState_t dState; + + DisplayStatus_t mStatus; + uint8_t mCurrentScreen = DemoScreen; }; diff --git a/examples/pump-app/silabs/src/AppTask.cpp b/examples/pump-app/silabs/src/AppTask.cpp index b37d10852d0bd9..2dab9268a9035c 100644 --- a/examples/pump-app/silabs/src/AppTask.cpp +++ b/examples/pump-app/silabs/src/AppTask.cpp @@ -110,7 +110,7 @@ CHIP_ERROR AppTask::Init() if (!ConnectivityMgr().IsThreadProvisioned()) #endif /* !SL_WIFI */ { - GetLCD().ShowQRCode(true, true); + GetLCD().ShowQRCode(true); } #endif // QR_CODE_ENABLED #endif diff --git a/examples/smoke-co-alarm-app/silabs/src/AppTask.cpp b/examples/smoke-co-alarm-app/silabs/src/AppTask.cpp index 153f2e7073bcb7..0ead0862709abd 100644 --- a/examples/smoke-co-alarm-app/silabs/src/AppTask.cpp +++ b/examples/smoke-co-alarm-app/silabs/src/AppTask.cpp @@ -96,7 +96,7 @@ CHIP_ERROR AppTask::Init() if (!ConnectivityMgr().IsThreadProvisioned()) #endif /* !SL_WIFI */ { - GetLCD().ShowQRCode(true, true); + GetLCD().ShowQRCode(true); } #endif // QR_CODE_ENABLED #endif diff --git a/examples/window-app/silabs/src/AppTask.cpp b/examples/window-app/silabs/src/AppTask.cpp index 4765c48fa4d987..92c80531080acb 100644 --- a/examples/window-app/silabs/src/AppTask.cpp +++ b/examples/window-app/silabs/src/AppTask.cpp @@ -94,7 +94,7 @@ CHIP_ERROR AppTask::Init() if (!ConnectivityMgr().IsThreadProvisioned()) #endif /* !SL_WIFI */ { - GetLCD().ShowQRCode(true, true); + GetLCD().ShowQRCode(true); } #endif // QR_CODE_ENABLED #endif From a9a4259278ba0df5fc76f7a71bf243100b40bbe2 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 15 Sep 2023 16:06:28 -0400 Subject: [PATCH 119/134] Stop using ResolverProxy for resolving node lookups (#29264) * Stop using ResolverProxy for performing Operational node discovery * Switch avahi to be capable to keep track of contexts and handle stopping node resolution * Restyle * Remove obsolete todo * Make sure stop resolve actuall clears multiple entries if they exist * increase log level verbositity for openiot to see progress in pytest * A bit more rich logging in the openiot utils - show successes and failures * report failure on commissioning (likely timeout, but show it since it is not none/bool * Restyle * Switch Dns.cpp to use address resolver for dns resolution * Restyle * remove operational delegate functionality from ResolverDelegateProxy and more cleanups on members/methods * Restyle * Schedule next result to display all results of a discovery * Fix namespacing * Code review update --------- Co-authored-by: Andrei Litvin --- scripts/examples/openiotsdk_example.sh | 2 +- src/lib/dnssd/Discovery_ImplPlatform.cpp | 176 ++++++++---------- src/lib/dnssd/Discovery_ImplPlatform.h | 6 +- src/lib/dnssd/ResolverProxy.h | 63 +------ src/lib/dnssd/Resolver_ImplMinimalMdns.cpp | 19 -- src/lib/dnssd/Resolver_ImplNone.cpp | 7 - src/lib/shell/commands/BUILD.gn | 1 + src/lib/shell/commands/Dns.cpp | 74 +++++--- src/platform/Linux/DnssdImpl.cpp | 98 ++++++++-- src/platform/Linux/DnssdImpl.h | 26 ++- .../integration-tests/common/utils.py | 5 +- 11 files changed, 247 insertions(+), 230 deletions(-) diff --git a/scripts/examples/openiotsdk_example.sh b/scripts/examples/openiotsdk_example.sh index ea33d6026526e9..36c748cc8d1aa2 100755 --- a/scripts/examples/openiotsdk_example.sh +++ b/scripts/examples/openiotsdk_example.sh @@ -268,7 +268,7 @@ function run_test() { fi set +e - pytest --json-report --json-report-summary --json-report-file="$EXAMPLE_TEST_PATH"/test_report_"$EXAMPLE".json --binaryPath="$EXAMPLE_EXE_PATH" --fvp="$FVP_BIN" --fvpConfig="$FVP_CONFIG_FILE" "${TEST_OPTIONS[@]}" "$EXAMPLE_TEST_PATH"/test_app.py + pytest --log-level=INFO --json-report --json-report-summary --json-report-file="$EXAMPLE_TEST_PATH"/test_report_"$EXAMPLE".json --binaryPath="$EXAMPLE_EXE_PATH" --fvp="$FVP_BIN" --fvpConfig="$FVP_CONFIG_FILE" "${TEST_OPTIONS[@]}" "$EXAMPLE_TEST_PATH"/test_app.py set -e if [[ ! -f $EXAMPLE_TEST_PATH/test_report_$EXAMPLE.json ]]; then diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index cf6c127599bf25..a4361f03929f44 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.cpp +++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp @@ -55,70 +55,6 @@ static void HandleNodeResolve(void * context, DnssdService * result, const Span< proxy->Release(); } -static void HandleNodeIdResolve(void * context, DnssdService * result, const Span & addresses, CHIP_ERROR error) -{ - ResolverDelegateProxy * proxy = static_cast(context); - if (CHIP_NO_ERROR != error) - { - proxy->OnOperationalNodeResolutionFailed(PeerId(), error); - proxy->Release(); - return; - } - - VerifyOrDie(proxy != nullptr); - - if (result == nullptr) - { - proxy->OnOperationalNodeResolutionFailed(PeerId(), CHIP_ERROR_UNKNOWN_RESOURCE_ID); - proxy->Release(); - return; - } - - VerifyOrDie(proxy != nullptr); - - PeerId peerId; - error = ExtractIdFromInstanceName(result->mName, &peerId); - if (CHIP_NO_ERROR != error) - { - proxy->OnOperationalNodeResolutionFailed(PeerId(), error); - proxy->Release(); - return; - } - - VerifyOrDie(proxy != nullptr); - - ResolvedNodeData nodeData; - Platform::CopyString(nodeData.resolutionData.hostName, result->mHostName); - nodeData.resolutionData.interfaceId = result->mInterface; - nodeData.resolutionData.port = result->mPort; - nodeData.operationalData.peerId = peerId; - - size_t addressesFound = 0; - for (auto & ip : addresses) - { - if (addressesFound == ArraySize(nodeData.resolutionData.ipAddress)) - { - // Out of space. - ChipLogProgress(Discovery, "Can't add more IPs to ResolvedNodeData"); - break; - } - nodeData.resolutionData.ipAddress[addressesFound] = ip; - ++addressesFound; - } - nodeData.resolutionData.numIPs = addressesFound; - - for (size_t i = 0; i < result->mTextEntrySize; ++i) - { - ByteSpan key(reinterpret_cast(result->mTextEntries[i].mKey), strlen(result->mTextEntries[i].mKey)); - ByteSpan val(result->mTextEntries[i].mData, result->mTextEntries[i].mDataSize); - FillNodeDataFromTxt(key, val, nodeData.resolutionData); - } - - nodeData.LogNodeIdResolved(); - proxy->OnOperationalNodeResolved(nodeData); - proxy->Release(); -} - static void HandleNodeBrowse(void * context, DnssdService * services, size_t servicesSize, bool finalBrowse, CHIP_ERROR error) { ResolverDelegateProxy * proxy = static_cast(context); @@ -336,6 +272,68 @@ CHIP_ERROR AddTxtRecord(TxtFieldKey key, TextEntry * entries, size_t & entriesCo } // namespace +void DiscoveryImplPlatform::HandleNodeIdResolve(void * context, DnssdService * result, const Span & addresses, + CHIP_ERROR error) +{ + DiscoveryImplPlatform * impl = static_cast(context); + + if (impl->mOperationalDelegate == nullptr) + { + ChipLogError(Discovery, "No delegate to handle node resolution data."); + return; + } + + if (CHIP_NO_ERROR != error) + { + impl->mOperationalDelegate->OnOperationalNodeResolutionFailed(PeerId(), error); + return; + } + + if (result == nullptr) + { + impl->mOperationalDelegate->OnOperationalNodeResolutionFailed(PeerId(), CHIP_ERROR_UNKNOWN_RESOURCE_ID); + return; + } + + PeerId peerId; + error = ExtractIdFromInstanceName(result->mName, &peerId); + if (CHIP_NO_ERROR != error) + { + impl->mOperationalDelegate->OnOperationalNodeResolutionFailed(PeerId(), error); + return; + } + + ResolvedNodeData nodeData; + Platform::CopyString(nodeData.resolutionData.hostName, result->mHostName); + nodeData.resolutionData.interfaceId = result->mInterface; + nodeData.resolutionData.port = result->mPort; + nodeData.operationalData.peerId = peerId; + + size_t addressesFound = 0; + for (auto & ip : addresses) + { + if (addressesFound == ArraySize(nodeData.resolutionData.ipAddress)) + { + // Out of space. + ChipLogProgress(Discovery, "Can't add more IPs to ResolvedNodeData"); + break; + } + nodeData.resolutionData.ipAddress[addressesFound] = ip; + ++addressesFound; + } + nodeData.resolutionData.numIPs = addressesFound; + + for (size_t i = 0; i < result->mTextEntrySize; ++i) + { + ByteSpan key(reinterpret_cast(result->mTextEntries[i].mKey), strlen(result->mTextEntries[i].mKey)); + ByteSpan val(result->mTextEntries[i].mData, result->mTextEntries[i].mDataSize); + FillNodeDataFromTxt(key, val, nodeData.resolutionData); + } + + nodeData.LogNodeIdResolved(); + impl->mOperationalDelegate->OnOperationalNodeResolved(nodeData); +} + void DnssdService::ToDiscoveredNodeData(const Span & addresses, DiscoveredNodeData & nodeData) { auto & resolutionData = nodeData.resolutionData; @@ -633,15 +631,27 @@ bool DiscoveryImplPlatform::IsInitialized() CHIP_ERROR DiscoveryImplPlatform::ResolveNodeId(const PeerId & peerId) { - ReturnErrorOnFailure(InitImpl()); - return mResolverProxy.ResolveNodeId(peerId); + // Resolve requests can only be issued once DNSSD is initialized and there is + // no caching currently + VerifyOrReturnError(mState == State::kInitialized, CHIP_ERROR_INCORRECT_STATE); + + ChipLogProgress(Discovery, "Resolving " ChipLogFormatX64 ":" ChipLogFormatX64 " ...", + ChipLogValueX64(peerId.GetCompressedFabricId()), ChipLogValueX64(peerId.GetNodeId())); + + DnssdService service; + + ReturnErrorOnFailure(MakeInstanceName(service.mName, sizeof(service.mName), peerId)); + Platform::CopyString(service.mType, kOperationalServiceName); + service.mProtocol = DnssdServiceProtocol::kDnssdProtocolTcp; + service.mAddressType = Inet::IPAddressType::kAny; + + return ChipDnssdResolve(&service, Inet::InterfaceId::Null(), HandleNodeIdResolve, this); } void DiscoveryImplPlatform::NodeIdResolutionNoLongerNeeded(const PeerId & peerId) { char name[Common::kInstanceNameMaxLength + 1]; ReturnOnFailure(MakeInstanceName(name, sizeof(name), peerId)); - ChipDnssdResolveNoLongerNeeded(name); } @@ -684,38 +694,6 @@ Resolver & chip::Dnssd::Resolver::Instance() return DiscoveryImplPlatform::GetInstance(); } -CHIP_ERROR ResolverProxy::ResolveNodeId(const PeerId & peerId) -{ - VerifyOrReturnError(mDelegate != nullptr, CHIP_ERROR_INCORRECT_STATE); - - ChipLogProgress(Discovery, "Resolving " ChipLogFormatX64 ":" ChipLogFormatX64 " ...", - ChipLogValueX64(peerId.GetCompressedFabricId()), ChipLogValueX64(peerId.GetNodeId())); - - DnssdService service; - - ReturnErrorOnFailure(MakeInstanceName(service.mName, sizeof(service.mName), peerId)); - Platform::CopyString(service.mType, kOperationalServiceName); - service.mProtocol = DnssdServiceProtocol::kDnssdProtocolTcp; - service.mAddressType = Inet::IPAddressType::kAny; - - mDelegate->Retain(); - - CHIP_ERROR err = ChipDnssdResolve(&service, Inet::InterfaceId::Null(), HandleNodeIdResolve, mDelegate); - if (err != CHIP_NO_ERROR) - { - mDelegate->Release(); - } - return err; -} - -void ResolverProxy::NodeIdResolutionNoLongerNeeded(const PeerId & peerId) -{ - char name[Common::kInstanceNameMaxLength + 1]; - ReturnOnFailure(MakeInstanceName(name, sizeof(name), peerId)); - - ChipDnssdResolveNoLongerNeeded(name); -} - ResolverProxy::~ResolverProxy() { Shutdown(); diff --git a/src/lib/dnssd/Discovery_ImplPlatform.h b/src/lib/dnssd/Discovery_ImplPlatform.h index 1bc75f105d0efd..e483a589de8adb 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.h +++ b/src/lib/dnssd/Discovery_ImplPlatform.h @@ -50,7 +50,7 @@ class DiscoveryImplPlatform : public ServiceAdvertiser, public Resolver CHIP_ERROR UpdateCommissionableInstanceName() override; // Members that implement Resolver interface. - void SetOperationalDelegate(OperationalResolveDelegate * delegate) override { mResolverProxy.SetOperationalDelegate(delegate); } + void SetOperationalDelegate(OperationalResolveDelegate * delegate) override { mOperationalDelegate = delegate; } void SetCommissioningDelegate(CommissioningResolveDelegate * delegate) override { mResolverProxy.SetCommissioningDelegate(delegate); @@ -91,9 +91,13 @@ class DiscoveryImplPlatform : public ServiceAdvertiser, public Resolver size_t subTypeSize, uint16_t port, Inet::InterfaceId interfaceId, const chip::ByteSpan & mac, DnssdServiceProtocol procotol, PeerId peerId); + static void HandleNodeIdResolve(void * context, DnssdService * result, const Span & addresses, + CHIP_ERROR error); + State mState = State::kUninitialized; uint8_t mCommissionableInstanceName[sizeof(uint64_t)]; ResolverProxy mResolverProxy; + OperationalResolveDelegate * mOperationalDelegate = nullptr; static DiscoveryImplPlatform sManager; }; diff --git a/src/lib/dnssd/ResolverProxy.h b/src/lib/dnssd/ResolverProxy.h index feff0a6bb4da73..176316ef8cd053 100644 --- a/src/lib/dnssd/ResolverProxy.h +++ b/src/lib/dnssd/ResolverProxy.h @@ -23,40 +23,12 @@ namespace chip { namespace Dnssd { -class ResolverDelegateProxy : public ReferenceCounted, - public OperationalResolveDelegate, - public CommissioningResolveDelegate +class ResolverDelegateProxy : public ReferenceCounted, public CommissioningResolveDelegate { public: - void SetOperationalDelegate(OperationalResolveDelegate * delegate) { mOperationalDelegate = delegate; } void SetCommissioningDelegate(CommissioningResolveDelegate * delegate) { mCommissioningDelegate = delegate; } - // OperationalResolveDelegate - void OnOperationalNodeResolved(const ResolvedNodeData & nodeData) override - { - if (mOperationalDelegate != nullptr) - { - mOperationalDelegate->OnOperationalNodeResolved(nodeData); - } - else - { - ChipLogError(Discovery, "Missing operational delegate. Data discarded."); - } - } - - void OnOperationalNodeResolutionFailed(const PeerId & peerId, CHIP_ERROR error) override - { - if (mOperationalDelegate != nullptr) - { - mOperationalDelegate->OnOperationalNodeResolutionFailed(peerId, error); - } - else - { - ChipLogError(Discovery, "Missing operational delegate. Failure info discarded."); - } - } - // CommissioningResolveDelegate void OnNodeDiscovered(const DiscoveredNodeData & nodeData) override { @@ -71,7 +43,6 @@ class ResolverDelegateProxy : public ReferenceCounted, } private: - OperationalResolveDelegate * mOperationalDelegate = nullptr; CommissioningResolveDelegate * mCommissioningDelegate = nullptr; }; @@ -90,13 +61,6 @@ class ResolverProxy : public Resolver if (mDelegate != nullptr) { - if (mPreInitOperationalDelegate != nullptr) - { - ChipLogProgress(Discovery, "Setting operational delegate post init"); - mDelegate->SetOperationalDelegate(mPreInitOperationalDelegate); - mPreInitOperationalDelegate = nullptr; - } - if (mPreInitCommissioningDelegate != nullptr) { ChipLogProgress(Discovery, "Setting commissioning delegate post init"); @@ -112,18 +76,10 @@ class ResolverProxy : public Resolver void SetOperationalDelegate(OperationalResolveDelegate * delegate) override { - if (mDelegate != nullptr) - { - mDelegate->SetOperationalDelegate(delegate); - } - else - { - if (delegate != nullptr) - { - ChipLogProgress(Discovery, "Delaying proxy of operational discovery: missing delegate"); - } - mPreInitOperationalDelegate = delegate; - } + /// Unfortunately cannot remove this method since it is in a Resolver interface. + ChipLogError(Discovery, "!!! Operational proxy does NOT support operational discovery"); + ChipLogError(Discovery, "!!! Please use AddressResolver or DNSSD Resolver directly"); + chipDie(); // force detection of invalid usages. } void SetCommissioningDelegate(CommissioningResolveDelegate * delegate) override @@ -145,22 +101,23 @@ class ResolverProxy : public Resolver void Shutdown() override { VerifyOrReturn(mDelegate != nullptr); - mDelegate->SetOperationalDelegate(nullptr); mDelegate->SetCommissioningDelegate(nullptr); mDelegate->Release(); mDelegate = nullptr; } - CHIP_ERROR ResolveNodeId(const PeerId & peerId) override; - void NodeIdResolutionNoLongerNeeded(const PeerId & peerId) override; CHIP_ERROR DiscoverCommissionableNodes(DiscoveryFilter filter = DiscoveryFilter()) override; CHIP_ERROR DiscoverCommissioners(DiscoveryFilter filter = DiscoveryFilter()) override; CHIP_ERROR StopDiscovery() override; CHIP_ERROR ReconfirmRecord(const char * hostname, Inet::IPAddress address, Inet::InterfaceId interfaceId) override; + // TODO: ResolverProxy should not be used anymore to implement operational node resolution + // This method still here because Resolver interface requires it + CHIP_ERROR ResolveNodeId(const PeerId & peerId) override { return CHIP_ERROR_NOT_IMPLEMENTED; } + void NodeIdResolutionNoLongerNeeded(const PeerId & peerId) override {} + private: ResolverDelegateProxy * mDelegate = nullptr; - OperationalResolveDelegate * mPreInitOperationalDelegate = nullptr; CommissioningResolveDelegate * mPreInitCommissioningDelegate = nullptr; // While discovery (commissionable or commissioner) is ongoing, diff --git a/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp b/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp index 36ead8c9e5cb75..416c747d830cc6 100644 --- a/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp +++ b/src/lib/dnssd/Resolver_ImplMinimalMdns.cpp @@ -748,25 +748,6 @@ ResolverProxy::~ResolverProxy() Shutdown(); } -// Minimal implementation does not support associating a context to a request (while platforms implementations do). So keep -// updating the delegate that ends up being used by the server by calling 'SetOperationalDelegate'. -// This effectively allow minimal to have multiple controllers issuing requests as long the requests are serialized, but -// it won't work well if requests are issued in parallel. -CHIP_ERROR ResolverProxy::ResolveNodeId(const PeerId & peerId) -{ - VerifyOrReturnError(mDelegate != nullptr, CHIP_ERROR_INCORRECT_STATE); - - ChipLogProgress(Discovery, "Resolving " ChipLogFormatX64 ":" ChipLogFormatX64 " ...", - ChipLogValueX64(peerId.GetCompressedFabricId()), ChipLogValueX64(peerId.GetNodeId())); - chip::Dnssd::Resolver::Instance().SetOperationalDelegate(mDelegate); - return chip::Dnssd::Resolver::Instance().ResolveNodeId(peerId); -} - -void ResolverProxy::NodeIdResolutionNoLongerNeeded(const PeerId & peerId) -{ - return chip::Dnssd::Resolver::Instance().NodeIdResolutionNoLongerNeeded(peerId); -} - CHIP_ERROR ResolverProxy::DiscoverCommissionableNodes(DiscoveryFilter filter) { VerifyOrReturnError(mDelegate != nullptr, CHIP_ERROR_INCORRECT_STATE); diff --git a/src/lib/dnssd/Resolver_ImplNone.cpp b/src/lib/dnssd/Resolver_ImplNone.cpp index 2dd591aa4ad759..3d0d97f57cd449 100644 --- a/src/lib/dnssd/Resolver_ImplNone.cpp +++ b/src/lib/dnssd/Resolver_ImplNone.cpp @@ -68,13 +68,6 @@ ResolverProxy::~ResolverProxy() Shutdown(); } -CHIP_ERROR ResolverProxy::ResolveNodeId(const PeerId & peerId) -{ - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -void ResolverProxy::NodeIdResolutionNoLongerNeeded(const PeerId & peerId) {} - CHIP_ERROR ResolverProxy::DiscoverCommissionableNodes(DiscoveryFilter filter) { return CHIP_ERROR_NOT_IMPLEMENTED; diff --git a/src/lib/shell/commands/BUILD.gn b/src/lib/shell/commands/BUILD.gn index 20ec201984678b..05a6a0e2660ff4 100644 --- a/src/lib/shell/commands/BUILD.gn +++ b/src/lib/shell/commands/BUILD.gn @@ -50,6 +50,7 @@ source_set("commands") { if (chip_device_platform != "none") { sources += [ "Dns.cpp" ] + public_deps += [ "${chip_root}/src/lib/address_resolve" ] } if (chip_enable_ota_requestor && chip_device_platform != "none" && diff --git a/src/lib/shell/commands/Dns.cpp b/src/lib/shell/commands/Dns.cpp index 0717d4235f4d9b..83fd12fc0b3ff1 100644 --- a/src/lib/shell/commands/Dns.cpp +++ b/src/lib/shell/commands/Dns.cpp @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -39,40 +40,47 @@ Shell::Engine sShellDnsBrowseSubcommands; Shell::Engine sShellDnsSubcommands; Dnssd::ResolverProxy sResolverProxy; -class DnsShellResolverDelegate : public Dnssd::OperationalResolveDelegate, public Dnssd::CommissioningResolveDelegate +class DnsShellResolverDelegate : public Dnssd::CommissioningResolveDelegate, public AddressResolve::NodeListener { public: - void OnOperationalNodeResolved(const Dnssd::ResolvedNodeData & nodeData) override + DnsShellResolverDelegate() { mSelfHandle.SetListener(this); } + + void OnNodeAddressResolved(const PeerId & peerId, const AddressResolve::ResolveResult & result) override { - sResolverProxy.NodeIdResolutionNoLongerNeeded(nodeData.operationalData.peerId); streamer_printf(streamer_get(), "DNS resolve for " ChipLogFormatX64 "-" ChipLogFormatX64 " succeeded:\r\n", - ChipLogValueX64(nodeData.operationalData.peerId.GetCompressedFabricId()), - ChipLogValueX64(nodeData.operationalData.peerId.GetNodeId())); - streamer_printf(streamer_get(), " Hostname: %s\r\n", nodeData.resolutionData.hostName); - for (size_t i = 0; i < nodeData.resolutionData.numIPs; ++i) - { - streamer_printf(streamer_get(), " IP address: %s\r\n", nodeData.resolutionData.ipAddress[i].ToString(ipAddressBuf)); - } - streamer_printf(streamer_get(), " Port: %u\r\n", nodeData.resolutionData.port); - - auto retryInterval = nodeData.resolutionData.GetMrpRetryIntervalIdle(); - - if (retryInterval.HasValue()) - streamer_printf(streamer_get(), " MRP retry interval (idle): %" PRIu32 "ms\r\n", retryInterval.Value()); - - retryInterval = nodeData.resolutionData.GetMrpRetryIntervalActive(); - - if (retryInterval.HasValue()) - streamer_printf(streamer_get(), " MRP retry interval (active): %" PRIu32 "ms\r\n", retryInterval.Value()); - - streamer_printf(streamer_get(), " Supports TCP: %s\r\n", nodeData.resolutionData.supportsTcp ? "yes" : "no"); + ChipLogValueX64(peerId.GetCompressedFabricId()), ChipLogValueX64(peerId.GetNodeId())); + + char addr_string[Transport::PeerAddress::kMaxToStringSize]; + result.address.ToString(addr_string); + + streamer_printf(streamer_get(), "Resolve completed: %s\r\n", addr_string); + streamer_printf(streamer_get(), " Supports TCP: %s\r\n", result.supportsTcp ? "YES" : "NO"); + streamer_printf(streamer_get(), " MRP IDLE retransmit timeout: %u ms\r\n", + result.mrpRemoteConfig.mIdleRetransTimeout.count()); + streamer_printf(streamer_get(), " MRP ACTIVE retransmit timeout: %u ms\r\n", + result.mrpRemoteConfig.mActiveRetransTimeout.count()); + streamer_printf(streamer_get(), " MRP ACTIVE Threshold timet: %u ms\r\n", + result.mrpRemoteConfig.mActiveThresholdTime.count()); + + // Schedule a retry. Not called directly so we do not recurse in OnNodeAddressResolved + DeviceLayer::SystemLayer().ScheduleLambda([this] { + CHIP_ERROR err = AddressResolve::Resolver::Instance().TryNextResult(Handle()); + if (err != CHIP_NO_ERROR && err != CHIP_ERROR_WELL_EMPTY) + { + ChipLogError(Discovery, "Failed to list next result: %" CHIP_ERROR_FORMAT, err.Format()); + } + }); } - void OnOperationalNodeResolutionFailed(const PeerId & peerId, CHIP_ERROR error) override + void OnNodeAddressResolutionFailed(const PeerId & peerId, CHIP_ERROR reason) override { - sResolverProxy.NodeIdResolutionNoLongerNeeded(peerId); + streamer_printf(streamer_get(), + "DNS resolve for " ChipLogFormatX64 "-" ChipLogFormatX64 " failed: %" CHIP_ERROR_FORMAT "\r\n", + ChipLogValueX64(peerId.GetCompressedFabricId()), ChipLogValueX64(peerId.GetNodeId()), reason.Format()); } + AddressResolve::NodeLookupHandle & Handle() { return mSelfHandle; } + void OnNodeDiscovered(const Dnssd::DiscoveredNodeData & nodeData) override { if (!nodeData.resolutionData.IsValid()) @@ -118,6 +126,7 @@ class DnsShellResolverDelegate : public Dnssd::OperationalResolveDelegate, publi private: char ipAddressBuf[Inet::IPAddress::kMaxStringLength]; + AddressResolve::NodeLookupHandle mSelfHandle; }; DnsShellResolverDelegate sDnsShellResolverDelegate; @@ -126,13 +135,19 @@ CHIP_ERROR ResolveHandler(int argc, char ** argv) { VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT); + if (sDnsShellResolverDelegate.Handle().IsActive()) + { + streamer_printf(streamer_get(), "Cancelling previous resolve...\r\n"); + LogErrorOnFailure(AddressResolve::Resolver::Instance().CancelLookup(sDnsShellResolverDelegate.Handle(), + AddressResolve::Resolver::FailureCallback::Call)); + } + streamer_printf(streamer_get(), "Resolving ...\r\n"); - PeerId peerId; - peerId.SetCompressedFabricId(strtoull(argv[0], nullptr, 10)); - peerId.SetNodeId(strtoull(argv[1], nullptr, 10)); + AddressResolve::NodeLookupRequest request( + PeerId().SetCompressedFabricId(strtoull(argv[0], nullptr, 10)).SetNodeId(strtoull(argv[1], nullptr, 10))); - return sResolverProxy.ResolveNodeId(peerId); + return AddressResolve::Resolver::Instance().LookupNode(request, sDnsShellResolverDelegate.Handle()); } bool ParseSubType(int argc, char ** argv, Dnssd::DiscoveryFilter & filter) @@ -230,7 +245,6 @@ CHIP_ERROR DnsHandler(int argc, char ** argv) } sResolverProxy.Init(DeviceLayer::UDPEndPointManager()); - sResolverProxy.SetOperationalDelegate(&sDnsShellResolverDelegate); sResolverProxy.SetCommissioningDelegate(&sDnsShellResolverDelegate); return sShellDnsSubcommands.ExecCommand(argc, argv); diff --git a/src/platform/Linux/DnssdImpl.cpp b/src/platform/Linux/DnssdImpl.cpp index fa72836ef8b160..5f46dd24d8728f 100644 --- a/src/platform/Linux/DnssdImpl.cpp +++ b/src/platform/Linux/DnssdImpl.cpp @@ -779,18 +779,69 @@ void MdnsAvahi::HandleBrowse(AvahiServiceBrowser * browser, AvahiIfIndex interfa } } +MdnsAvahi::ResolveContext * MdnsAvahi::AllocateResolveContext() +{ + ResolveContext * context = chip::Platform::New(); + if (context == nullptr) + { + return nullptr; + } + + context->mNumber = mResolveCount++; + mAllocatedResolves.push_back(context); + + return context; +} + +MdnsAvahi::ResolveContext * MdnsAvahi::ResolveContextForHandle(size_t handle) +{ + for (auto it : mAllocatedResolves) + { + if (it->mNumber == handle) + { + return it; + } + } + return nullptr; +} + +void MdnsAvahi::FreeResolveContext(size_t handle) +{ + for (auto it = mAllocatedResolves.begin(); it != mAllocatedResolves.end(); it++) + { + if ((*it)->mNumber == handle) + { + chip::Platform::Delete(*it); + mAllocatedResolves.erase(it); + return; + } + } +} + +void MdnsAvahi::StopResolve(const char * name) +{ + auto truncate_end = std::remove_if(mAllocatedResolves.begin(), mAllocatedResolves.end(), + [name](ResolveContext * ctx) { return strcmp(ctx->mName, name) == 0; }); + + for (auto it = truncate_end; it != mAllocatedResolves.end(); it++) + { + (*it)->mCallback((*it)->mContext, nullptr, Span(), CHIP_ERROR_CANCELLED); + chip::Platform::Delete(*it); + } + + mAllocatedResolves.erase(truncate_end, mAllocatedResolves.end()); +} + CHIP_ERROR MdnsAvahi::Resolve(const char * name, const char * type, DnssdServiceProtocol protocol, Inet::IPAddressType addressType, Inet::IPAddressType transportType, Inet::InterfaceId interface, DnssdResolveCallback callback, void * context) { - AvahiServiceResolver * resolver; AvahiIfIndex avahiInterface = static_cast(interface.GetPlatformInterface()); - ResolveContext * resolveContext = chip::Platform::New(); + ResolveContext * resolveContext = AllocateResolveContext(); CHIP_ERROR error = CHIP_NO_ERROR; - - resolveContext->mInstance = this; - resolveContext->mCallback = callback; - resolveContext->mContext = context; + resolveContext->mInstance = this; + resolveContext->mCallback = callback; + resolveContext->mContext = context; if (!interface.IsPresent()) { @@ -803,15 +854,17 @@ CHIP_ERROR MdnsAvahi::Resolve(const char * name, const char * type, DnssdService resolveContext->mAddressType = ToAvahiProtocol(addressType); resolveContext->mFullType = GetFullType(type, protocol); - resolver = avahi_service_resolver_new(mClient, avahiInterface, resolveContext->mTransport, name, - resolveContext->mFullType.c_str(), nullptr, resolveContext->mAddressType, - static_cast(0), HandleResolve, resolveContext); + AvahiServiceResolver * resolver = + avahi_service_resolver_new(mClient, avahiInterface, resolveContext->mTransport, name, resolveContext->mFullType.c_str(), + nullptr, resolveContext->mAddressType, static_cast(0), HandleResolve, + reinterpret_cast(resolveContext->mNumber)); // Otherwise the resolver will be freed in the callback if (resolver == nullptr) { error = CHIP_ERROR_INTERNAL; chip::Platform::Delete(resolveContext); } + resolveContext->mResolver = resolver; return error; } @@ -821,9 +874,16 @@ void MdnsAvahi::HandleResolve(AvahiServiceResolver * resolver, AvahiIfIndex inte const char * host_name, const AvahiAddress * address, uint16_t port, AvahiStringList * txt, AvahiLookupResultFlags flags, void * userdata) { - ResolveContext * context = reinterpret_cast(userdata); + size_t handle = reinterpret_cast(userdata); + ResolveContext * context = sInstance.ResolveContextForHandle(handle); std::vector textEntries; + if (context == nullptr) + { + ChipLogError(Discovery, "Invalid context for handling resolves: %ld", static_cast(handle)); + return; + } + switch (event) { case AVAHI_RESOLVER_FAILURE: @@ -831,14 +891,14 @@ void MdnsAvahi::HandleResolve(AvahiServiceResolver * resolver, AvahiIfIndex inte { ChipLogProgress(DeviceLayer, "Re-trying resolve"); avahi_service_resolver_free(resolver); - resolver = avahi_service_resolver_new(context->mInstance->mClient, context->mInterface, context->mTransport, - context->mName, context->mFullType.c_str(), nullptr, context->mAddressType, - static_cast(0), HandleResolve, context); - if (resolver == nullptr) + context->mResolver = avahi_service_resolver_new( + context->mInstance->mClient, context->mInterface, context->mTransport, context->mName, context->mFullType.c_str(), + nullptr, context->mAddressType, static_cast(0), HandleResolve, context); + if (context->mResolver == nullptr) { ChipLogError(DeviceLayer, "Avahi resolve failed on retry"); context->mCallback(context->mContext, nullptr, Span(), CHIP_ERROR_INTERNAL); - chip::Platform::Delete(context); + sInstance.FreeResolveContext(handle); } return; } @@ -930,8 +990,7 @@ void MdnsAvahi::HandleResolve(AvahiServiceResolver * resolver, AvahiIfIndex inte break; } - avahi_service_resolver_free(resolver); - chip::Platform::Delete(context); + sInstance.FreeResolveContext(handle); } CHIP_ERROR ChipDnssdInit(DnssdAsyncReturnCallback initCallback, DnssdAsyncReturnCallback errorCallback, void * context) @@ -988,7 +1047,10 @@ CHIP_ERROR ChipDnssdResolve(DnssdService * browseResult, chip::Inet::InterfaceId browseResult->mAddressType, Inet::IPAddressType::kAny, interface, callback, context); } -void ChipDnssdResolveNoLongerNeeded(const char * instanceName) {} +void ChipDnssdResolveNoLongerNeeded(const char * instanceName) +{ + MdnsAvahi::GetInstance().StopResolve(instanceName); +} CHIP_ERROR ChipDnssdReconfirmRecord(const char * hostname, chip::Inet::IPAddress address, chip::Inet::InterfaceId interface) { diff --git a/src/platform/Linux/DnssdImpl.h b/src/platform/Linux/DnssdImpl.h index e875e97830ebbf..2914a888c29381 100644 --- a/src/platform/Linux/DnssdImpl.h +++ b/src/platform/Linux/DnssdImpl.h @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -115,6 +116,7 @@ class MdnsAvahi CHIP_ERROR Resolve(const char * name, const char * type, DnssdServiceProtocol protocol, chip::Inet::IPAddressType addressType, chip::Inet::IPAddressType transportType, chip::Inet::InterfaceId interface, DnssdResolveCallback callback, void * context); + void StopResolve(const char * name); Poller & GetPoller() { return mPoller; } @@ -137,6 +139,7 @@ class MdnsAvahi struct ResolveContext { + size_t mNumber; // unique number for this context MdnsAvahi * mInstance; DnssdResolveCallback mCallback; void * mContext; @@ -145,12 +148,29 @@ class MdnsAvahi AvahiProtocol mTransport; AvahiProtocol mAddressType; std::string mFullType; - uint8_t mAttempts = 0; + uint8_t mAttempts = 0; + AvahiServiceResolver * mResolver = nullptr; + + ~ResolveContext() + { + if (mResolver != nullptr) + { + avahi_service_resolver_free(mResolver); + mResolver = nullptr; + } + } }; MdnsAvahi() : mClient(nullptr) {} static MdnsAvahi sInstance; + /// Allocates a new resolve context with a unique `mNumber` + ResolveContext * AllocateResolveContext(); + + ResolveContext * ResolveContextForHandle(size_t handle); + void FreeResolveContext(size_t handle); + void FreeResolveContext(const char * name); + static void HandleClientState(AvahiClient * client, AvahiClientState state, void * context); void HandleClientState(AvahiClient * client, AvahiClientState state); @@ -174,6 +194,10 @@ class MdnsAvahi std::map mPublishedGroups; Poller mPoller; static constexpr size_t kMaxBrowseRetries = 4; + + // Handling of allocated resolves + size_t mResolveCount = 0; + std::list mAllocatedResolves; }; } // namespace Dnssd diff --git a/src/test_driver/openiotsdk/integration-tests/common/utils.py b/src/test_driver/openiotsdk/integration-tests/common/utils.py index 5b6e5c7f3d3332..1865cf6274f6ed 100644 --- a/src/test_driver/openiotsdk/integration-tests/common/utils.py +++ b/src/test_driver/openiotsdk/integration-tests/common/utils.py @@ -72,6 +72,7 @@ def discover_device(devCtrl, setupPayload): if not res: log.info("Device not found") return None + log.info("Device found at %r" % res[0]) return res[0] @@ -87,6 +88,8 @@ def connect_device(devCtrl, setupPayload, commissionableDevice, nodeId=None): if nodeId is None: nodeId = random.randint(1, 1000000) + log.info("Connecting to device %d" % nodeId) + pincode = int(setupPayload.attributes['SetUpPINCode']) try: res = devCtrl.CommissionOnNetwork( @@ -95,7 +98,7 @@ def connect_device(devCtrl, setupPayload, commissionableDevice, nodeId=None): log.error("Commission discovered device failed {}".format(str(ex))) return None if not res: - log.info("Commission discovered device failed") + log.info("Commission discovered device failed: %r" % res) return None return nodeId From 6e3d0450d3e5371cba72eb8175c67f5bd9a3deed Mon Sep 17 00:00:00 2001 From: yunhanw-google Date: Fri, 15 Sep 2023 19:32:28 -0700 Subject: [PATCH 120/134] [Android]Enable OTA Provider in Android controller (#28316) * move MTRIMDispatch.mm and MTRControllerAccessControl * Add dynamic dispatcher and access control for Android controller * Fix spelling of "controller". * Make Matter.framework work with the new setup. * address comment * Restyled by gn --------- Co-authored-by: Boris Zbarsky Co-authored-by: Restyled.io --- examples/java-matter-controller/args.gni | 1 + src/app/BUILD.gn | 18 +- src/app/common_flags.gni | 1 + .../dynamic_server/AccessControl.cpp} | 42 +- .../dynamic_server/AccessControl.h} | 26 +- src/app/dynamic_server/DynamicDispatcher.cpp | 390 ++++++++++++++++++ .../java/AndroidCommissioningWindowOpener.cpp | 1 - src/controller/java/BUILD.gn | 6 + .../java/CHIPDeviceController-JNI.cpp | 8 + src/darwin/Framework/CHIP/BUILD.gn | 1 - .../CHIP/MTRDeviceControllerFactory.mm | 4 +- src/darwin/Framework/CHIP/MTRIMDispatch.mm | 352 ---------------- .../Matter.xcodeproj/project.pbxproj | 26 -- .../Framework/chip_xcode_build_connector.sh | 1 + 14 files changed, 457 insertions(+), 420 deletions(-) rename src/{darwin/Framework/CHIP/MTRControllerAccessControl.mm => app/dynamic_server/AccessControl.cpp} (76%) rename src/{darwin/Framework/CHIP/MTRControllerAccessControl.h => app/dynamic_server/AccessControl.h} (66%) create mode 100644 src/app/dynamic_server/DynamicDispatcher.cpp delete mode 100644 src/darwin/Framework/CHIP/MTRIMDispatch.mm diff --git a/examples/java-matter-controller/args.gni b/examples/java-matter-controller/args.gni index 5d279bfa552053..af9681d8d85eef 100644 --- a/examples/java-matter-controller/args.gni +++ b/examples/java-matter-controller/args.gni @@ -24,3 +24,4 @@ chip_project_config_include_dirs = [ "${chip_root}/examples/java-matter-controller/include" ] chip_project_config_include_dirs += [ "${chip_root}/config/standalone" ] chip_stack_lock_tracking = "fatal" +chip_build_controller_dynamic_server = true diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn index a4028a7a7449ef..5f3c1b5a320710 100644 --- a/src/app/BUILD.gn +++ b/src/app/BUILD.gn @@ -14,9 +14,8 @@ import("//build_overrides/chip.gni") import("//build_overrides/nlio.gni") -import("${chip_root}/src/platform/device.gni") - import("${chip_root}/build/chip/buildconfig_header.gni") +import("${chip_root}/src/platform/device.gni") import("common_flags.gni") import("icd/icd.gni") @@ -209,6 +208,21 @@ static_library("app") { ] } + if (chip_build_controller_dynamic_server) { + defines = [ + "CHIP_CONFIG_SKIP_APP_SPECIFIC_GENERATED_HEADER_INCLUDES=1", + "CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=1", + ] + sources += [ + "clusters/ota-provider/ota-provider.cpp", + "dynamic_server/AccessControl.cpp", + "dynamic_server/AccessControl.h", + "dynamic_server/DynamicDispatcher.cpp", + "util/privilege-storage.cpp", + "util/privilege-storage.h", + ] + } + if (chip_enable_read_client) { sources += [ "BufferedReadCallback.cpp", diff --git a/src/app/common_flags.gni b/src/app/common_flags.gni index 5e5a82afd7d5e1..7565bfd223ff45 100644 --- a/src/app/common_flags.gni +++ b/src/app/common_flags.gni @@ -16,4 +16,5 @@ declare_args() { # Temporary flag for interaction model and echo protocols, set it to true to enable chip_app_use_echo = false chip_enable_read_client = true + chip_build_controller_dynamic_server = false } diff --git a/src/darwin/Framework/CHIP/MTRControllerAccessControl.mm b/src/app/dynamic_server/AccessControl.cpp similarity index 76% rename from src/darwin/Framework/CHIP/MTRControllerAccessControl.mm rename to src/app/dynamic_server/AccessControl.cpp index 8ea39e55fb2bec..b7bd76ae1e4d2d 100644 --- a/src/darwin/Framework/CHIP/MTRControllerAccessControl.mm +++ b/src/app/dynamic_server/AccessControl.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Project CHIP Authors + * Copyright (c) 2022-2023 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "MTRControllerAccessControl.h" +#include "AccessControl.h" #include #include @@ -30,10 +30,11 @@ namespace { // TODO: Maybe consider making this configurable? See also -// CHIPIMDispatch.mm. +// DynamicDispatch.cpp. constexpr EndpointId kSupportedEndpoint = 0; -class DeviceTypeResolver : public Access::AccessControl::DeviceTypeResolver { +class DeviceTypeResolver : public Access::AccessControl::DeviceTypeResolver +{ public: bool IsDeviceTypeOnEndpoint(DeviceTypeId deviceType, EndpointId endpoint) override { @@ -42,22 +43,26 @@ bool IsDeviceTypeOnEndpoint(DeviceTypeId deviceType, EndpointId endpoint) overri } gDeviceTypeResolver; // TODO: Make the policy more configurable by consumers. -class AccessControlDelegate : public Access::AccessControl::Delegate { - CHIP_ERROR Check( - const SubjectDescriptor & subjectDescriptor, const RequestPath & requestPath, Privilege requestPrivilege) override +class AccessControlDelegate : public Access::AccessControl::Delegate +{ + CHIP_ERROR Check(const SubjectDescriptor & subjectDescriptor, const RequestPath & requestPath, + Privilege requestPrivilege) override { - if (requestPath.endpoint != kSupportedEndpoint || requestPath.cluster != OtaSoftwareUpdateProvider::Id) { + if (requestPath.endpoint != kSupportedEndpoint || requestPath.cluster != OtaSoftwareUpdateProvider::Id) + { // We only allow access to OTA software update provider. return CHIP_ERROR_ACCESS_DENIED; } - if (requestPrivilege != Privilege::kOperate) { + if (requestPrivilege != Privilege::kOperate) + { // The commands on OtaSoftwareUpdateProvider all require // Operate; we should not be asked for anything else. return CHIP_ERROR_ACCESS_DENIED; } - if (subjectDescriptor.authMode != AuthMode::kCase && subjectDescriptor.authMode != AuthMode::kPase) { + if (subjectDescriptor.authMode != AuthMode::kCase && subjectDescriptor.authMode != AuthMode::kPase) + { // No idea who is asking; deny for now. return CHIP_ERROR_ACCESS_DENIED; } @@ -71,14 +76,13 @@ CHIP_ERROR Check( AccessControlDelegate gDelegate; } // anonymous namespace -@implementation MTRControllerAccessControl - -+ (void)init +namespace chip { +namespace app { +namespace dynamic_server { +void InitAccessControl() { - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - GetAccessControl().Init(&gDelegate, gDeviceTypeResolver); - }); + GetAccessControl().Init(&gDelegate, gDeviceTypeResolver); } - -@end +} // namespace dynamic_server +} // namespace app +} // namespace chip diff --git a/src/darwin/Framework/CHIP/MTRControllerAccessControl.h b/src/app/dynamic_server/AccessControl.h similarity index 66% rename from src/darwin/Framework/CHIP/MTRControllerAccessControl.h rename to src/app/dynamic_server/AccessControl.h index 81060ddca6d0b4..e5be582797e671 100644 --- a/src/darwin/Framework/CHIP/MTRControllerAccessControl.h +++ b/src/app/dynamic_server/AccessControl.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Project CHIP Authors + * Copyright (c) 2022-2023 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,24 +15,16 @@ */ #pragma once -#import -#import - -NS_ASSUME_NONNULL_BEGIN - -MTR_HIDDEN -@interface MTRControllerAccessControl : NSObject - -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)new NS_UNAVAILABLE; -+ (instancetype)alloc NS_UNAVAILABLE; +// Experimental API for Access Control +namespace chip { +namespace app { +namespace dynamic_server { /** * Initialize the access control module. Must be called on the Matter task * queue. */ -+ (void)init; - -@end - -NS_ASSUME_NONNULL_END +void InitAccessControl(); +} // namespace dynamic_server +} // namespace app +} // namespace chip diff --git a/src/app/dynamic_server/DynamicDispatcher.cpp b/src/app/dynamic_server/DynamicDispatcher.cpp new file mode 100644 index 00000000000000..05521627364d31 --- /dev/null +++ b/src/app/dynamic_server/DynamicDispatcher.cpp @@ -0,0 +1,390 @@ +/* + * + * Copyright (c) 2022-2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * This file defines the APIs needed to handle interaction model dispatch. + * These are the APIs normally defined in + * src/app/util/ember-compatibility-functions.cpp and the generated + * IMClusterCommandHandler.cpp but we want a different implementation of these + * to enable more dynamic behavior, since not all framework consumers will be + * implementing the same server clusters. + */ +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +namespace { + +// TODO: Maybe consider making this configurable? See also +// AccessControl.cpp. +constexpr EndpointId kSupportedEndpoint = 0; + +} // anonymous namespace + +namespace chip { +namespace app { + +using Access::SubjectDescriptor; +using Protocols::InteractionModel::Status; + +namespace { + +bool IsSupportedGlobalAttribute(AttributeId aAttribute) +{ + // We don't have any non-global attributes. + using namespace Globals::Attributes; + + for (auto & attr : GlobalAttributesNotInMetadata) + { + if (attr == aAttribute) + { + return true; + } + } + + switch (aAttribute) + { + case FeatureMap::Id: + FALLTHROUGH; + case ClusterRevision::Id: + return true; + } + + return false; +} + +Status DetermineAttributeStatus(const ConcreteAttributePath & aPath, bool aIsWrite) +{ + // TODO: Consider making this configurable for applications that are not + // trying to be an OTA provider, though in practice it just affects which + // error is returned. + if (aPath.mEndpointId != kSupportedEndpoint) + { + return Status::UnsupportedEndpoint; + } + + // TODO: Consider making this configurable for applications that are not + // trying to be an OTA provider, though in practice it just affects which + // error is returned. + if (aPath.mClusterId != OtaSoftwareUpdateProvider::Id) + { + return Status::UnsupportedCluster; + } + + if (!IsSupportedGlobalAttribute(aPath.mAttributeId)) + { + return Status::UnsupportedAttribute; + } + + // No permissions for this for read, and none of these are writable for + // write. The writable-or-not check happens before the ACL check. + return aIsWrite ? Status::UnsupportedWrite : Status::UnsupportedAccess; +} + +} // anonymous namespace + +CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, bool aIsFabricFiltered, + const ConcreteReadAttributePath & aPath, AttributeReportIBs::Builder & aAttributeReports, + AttributeValueEncoder::AttributeEncodeState * aEncoderState) +{ + Status status = DetermineAttributeStatus(aPath, /* aIsWrite = */ false); + return aAttributeReports.EncodeAttributeStatus(aPath, StatusIB(status)); +} + +bool ConcreteAttributePathExists(const ConcreteAttributePath & aPath) +{ + return DetermineAttributeStatus(aPath, /* aIsWrite = */ false) == Status::UnsupportedAccess; +} + +Status ServerClusterCommandExists(const ConcreteCommandPath & aPath) +{ + // TODO: Consider making this configurable for applications that are not + // trying to be an OTA provider. + using namespace OtaSoftwareUpdateProvider::Commands; + + if (aPath.mEndpointId != kSupportedEndpoint) + { + return Status::UnsupportedEndpoint; + } + + if (aPath.mClusterId != OtaSoftwareUpdateProvider::Id) + { + return Status::UnsupportedCluster; + } + + switch (aPath.mCommandId) + { + case QueryImage::Id: + FALLTHROUGH; + case ApplyUpdateRequest::Id: + FALLTHROUGH; + case NotifyUpdateApplied::Id: + return Status::Success; + } + + return Status::UnsupportedCommand; +} + +bool IsClusterDataVersionEqual(const ConcreteClusterPath & aConcreteClusterPath, DataVersion aRequiredVersion) +{ + // Will never be called anyway; we have no attributes. + return false; +} + +const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePath & aConcreteClusterPath) +{ + // Note: This test does not make use of the real attribute metadata. + static EmberAfAttributeMetadata stub = { .defaultValue = EmberAfDefaultOrMinMaxAttributeValue(uint32_t(0)) }; + return &stub; +} + +bool IsDeviceTypeOnEndpoint(DeviceTypeId deviceType, EndpointId endpoint) +{ + return false; +} + +CHIP_ERROR WriteSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, const ConcreteDataAttributePath & aPath, + TLV::TLVReader & aReader, WriteHandler * aWriteHandler) +{ + Status status = DetermineAttributeStatus(aPath, /* aIsWrite = */ true); + return aWriteHandler->AddStatus(aPath, status); +} + +// No attribute access overrides on iOS and Android for now. +// TODO (#16806): This function can be moved to InteractionModelEngine. +AttributeAccessInterface * GetAttributeAccessOverride(EndpointId endpointId, ClusterId clusterId) +{ + return nullptr; +} + +void DispatchSingleClusterCommand(const ConcreteCommandPath & aPath, TLV::TLVReader & aReader, CommandHandler * aCommandObj) +{ + // This command passed ServerClusterCommandExists so we know it's one of our + // supported commands. + using namespace OtaSoftwareUpdateProvider::Commands; + + bool wasHandled = false; + CHIP_ERROR err = CHIP_NO_ERROR; + + switch (aPath.mCommandId) + { + case QueryImage::Id: { + QueryImage::DecodableType commandData; + err = DataModel::Decode(aReader, commandData); + if (err == CHIP_NO_ERROR) + { + wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(aCommandObj, aPath, commandData); + } + break; + } + case ApplyUpdateRequest::Id: { + ApplyUpdateRequest::DecodableType commandData; + err = DataModel::Decode(aReader, commandData); + if (err == CHIP_NO_ERROR) + { + wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(aCommandObj, aPath, commandData); + } + break; + } + case NotifyUpdateApplied::Id: { + NotifyUpdateApplied::DecodableType commandData; + err = DataModel::Decode(aReader, commandData); + if (err == CHIP_NO_ERROR) + { + wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(aCommandObj, aPath, commandData); + } + break; + } + default: + break; + } + + if (CHIP_NO_ERROR != err || !wasHandled) + { + aCommandObj->AddStatus(aPath, Status::InvalidCommand); + } +} + +Protocols::InteractionModel::Status CheckEventSupportStatus(const ConcreteEventPath & aPath) +{ + return Protocols::InteractionModel::Status::UnsupportedEvent; +} + +} // namespace app +} // namespace chip + +/** + * Called by the OTA provider cluster server to determine an index + * into its array. + */ +uint16_t emberAfGetClusterServerEndpointIndex(EndpointId endpoint, ClusterId cluster, uint16_t fixedClusterServerEndpointCount) +{ + if (endpoint == kSupportedEndpoint && cluster == OtaSoftwareUpdateProvider::Id) + { + return 0; + } + + return UINT16_MAX; +} + +/** + * Methods used by AttributePathExpandIterator, which need to exist + * because it is part of libCHIP. For AttributePathExpandIterator + * purposes, for now, we just pretend like we have just our one + * endpoint, the OTA Provider cluster, and no attributes (because we + * would be erroring out from them anyway). + */ +uint16_t emberAfGetServerAttributeCount(EndpointId endpoint, ClusterId cluster) +{ + return 0; +} + +uint16_t emberAfEndpointCount(void) +{ + return 1; +} + +uint16_t emberAfIndexFromEndpoint(EndpointId endpoint) +{ + if (endpoint == kSupportedEndpoint) + { + return 0; + } + + return UINT16_MAX; +} + +EndpointId emberAfEndpointFromIndex(uint16_t index) +{ + // Index must be valid here, so 0. + return kSupportedEndpoint; +} + +Optional emberAfGetNthClusterId(EndpointId endpoint, uint8_t n, bool server) +{ + if (endpoint == kSupportedEndpoint && n == 0 && server) + { + return MakeOptional(OtaSoftwareUpdateProvider::Id); + } + + return NullOptional; +} + +uint16_t emberAfGetServerAttributeIndexByAttributeId(EndpointId endpoint, ClusterId cluster, AttributeId attributeId) +{ + return UINT16_MAX; +} + +bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId) +{ + return false; +} + +uint8_t emberAfClusterCount(EndpointId endpoint, bool server) +{ + if (endpoint == kSupportedEndpoint && server) + { + return 1; + } + + return 0; +} + +Optional emberAfGetServerAttributeIdByIndex(EndpointId endpoint, ClusterId cluster, uint16_t attributeIndex) +{ + return NullOptional; +} + +uint8_t emberAfClusterIndex(EndpointId endpoint, ClusterId clusterId, EmberAfClusterMask mask) +{ + if (endpoint == kSupportedEndpoint && clusterId == OtaSoftwareUpdateProvider::Id && (mask & CLUSTER_MASK_SERVER)) + { + return 0; + } + + return UINT8_MAX; +} + +bool emberAfEndpointIndexIsEnabled(uint16_t index) +{ + return index == 0; +} + +namespace { +const CommandId acceptedCommands[] = { Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Id, + Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, + Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, kInvalidCommandId }; +const CommandId generatedCommands[] = { Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Id, + Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Id, kInvalidCommandId }; +const EmberAfCluster otaProviderCluster{ + .clusterId = Clusters::OtaSoftwareUpdateProvider::Id, + .attributes = nullptr, + .attributeCount = 0, + .clusterSize = 0, + .mask = CLUSTER_MASK_SERVER, + .functions = nullptr, + .acceptedCommandList = acceptedCommands, + .generatedCommandList = generatedCommands, + .eventList = nullptr, + .eventCount = 0, +}; +const EmberAfEndpointType otaProviderEndpoint{ .cluster = &otaProviderCluster, .clusterCount = 1, .endpointSize = 0 }; +} // namespace + +const EmberAfEndpointType * emberAfFindEndpointType(EndpointId endpoint) +{ + if (endpoint == kSupportedEndpoint) + { + return &otaProviderEndpoint; + } + + return nullptr; +} + +const EmberAfCluster * emberAfFindServerCluster(EndpointId endpoint, ClusterId cluster) +{ + if (endpoint == kSupportedEndpoint && cluster == Clusters::OtaSoftwareUpdateProvider::Id) + { + return &otaProviderCluster; + } + + return nullptr; +} diff --git a/src/controller/java/AndroidCommissioningWindowOpener.cpp b/src/controller/java/AndroidCommissioningWindowOpener.cpp index 6679887444427d..c1a2c5ae09c164 100644 --- a/src/controller/java/AndroidCommissioningWindowOpener.cpp +++ b/src/controller/java/AndroidCommissioningWindowOpener.cpp @@ -25,7 +25,6 @@ #include #include #include -#include using namespace chip::app::Clusters; using namespace chip::System::Clock; diff --git a/src/controller/java/BUILD.gn b/src/controller/java/BUILD.gn index 2cbb402a512f87..5afa13c7f092a0 100644 --- a/src/controller/java/BUILD.gn +++ b/src/controller/java/BUILD.gn @@ -17,6 +17,8 @@ import("//build_overrides/chip.gni") import("${chip_root}/build/chip/java/config.gni") import("${chip_root}/build/chip/java/rules.gni") import("${chip_root}/build/chip/tests.gni") +import("${chip_root}/src/app/common_flags.gni") +import("${chip_root}/src/platform/device.gni") if (!matter_enable_java_compilation) { import("${build_root}/config/android_abi.gni") @@ -87,6 +89,10 @@ shared_library("jni") { deps += [ "${chip_root}/src/controller/data_model:java-jni-sources" ] } + if (chip_build_controller_dynamic_server) { + defines += [ "CHIP_DEVICE_CONFIG_DYNAMIC_SERVER" ] + } + if (matter_enable_java_compilation) { defines += [ "JAVA_MATTER_CONTROLLER_TEST" ] diff --git a/src/controller/java/CHIPDeviceController-JNI.cpp b/src/controller/java/CHIPDeviceController-JNI.cpp index 900440c7ce865c..8bedec602381e0 100644 --- a/src/controller/java/CHIPDeviceController-JNI.cpp +++ b/src/controller/java/CHIPDeviceController-JNI.cpp @@ -55,6 +55,10 @@ #include #include +#ifdef CHIP_DEVICE_CONFIG_DYNAMIC_SERVER +#include +#endif // CHIP_DEVICE_CONFIG_DYNAMIC_SERVER + #ifdef JAVA_MATTER_CONTROLLER_TEST #include #else @@ -136,6 +140,10 @@ jint JNI_OnLoad(JavaVM * jvm, void * reserved) SuccessOrExit(err); #endif // JAVA_MATTER_CONTROLLER_TEST +#ifdef CHIP_DEVICE_CONFIG_DYNAMIC_SERVER + chip::app::dynamic_server::InitAccessControl(); +#endif // CHIP_DEVICE_CONFIG_DYNAMIC_SERVER + exit: if (err != CHIP_NO_ERROR) { diff --git a/src/darwin/Framework/CHIP/BUILD.gn b/src/darwin/Framework/CHIP/BUILD.gn index c9174dd064f1b0..502e9a26f8322d 100644 --- a/src/darwin/Framework/CHIP/BUILD.gn +++ b/src/darwin/Framework/CHIP/BUILD.gn @@ -27,7 +27,6 @@ static_library("framework") { sources = [ "${chip_root}/src/app/clusters/ota-provider/ota-provider.cpp", "MTRError.mm", - "MTRIMDispatch.mm", ] public_deps = [ diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index 21660828e25847..4f73834b261b03 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -26,7 +26,6 @@ #endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import "MTRCertificates.h" -#import "MTRControllerAccessControl.h" #import "MTRDemuxingStorage.h" #import "MTRDeviceController.h" #import "MTRDeviceControllerStartupParams.h" @@ -45,6 +44,7 @@ #import +#include #include #include #include @@ -405,7 +405,7 @@ - (BOOL)startControllerFactory:(MTRDeviceControllerFactoryParams *)startupParams return; } - [MTRControllerAccessControl init]; + app::dynamic_server::InitAccessControl(); if (startupParams.hasStorage) { _persistentStorageDelegate = new (std::nothrow) MTRPersistentStorageDelegateBridge(startupParams.storage); diff --git a/src/darwin/Framework/CHIP/MTRIMDispatch.mm b/src/darwin/Framework/CHIP/MTRIMDispatch.mm deleted file mode 100644 index 3b9c62c9e503d4..00000000000000 --- a/src/darwin/Framework/CHIP/MTRIMDispatch.mm +++ /dev/null @@ -1,352 +0,0 @@ -/* - * - * Copyright (c) 2022 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#import - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/** - * This file defines the APIs needed to handle interaction model dispatch. - * These are the APIs normally defined in - * src/app/util/ember-compatibility-functions.cpp and the generated - * IMClusterCommandHandler.cpp but we want a different implementation of these - * to enable more dynamic behavior, since not all framework consumers will be - * implementing the same server clusters. - */ -using namespace chip; -using namespace chip::app; -using namespace chip::app::Clusters; - -namespace { - -// TODO: Maybe consider making this configurable? See also -// CHIPControllerAccessControl.mm. -constexpr EndpointId kSupportedEndpoint = 0; - -} // anonymous namespace - -namespace chip { -namespace app { - - using Access::SubjectDescriptor; - using Protocols::InteractionModel::Status; - - namespace { - - bool IsSupportedGlobalAttribute(AttributeId aAttribute) - { - // We don't have any non-global attributes. - using namespace Globals::Attributes; - - for (auto & attr : GlobalAttributesNotInMetadata) { - if (attr == aAttribute) { - return true; - } - } - - switch (aAttribute) { - case FeatureMap::Id: - FALLTHROUGH; - case ClusterRevision::Id: - return true; - } - - return false; - } - - Status DetermineAttributeStatus(const ConcreteAttributePath & aPath, bool aIsWrite) - { - // TODO: Consider making this configurable for applications that are not - // trying to be an OTA provider, though in practice it just affects which - // error is returned. - if (aPath.mEndpointId != kSupportedEndpoint) { - return Status::UnsupportedEndpoint; - } - - // TODO: Consider making this configurable for applications that are not - // trying to be an OTA provider, though in practice it just affects which - // error is returned. - if (aPath.mClusterId != OtaSoftwareUpdateProvider::Id) { - return Status::UnsupportedCluster; - } - - if (!IsSupportedGlobalAttribute(aPath.mAttributeId)) { - return Status::UnsupportedAttribute; - } - - // No permissions for this for read, and none of these are writable for - // write. The writable-or-not check happens before the ACL check. - return aIsWrite ? Status::UnsupportedWrite : Status::UnsupportedAccess; - } - - } // anonymous namespace - - CHIP_ERROR ReadSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, bool aIsFabricFiltered, - const ConcreteReadAttributePath & aPath, AttributeReportIBs::Builder & aAttributeReports, - AttributeValueEncoder::AttributeEncodeState * aEncoderState) - { - Status status = DetermineAttributeStatus(aPath, /* aIsWrite = */ false); - return aAttributeReports.EncodeAttributeStatus(aPath, StatusIB(status)); - } - - bool ConcreteAttributePathExists(const ConcreteAttributePath & aPath) - { - return DetermineAttributeStatus(aPath, /* aIsWrite = */ false) == Status::UnsupportedAccess; - } - - Status ServerClusterCommandExists(const ConcreteCommandPath & aPath) - { - // TODO: Consider making this configurable for applications that are not - // trying to be an OTA provider. - using namespace OtaSoftwareUpdateProvider::Commands; - - if (aPath.mEndpointId != kSupportedEndpoint) { - return Status::UnsupportedEndpoint; - } - - if (aPath.mClusterId != OtaSoftwareUpdateProvider::Id) { - return Status::UnsupportedCluster; - } - - switch (aPath.mCommandId) { - case QueryImage::Id: - FALLTHROUGH; - case ApplyUpdateRequest::Id: - FALLTHROUGH; - case NotifyUpdateApplied::Id: - return Status::Success; - } - - return Status::UnsupportedCommand; - } - - bool IsClusterDataVersionEqual(const ConcreteClusterPath & aConcreteClusterPath, DataVersion aRequiredVersion) - { - // Will never be called anyway; we have no attributes. - return false; - } - - const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePath & aConcreteClusterPath) - { - // Note: This test does not make use of the real attribute metadata. - static EmberAfAttributeMetadata stub = { .defaultValue = EmberAfDefaultOrMinMaxAttributeValue(uint32_t(0)) }; - return &stub; - } - - bool IsDeviceTypeOnEndpoint(DeviceTypeId deviceType, EndpointId endpoint) { return false; } - - CHIP_ERROR WriteSingleClusterData(const SubjectDescriptor & aSubjectDescriptor, const ConcreteDataAttributePath & aPath, - TLV::TLVReader & aReader, WriteHandler * aWriteHandler) - { - Status status = DetermineAttributeStatus(aPath, /* aIsWrite = */ true); - return aWriteHandler->AddStatus(aPath, status); - } - - // No attribute access overrides on iOS for now. - // TODO (#16806): This function can be moved to InteractionModelEngine. - AttributeAccessInterface * GetAttributeAccessOverride(EndpointId endpointId, ClusterId clusterId) { return nullptr; } - - void DispatchSingleClusterCommand(const ConcreteCommandPath & aPath, TLV::TLVReader & aReader, CommandHandler * aCommandObj) - { - // This command passed ServerClusterCommandExists so we know it's one of our - // supported commands. - using namespace OtaSoftwareUpdateProvider::Commands; - - bool wasHandled = false; - CHIP_ERROR err = CHIP_NO_ERROR; - - switch (aPath.mCommandId) { - case QueryImage::Id: { - QueryImage::DecodableType commandData; - err = DataModel::Decode(aReader, commandData); - if (err == CHIP_NO_ERROR) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterQueryImageCallback(aCommandObj, aPath, commandData); - } - break; - } - case ApplyUpdateRequest::Id: { - ApplyUpdateRequest::DecodableType commandData; - err = DataModel::Decode(aReader, commandData); - if (err == CHIP_NO_ERROR) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterApplyUpdateRequestCallback(aCommandObj, aPath, commandData); - } - break; - } - case NotifyUpdateApplied::Id: { - NotifyUpdateApplied::DecodableType commandData; - err = DataModel::Decode(aReader, commandData); - if (err == CHIP_NO_ERROR) { - wasHandled = emberAfOtaSoftwareUpdateProviderClusterNotifyUpdateAppliedCallback(aCommandObj, aPath, commandData); - } - break; - } - default: - break; - } - - if (CHIP_NO_ERROR != err || !wasHandled) { - aCommandObj->AddStatus(aPath, Status::InvalidCommand); - } - } - - Protocols::InteractionModel::Status CheckEventSupportStatus(const ConcreteEventPath & aPath) - { - return Protocols::InteractionModel::Status::UnsupportedEvent; - } - -} // namespace app -} // namespace chip - -/** - * Called by the OTA provider cluster server to determine an index - * into its array. - */ -uint16_t emberAfGetClusterServerEndpointIndex(EndpointId endpoint, ClusterId cluster, uint16_t fixedClusterServerEndpointCount) -{ - if (endpoint == kSupportedEndpoint && cluster == OtaSoftwareUpdateProvider::Id) { - return 0; - } - - return UINT16_MAX; -} - -/** - * Methods used by AttributePathExpandIterator, which need to exist - * because it is part of libCHIP. For AttributePathExpandIterator - * purposes, for now, we just pretend like we have just our one - * endpoint, the OTA Provider cluster, and no attributes (because we - * would be erroring out from them anyway). - */ -uint16_t emberAfGetServerAttributeCount(EndpointId endpoint, ClusterId cluster) { return 0; } - -uint16_t emberAfEndpointCount(void) { return 1; } - -uint16_t emberAfIndexFromEndpoint(EndpointId endpoint) -{ - if (endpoint == kSupportedEndpoint) { - return 0; - } - - return UINT16_MAX; -} - -EndpointId emberAfEndpointFromIndex(uint16_t index) -{ - // Index must be valid here, so 0. - return kSupportedEndpoint; -} - -Optional emberAfGetNthClusterId(EndpointId endpoint, uint8_t n, bool server) -{ - if (endpoint == kSupportedEndpoint && n == 0 && server) { - return MakeOptional(OtaSoftwareUpdateProvider::Id); - } - - return NullOptional; -} - -uint16_t emberAfGetServerAttributeIndexByAttributeId(EndpointId endpoint, ClusterId cluster, AttributeId attributeId) -{ - return UINT16_MAX; -} - -bool emberAfContainsAttribute(chip::EndpointId endpoint, chip::ClusterId clusterId, chip::AttributeId attributeId) { return false; } - -uint8_t emberAfClusterCount(EndpointId endpoint, bool server) -{ - if (endpoint == kSupportedEndpoint && server) { - return 1; - } - - return 0; -} - -Optional emberAfGetServerAttributeIdByIndex(EndpointId endpoint, ClusterId cluster, uint16_t attributeIndex) -{ - return NullOptional; -} - -uint8_t emberAfClusterIndex(EndpointId endpoint, ClusterId clusterId, EmberAfClusterMask mask) -{ - if (endpoint == kSupportedEndpoint && clusterId == OtaSoftwareUpdateProvider::Id && (mask & CLUSTER_MASK_SERVER)) { - return 0; - } - - return UINT8_MAX; -} - -bool emberAfEndpointIndexIsEnabled(uint16_t index) { return index == 0; } - -namespace { -const CommandId acceptedCommands[] = { Clusters::OtaSoftwareUpdateProvider::Commands::QueryImage::Id, - Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateRequest::Id, - Clusters::OtaSoftwareUpdateProvider::Commands::NotifyUpdateApplied::Id, kInvalidCommandId }; -const CommandId generatedCommands[] = { Clusters::OtaSoftwareUpdateProvider::Commands::QueryImageResponse::Id, - Clusters::OtaSoftwareUpdateProvider::Commands::ApplyUpdateResponse::Id, kInvalidCommandId }; -const EmberAfCluster otaProviderCluster { - .clusterId = Clusters::OtaSoftwareUpdateProvider::Id, - .attributes = nullptr, - .attributeCount = 0, - .clusterSize = 0, - .mask = CLUSTER_MASK_SERVER, - .functions = nullptr, - .acceptedCommandList = acceptedCommands, - .generatedCommandList = generatedCommands, - .eventList = nullptr, - .eventCount = 0, -}; -const EmberAfEndpointType otaProviderEndpoint { .cluster = &otaProviderCluster, .clusterCount = 1, .endpointSize = 0 }; -} - -const EmberAfEndpointType * emberAfFindEndpointType(EndpointId endpoint) -{ - if (endpoint == kSupportedEndpoint) { - return &otaProviderEndpoint; - } - - return nullptr; -} - -const EmberAfCluster * emberAfFindServerCluster(EndpointId endpoint, ClusterId cluster) -{ - if (endpoint == kSupportedEndpoint && cluster == Clusters::OtaSoftwareUpdateProvider::Id) { - return &otaProviderCluster; - } - - return nullptr; -} diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 6f901de32ab3d5..3eda4201e349e9 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -72,9 +72,6 @@ 039546BD2991E1CB006D42A8 /* SystemCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 039546B32991E194006D42A8 /* SystemCommands.cpp */; }; 039546BE2991E1CB006D42A8 /* DelayCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 039546AC2991E185006D42A8 /* DelayCommands.cpp */; }; 039547012992D461006D42A8 /* generic-callback-stubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5143041F2914CED9004DC7FE /* generic-callback-stubs.cpp */; }; - 039547022992D952006D42A8 /* privilege-storage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D84374A29498BAE0070D20A /* privilege-storage.cpp */; }; - 039547032992D991006D42A8 /* MTRIMDispatch.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51431AF827D2973E008A7943 /* MTRIMDispatch.mm */; }; - 039547042992D9BF006D42A8 /* ota-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51431AFA27D29CA4008A7943 /* ota-provider.cpp */; }; 0395470F2992DB37006D42A8 /* complete.c in Sources */ = {isa = PBXBuildFile; fileRef = 0395470C2992DB37006D42A8 /* complete.c */; }; 03F430A7299410C000166449 /* ExamplePersistentStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 03F430A6299410C000166449 /* ExamplePersistentStorage.cpp */; }; 03F430A82994112B00166449 /* editline.c in Sources */ = {isa = PBXBuildFile; fileRef = 0395470B2992DB37006D42A8 /* editline.c */; }; @@ -123,7 +120,6 @@ 3D843713294977000070D20A /* NSDataSpanConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D843710294977000070D20A /* NSDataSpanConversion.h */; }; 3D843716294979230070D20A /* MTRCallbackBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D843714294979230070D20A /* MTRCallbackBridge.h */; }; 3D843717294979230070D20A /* MTRClusters_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D843715294979230070D20A /* MTRClusters_Internal.h */; }; - 3D84374B29498BAE0070D20A /* privilege-storage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D84374A29498BAE0070D20A /* privilege-storage.cpp */; }; 3D843756294AD25A0070D20A /* MTRCertificateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D843754294AD25A0070D20A /* MTRCertificateInfo.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3D843757294AD25A0070D20A /* MTRCertificateInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D843755294AD25A0070D20A /* MTRCertificateInfo.mm */; }; 3DECCB6E29347D2D00585AEC /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DECCB6D29347D2C00585AEC /* Security.framework */; }; @@ -150,8 +146,6 @@ 513DDB8A2761F6F900DAA01A /* MTRAttributeTLVValueDecoder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 513DDB892761F6F900DAA01A /* MTRAttributeTLVValueDecoder.mm */; }; 5142E39829D377F000A206F0 /* MTROTAProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5142E39729D377F000A206F0 /* MTROTAProviderTests.m */; }; 514304202914CED9004DC7FE /* generic-callback-stubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5143041F2914CED9004DC7FE /* generic-callback-stubs.cpp */; }; - 51431AF927D2973E008A7943 /* MTRIMDispatch.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51431AF827D2973E008A7943 /* MTRIMDispatch.mm */; }; - 51431AFB27D29CA4008A7943 /* ota-provider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51431AFA27D29CA4008A7943 /* ota-provider.cpp */; }; 5143851E2A65885500EDC8E6 /* MTRSwiftPairingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5143851D2A65885500EDC8E6 /* MTRSwiftPairingTests.swift */; }; 514654492A72F9DF00904E61 /* MTRDemuxingStorage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 514654482A72F9DF00904E61 /* MTRDemuxingStorage.mm */; }; 5146544B2A72F9F500904E61 /* MTRDemuxingStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 5146544A2A72F9F500904E61 /* MTRDemuxingStorage.h */; }; @@ -183,8 +177,6 @@ 51C8E3F82825CDB600D47D00 /* MTRTestKeys.m in Sources */ = {isa = PBXBuildFile; fileRef = 51C8E3F72825CDB600D47D00 /* MTRTestKeys.m */; }; 51C984622A61CE2A00B0AD9A /* MTRFabricInfoChecker.m in Sources */ = {isa = PBXBuildFile; fileRef = 51C984602A61CE2A00B0AD9A /* MTRFabricInfoChecker.m */; }; 51D10D2E2808E2CA00E8CA3D /* MTRTestStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 51D10D2D2808E2CA00E8CA3D /* MTRTestStorage.m */; }; - 51E0310027EA20D20083DC9C /* MTRControllerAccessControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E030FE27EA20D20083DC9C /* MTRControllerAccessControl.h */; }; - 51E0310127EA20D20083DC9C /* MTRControllerAccessControl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E030FF27EA20D20083DC9C /* MTRControllerAccessControl.mm */; }; 51E24E73274E0DAC007CCF6E /* MTRErrorTestUtils.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E24E72274E0DAC007CCF6E /* MTRErrorTestUtils.mm */; }; 51E4D121291D0EB400C8C535 /* MTRBaseClusterUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E4D120291D0EB400C8C535 /* MTRBaseClusterUtils.h */; }; 51E51FBF282AD37A00FC978D /* MTRDeviceControllerStartupParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E51FBC282AD37A00FC978D /* MTRDeviceControllerStartupParams.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -479,7 +471,6 @@ 3D84372D294984AF0070D20A /* decode_value.zapt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = decode_value.zapt; sourceTree = ""; }; 3D84372E294984AF0070D20A /* MTRCallbackBridge.zapt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MTRCallbackBridge.zapt; sourceTree = ""; }; 3D84372F294984AF0070D20A /* command_completion_type.zapt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = command_completion_type.zapt; sourceTree = ""; }; - 3D84374A29498BAE0070D20A /* privilege-storage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "privilege-storage.cpp"; path = "util/privilege-storage.cpp"; sourceTree = ""; }; 3D843754294AD25A0070D20A /* MTRCertificateInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRCertificateInfo.h; sourceTree = ""; }; 3D843755294AD25A0070D20A /* MTRCertificateInfo.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRCertificateInfo.mm; sourceTree = ""; }; 3DECCB6D29347D2C00585AEC /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; @@ -507,8 +498,6 @@ 513DDB892761F6F900DAA01A /* MTRAttributeTLVValueDecoder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRAttributeTLVValueDecoder.mm; sourceTree = ""; }; 5142E39729D377F000A206F0 /* MTROTAProviderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTROTAProviderTests.m; sourceTree = ""; }; 5143041F2914CED9004DC7FE /* generic-callback-stubs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "generic-callback-stubs.cpp"; path = "util/generic-callback-stubs.cpp"; sourceTree = ""; }; - 51431AF827D2973E008A7943 /* MTRIMDispatch.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRIMDispatch.mm; sourceTree = ""; }; - 51431AFA27D29CA4008A7943 /* ota-provider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "ota-provider.cpp"; path = "clusters/ota-provider/ota-provider.cpp"; sourceTree = ""; }; 5143851C2A65885400EDC8E6 /* MatterTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MatterTests-Bridging-Header.h"; sourceTree = ""; }; 5143851D2A65885500EDC8E6 /* MTRSwiftPairingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MTRSwiftPairingTests.swift; sourceTree = ""; }; 514654482A72F9DF00904E61 /* MTRDemuxingStorage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDemuxingStorage.mm; sourceTree = ""; }; @@ -544,8 +533,6 @@ 51C984602A61CE2A00B0AD9A /* MTRFabricInfoChecker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRFabricInfoChecker.m; sourceTree = ""; }; 51C984612A61CE2A00B0AD9A /* MTRFabricInfoChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRFabricInfoChecker.h; sourceTree = ""; }; 51D10D2D2808E2CA00E8CA3D /* MTRTestStorage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MTRTestStorage.m; sourceTree = ""; }; - 51E030FE27EA20D20083DC9C /* MTRControllerAccessControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRControllerAccessControl.h; sourceTree = ""; }; - 51E030FF27EA20D20083DC9C /* MTRControllerAccessControl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRControllerAccessControl.mm; sourceTree = ""; }; 51E24E72274E0DAC007CCF6E /* MTRErrorTestUtils.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRErrorTestUtils.mm; sourceTree = ""; }; 51E4D120291D0EB400C8C535 /* MTRBaseClusterUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRBaseClusterUtils.h; sourceTree = ""; }; 51E51FBC282AD37A00FC978D /* MTRDeviceControllerStartupParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerStartupParams.h; sourceTree = ""; }; @@ -965,8 +952,6 @@ isa = PBXGroup; children = ( 5143041F2914CED9004DC7FE /* generic-callback-stubs.cpp */, - 51431AFA27D29CA4008A7943 /* ota-provider.cpp */, - 3D84374A29498BAE0070D20A /* privilege-storage.cpp */, ); name = app; path = ../../../app; @@ -1137,8 +1122,6 @@ 5A60370727EA1FF60020DB79 /* MTRClusterStateCacheContainer+XPC.h */, 99D466E02798936D0089A18F /* MTRCommissioningParameters.h */, 99AECC7F2798A57E00B6355B /* MTRCommissioningParameters.mm */, - 51E030FE27EA20D20083DC9C /* MTRControllerAccessControl.h */, - 51E030FF27EA20D20083DC9C /* MTRControllerAccessControl.mm */, 3DFCB32B29678C9500332B35 /* MTRConversion.h */, 51565CAD2A79D42100469F18 /* MTRConversion.mm */, 3CF134A6289D8AD90017A19E /* MTRCSRInfo.h */, @@ -1186,7 +1169,6 @@ 754F3DF327FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h */, 515C1C6E284F9FFB00A48F0C /* MTRFramework.h */, 515C1C6D284F9FFB00A48F0C /* MTRFramework.mm */, - 51431AF827D2973E008A7943 /* MTRIMDispatch.mm */, 998F286C26D55E10001846C6 /* MTRKeypair.h */, 3DECCB6F2934AC1C00585AEC /* MTRLogging.h */, 991DC08A247704DC00C13860 /* MTRLogging_Internal.h */, @@ -1465,7 +1447,6 @@ 998F286F26D55EC5001846C6 /* MTRP256KeypairBridge.h in Headers */, 2C222ADF255C811800E446B9 /* MTRBaseDevice_Internal.h in Headers */, 511913FC28C100EF009235E9 /* MTRBaseSubscriptionCallback.h in Headers */, - 51E0310027EA20D20083DC9C /* MTRControllerAccessControl.h in Headers */, 51565CB12A7AD77600469F18 /* MTRDeviceControllerDataStore.h in Headers */, 3D843713294977000070D20A /* NSDataSpanConversion.h in Headers */, 991DC08B247704DC00C13860 /* MTRLogging_Internal.h in Headers */, @@ -1647,8 +1628,6 @@ B45373EF2A9FEBFE00807602 /* ops-raw-skt.c in Sources */, 037C3DD52991C2E200B7EEE2 /* CHIPCommandBridge.mm in Sources */, 039546BC2991E1CB006D42A8 /* LogCommands.cpp in Sources */, - 039547042992D9BF006D42A8 /* ota-provider.cpp in Sources */, - 039547022992D952006D42A8 /* privilege-storage.cpp in Sources */, B45373E12A9FEB7F00807602 /* ops-h1.c in Sources */, B45373EB2A9FEBDB00807602 /* ops-listen.c in Sources */, 0382FA2C2992F06C00247BBB /* Commands.cpp in Sources */, @@ -1660,7 +1639,6 @@ B45373E62A9FEBA400807602 /* header.c in Sources */, B45374002A9FEC4F00807602 /* unix-init.c in Sources */, B45373DF2A9FEB6F00807602 /* system.c in Sources */, - 039547032992D991006D42A8 /* MTRIMDispatch.mm in Sources */, 039546BD2991E1CB006D42A8 /* SystemCommands.cpp in Sources */, B45373FC2A9FEC4F00807602 /* unix-caps.c in Sources */, B4E262162AA0CF1C00DBA5BC /* RemoteDataModelLogger.mm in Sources */, @@ -1722,7 +1700,6 @@ 51B22C2A2740CB47008D5055 /* MTRCommandPayloadsObjc.mm in Sources */, 75B765C32A1D82D30014719B /* MTRAttributeSpecifiedCheck.mm in Sources */, AF5F90FF2878D351005503FA /* MTROTAProviderDelegateBridge.mm in Sources */, - 3D84374B29498BAE0070D20A /* privilege-storage.cpp in Sources */, 51E95DFC2A78443C00A434F0 /* MTRSessionResumptionStorageBridge.mm in Sources */, 7534F12828BFF20300390851 /* MTRDeviceAttestationDelegate.mm in Sources */, 2C5EEEF7268A85C400CAE3D3 /* MTRDeviceConnectionBridge.mm in Sources */, @@ -1736,7 +1713,6 @@ 1EDCE546289049A100E41EC9 /* MTROTAHeader.mm in Sources */, 1EC4CE5D25CC26E900D7304F /* MTRBaseClusters.mm in Sources */, 51565CB22A7AD77600469F18 /* MTRDeviceControllerDataStore.mm in Sources */, - 51E0310127EA20D20083DC9C /* MTRControllerAccessControl.mm in Sources */, 1ED276E226C5812A00547A89 /* MTRCluster.mm in Sources */, B2E0D7B3245B0B5C003C5B48 /* MTRError.mm in Sources */, 51E51FC1282AD37A00FC978D /* MTRDeviceControllerStartupParams.mm in Sources */, @@ -1764,9 +1740,7 @@ 88EBF8CF27FABDD500686BC1 /* MTRDeviceAttestationDelegateBridge.mm in Sources */, 5A6FEC9827B5C6AF00F25F42 /* MTRDeviceOverXPC.mm in Sources */, 514654492A72F9DF00904E61 /* MTRDemuxingStorage.mm in Sources */, - 51431AF927D2973E008A7943 /* MTRIMDispatch.mm in Sources */, 1E4D655229C30A8700BC3478 /* MTRCommissionableBrowser.mm in Sources */, - 51431AFB27D29CA4008A7943 /* ota-provider.cpp in Sources */, 3DECCB722934AFE200585AEC /* MTRLogging.mm in Sources */, 7596A84528762729004DAE0E /* MTRDevice.mm in Sources */, ); diff --git a/src/darwin/Framework/chip_xcode_build_connector.sh b/src/darwin/Framework/chip_xcode_build_connector.sh index 120496c146e2c0..54e3594dfda2a2 100755 --- a/src/darwin/Framework/chip_xcode_build_connector.sh +++ b/src/darwin/Framework/chip_xcode_build_connector.sh @@ -93,6 +93,7 @@ done declare -a args=( 'default_configs_cosmetic=[]' # suppress colorization 'chip_crypto="boringssl"' + 'chip_build_controller_dynamic_server=true' 'chip_build_tools=false' 'chip_build_tests=false' 'chip_enable_wifi=false' From 42a24d7f239599577115df51b2cb9872178eaa0b Mon Sep 17 00:00:00 2001 From: srningap <107042150+srningap@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:34:49 +0530 Subject: [PATCH 121/134] [Silabs] Adds wifi-sdk v3.1.0 and required changes for it (#29204) * Adds wifi-sdk 3.1.0 and required changes for it * updated path in gni for dual-flash * restyled * Updated gni with board specific path * Added time unit and fix for soc ble range issue * restyled --- src/platform/silabs/rs911x/BLEManagerImpl.cpp | 1 + src/platform/silabs/rs911x/rsi_ble_config.h | 11 +++++- src/platform/silabs/rs911x/wfx_sl_ble_init.c | 8 ++-- third_party/silabs/SiWx917_sdk.gni | 38 ++++++++++--------- third_party/silabs/silabs_board.gni | 5 +++ third_party/silabs/wifi_sdk | 2 +- 6 files changed, 41 insertions(+), 24 deletions(-) diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 9b2b543a330055..d7477b1fa7b494 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -130,6 +130,7 @@ void sl_ble_event_handling_task(void) // Requests the connection parameters change with the remote device rsi_ble_conn_params_update(event_msg.resp_enh_conn.dev_addr, BLE_MIN_CONNECTION_INTERVAL_MS, BLE_MAX_CONNECTION_INTERVAL_MS, BLE_SLAVE_LATENCY_MS, BLE_TIMEOUT_MS); + rsi_ble_set_data_len(event_msg.resp_enh_conn.dev_addr, RSI_BLE_TX_OCTETS, RSI_BLE_TX_TIME); } break; case RSI_BLE_DISCONN_EVENT: { diff --git a/src/platform/silabs/rs911x/rsi_ble_config.h b/src/platform/silabs/rs911x/rsi_ble_config.h index 1b6040542ba674..60b64ff12ab17d 100644 --- a/src/platform/silabs/rs911x/rsi_ble_config.h +++ b/src/platform/silabs/rs911x/rsi_ble_config.h @@ -60,6 +60,14 @@ #define ADD_DEVICE_TO_WHITELIST (0x01) #define DELETE_DEVICE_FROM_WHITELIST (0x02) +#define CLEAR_ACCEPTLIST (0x00) +#define ADD_DEVICE_TO_ACCEPTLIST (0x01) +#define DELETE_DEVICE_FROM_ACCEPTLIST (0x02) + +#define RSI_BLE_TX_OCTETS 251 +#define RSI_BLE_TX_TIME 2120 // microseconds +#define RSI_BLE_CS_DATA_LENGTH 240 + #define ALL_PHYS (0x00) #define RSI_BLE_DEV_ADDR_RESOLUTION_ENABLE (0) @@ -263,7 +271,8 @@ #define RSI_CUSTOM_FEATURE_BIT_MAP SL_SI91X_FEAT_CUSTOM_FEAT_EXTENTION_VALID //! To set custom feature select bit map #ifdef CHIP_9117 #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP \ - (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | RAM_LEVEL_NWP_BASIC_MCU_ADV | FRONT_END_SWITCH_SEL2) + (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(1) | RAM_LEVEL_NWP_BASIC_MCU_ADV | \ + SL_SI91X_EXT_FEAT_FRONT_END_SWITCH_PINS_ULP_GPIO_4_5_0) #else #define RSI_EXT_CUSTOM_FEATURE_BIT_MAP (SL_SI91X_EXT_FEAT_LOW_POWER_MODE | SL_SI91X_EXT_FEAT_XTAL_CLK_ENABLE(2)) #endif diff --git a/src/platform/silabs/rs911x/wfx_sl_ble_init.c b/src/platform/silabs/rs911x/wfx_sl_ble_init.c index 1344847962b5d1..376fc4321dcd57 100644 --- a/src/platform/silabs/rs911x/wfx_sl_ble_init.c +++ b/src/platform/silabs/rs911x/wfx_sl_ble_init.c @@ -351,10 +351,10 @@ void rsi_ble_add_char_val_att(void * serv_handler, uint16_t handle, uuid_t att_t uint32_t rsi_ble_add_matter_service(void) { - uuid_t custom_service = { RSI_BLE_MATTER_CUSTOM_SERVICE_UUID }; - custom_service.size = RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE; - custom_service.val.val16 = RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16; - uint8_t data[230] = { RSI_BLE_MATTER_CUSTOM_SERVICE_DATA }; + uuid_t custom_service = { RSI_BLE_MATTER_CUSTOM_SERVICE_UUID }; + custom_service.size = RSI_BLE_MATTER_CUSTOM_SERVICE_SIZE; + custom_service.val.val16 = RSI_BLE_MATTER_CUSTOM_SERVICE_VALUE_16; + uint8_t data[RSI_BLE_CS_DATA_LENGTH] = { RSI_BLE_MATTER_CUSTOM_SERVICE_DATA }; static const uuid_t custom_characteristic_RX = { .size = RSI_BLE_CUSTOM_CHARACTERISTIC_RX_SIZE, .reserved = { RSI_BLE_CUSTOM_CHARACTERISTIC_RX_RESERVED }, diff --git a/third_party/silabs/SiWx917_sdk.gni b/third_party/silabs/SiWx917_sdk.gni index 79fbf8516347c6..aefc3033ecfb47 100644 --- a/third_party/silabs/SiWx917_sdk.gni +++ b/third_party/silabs/SiWx917_sdk.gni @@ -73,26 +73,28 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/si91x/sl_net/inc", # siwx917_soc component + "${wifi_sdk_root}/components/siwx917_soc/boards/config/${silabs_board_lower}", + "${wifi_sdk_root}/components/siwx917_soc/boards/inc", + "${wifi_sdk_root}/components/siwx917_soc/core/chip/inc", "${wifi_sdk_root}/components/siwx917_soc/core/config", - "${wifi_sdk_root}/components/siwx917_soc/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/config", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/CMSIS/Driver/Include", + "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/rom_driver/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/inc", "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/config", - "${wifi_sdk_root}/components/siwx917_soc/boards/brd4325x/inc", - "${wifi_sdk_root}/components/siwx917_soc/wifi_inc", + "${wifi_sdk_root}/components/siwx917_soc/hal/inc", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/inc", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/wifi_inc", # wifi component "${wifi_sdk_root}/components/protocol/wifi/inc", # si91x_support component "${wifi_sdk_root}/components/si91x_support/inc", - "${wifi_sdk_root}/components/si91x_support/brd4325b", - "${wifi_sdk_root}/components/si91x_support/siwx917_soc", # wifi_resources component "${wifi_sdk_root}/resources/certificates", @@ -170,6 +172,7 @@ template("siwx917_sdk") { "FLASH_PAGE_SIZE", "SL_NVM3_PRESENT", "ROM_WIRELESS", + "BRD4325A", #TODO: should be removed after SoC macro clean-up ] if (silabs_board == "BRD4325B") { @@ -326,14 +329,13 @@ template("siwx917_sdk") { # si91x_support component "${wifi_sdk_root}/components/si91x_support/src/sl_utility.c", - "${wifi_sdk_root}/components/siwx917_soc/boards/brd4325x/src/rsi_board.c", + "${wifi_sdk_root}/components/siwx917_soc/boards/src/rsi_board.c", "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/rsi_deepsleep_soc.c", + "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/rsi_system_config.c", "${wifi_sdk_root}/components/siwx917_soc/core/chip/src/system_si91x.c", "${wifi_sdk_root}/components/siwx917_soc/core/config/src/rsi_nvic_priorities_config.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/UDMA.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/cmsis_driver/USART.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/ipmu/ipmu_apis.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/ipmu/rsi_system_config_9117.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/clock_update.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_egpio.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/peripheral_drivers/src/rsi_udma.c", @@ -347,13 +349,13 @@ template("siwx917_sdk") { "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_temp_sensor.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/systemlevel/src/rsi_ulpss_clk.c", "${wifi_sdk_root}/components/siwx917_soc/drivers/unified_api/src/sl_si91x_usart.c", - "${wifi_sdk_root}/components/siwx917_soc/rsi_hal_mcu_m4_ram.c", - "${wifi_sdk_root}/components/siwx917_soc/rsi_hal_mcu_m4_rom.c", - "${wifi_sdk_root}/components/siwx917_soc/sl_platform.c", - "${wifi_sdk_root}/components/siwx917_soc/sl_platform_wireless.c", - "${wifi_sdk_root}/components/siwx917_soc/sl_si91x_bus.c", - "${wifi_sdk_root}/components/siwx917_soc/sl_si91x_timer.c", - "${wifi_sdk_root}/components/siwx917_soc/sli_siwx917_soc.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/rsi_hal_mcu_m4_ram.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/rsi_hal_mcu_m4_rom.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_platform.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_platform_wireless.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_si91x_bus.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sl_si91x_timer.c", + "${wifi_sdk_root}/components/siwx917_soc/platform_connectivity/sli_siwx917_soc.c", # modified hal "${efr32_sdk_root}/platform/emdrv/nvm3/src/nvm3_default_common_linker.c", @@ -372,7 +374,7 @@ template("siwx917_sdk") { "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/autogen/sl_event_handler.c", "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal/rsi_hal_mcu_m4.c", "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/hal/rsi_hal_mcu_platform_init.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_nvm3_hal_flash.c", + "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_nvm3_hal_flash.c", # mbedtls "${chip_root}/third_party/mbedtls/repo/library/aes.c", @@ -415,14 +417,14 @@ template("siwx917_sdk") { if (silabs_board == "BRD4325B") { sources += [ "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_RS1xxxx.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_dual_flash_intf.c", + "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_dual_flash_intf.c", ] } if (wifi_soc_common_flash) { sources += [ "${sdk_support_root}/matter/si91x/siwx917/${sdk_support_board}/support/src/startup_common_RS1xxxx.c", - "${wifi_sdk_root}/components/siwx917_soc/drivers/middleware/nvm3/src/sl_si91x_common_flash_intf.c", + "${wifi_sdk_root}/components/siwx917_soc/drivers/service/nvm3/src/sl_si91x_common_flash_intf.c", ] } diff --git a/third_party/silabs/silabs_board.gni b/third_party/silabs/silabs_board.gni index d7dce160de622b..236be2e9e8bc47 100644 --- a/third_party/silabs/silabs_board.gni +++ b/third_party/silabs/silabs_board.gni @@ -15,6 +15,7 @@ declare_args() { # EFR32 board used silabs_board = "" + silabs_board_lower = "" # LCD is enabled by default # Boards BRD4166A, BRD2601B, BRD2703A and BRD4319A do not have a LCD so they disable it explicitly @@ -106,6 +107,7 @@ if (silabs_board == "BRD4304A") { disable_lcd = true show_qr_code = false wifi_soc = true + silabs_board_lower = "brd4325b" } else if (silabs_board == "BRD4325C") { silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" @@ -113,6 +115,7 @@ if (silabs_board == "BRD4304A") { show_qr_code = false wifi_soc = true wifi_soc_common_flash = true + silabs_board_lower = "brd4325c" } else if (silabs_board == "BRD4325G") { silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" @@ -120,6 +123,7 @@ if (silabs_board == "BRD4304A") { show_qr_code = false wifi_soc = true wifi_soc_common_flash = true + silabs_board_lower = "brd4325g" } else if (silabs_board == "BRD4338A") { silabs_family = "SiWx917-common" silabs_mcu = "SiWG917M111MGTBA" @@ -127,6 +131,7 @@ if (silabs_board == "BRD4304A") { show_qr_code = false wifi_soc = true wifi_soc_common_flash = true + silabs_board_lower = "brd4338a" } else if (silabs_board == "BRD4180A") { assert( false, diff --git a/third_party/silabs/wifi_sdk b/third_party/silabs/wifi_sdk index 0f0cdcdc249b8d..f84bf6683b124b 160000 --- a/third_party/silabs/wifi_sdk +++ b/third_party/silabs/wifi_sdk @@ -1 +1 @@ -Subproject commit 0f0cdcdc249b8de03cb57b5095b290125f42030c +Subproject commit f84bf6683b124b62475cd456869c6db7c21ae24e From 8bf4bddde157751612d182a4cb918c8d43f91dcc Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Mon, 18 Sep 2023 10:50:37 +0530 Subject: [PATCH 122/134] [ESP32] Initialize the KVS partition when nvs encryption is enabled (#29280) --- src/platform/ESP32/ConfigurationManagerImpl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/platform/ESP32/ConfigurationManagerImpl.cpp b/src/platform/ESP32/ConfigurationManagerImpl.cpp index 45c1cb9a14021a..188fb75a43e86b 100644 --- a/src/platform/ESP32/ConfigurationManagerImpl.cpp +++ b/src/platform/ESP32/ConfigurationManagerImpl.cpp @@ -118,6 +118,15 @@ CHIP_ERROR ConfigurationManagerImpl::Init() err = MapConfigError(esp_err); SuccessOrExit(err); } + + esp_err = nvs_flash_secure_init_partition(CHIP_DEVICE_CONFIG_CHIP_KVS_NAMESPACE_PARTITION, &cfg); + if (esp_err == ESP_ERR_NVS_NO_FREE_PAGES || esp_err == ESP_ERR_NVS_NEW_VERSION_FOUND) + { + ChipLogError(DeviceLayer, "Failed to initialize NVS partition %s err:0x%02x", + CHIP_DEVICE_CONFIG_CHIP_KVS_NAMESPACE_PARTITION, esp_err); + err = MapConfigError(esp_err); + SuccessOrExit(err); + } #else // Initialize the nvs partitions, // nvs_flash_init_partition() will initialize the partition only if it is not already initialized. From 242a52bb07deba2e524f8265b17b053af3ca7894 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Mon, 18 Sep 2023 10:51:38 +0530 Subject: [PATCH 123/134] [ESP32] Append to chip_libraries list only if present in (#29281) BUILD_COMPONENTS and fix some indentation. --- config/esp32/components/chip/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/esp32/components/chip/CMakeLists.txt b/config/esp32/components/chip/CMakeLists.txt index 61920102605cba..13beac09ce2153 100644 --- a/config/esp32/components/chip/CMakeLists.txt +++ b/config/esp32/components/chip/CMakeLists.txt @@ -486,12 +486,12 @@ endforeach() set(components_to_link esp_event hal esp_system soc efuse vfs driver esp_coex freertos) idf_build_get_property(build_components BUILD_COMPONENTS) foreach(component ${components_to_link}) - # Some of the components are not present in IDF v4.x - # So, Check if the component is in the list of build components - if("${component}" IN_LIST build_components) + # Some of the components are not present in IDF v4.x + # So, Check if the component is in the list of build components + if("${component}" IN_LIST build_components) idf_component_get_property(lib_name ${component} COMPONENT_LIB) + list(APPEND chip_libraries $) endif() - list(APPEND chip_libraries $) endforeach() target_link_libraries(${COMPONENT_LIB} INTERFACE -Wl,--start-group From dc0626248f795dbe30a6e33a0ab13c3c8cd4dd34 Mon Sep 17 00:00:00 2001 From: Alex Tsitsiura Date: Mon, 18 Sep 2023 16:29:44 +0300 Subject: [PATCH 124/134] [Telink] Add resource monitoring app (#29157) * [Telink] add draft resource-monitoring app * [Telink] add Telink-resource-monitoring example to github CI * add compatibility with tlsr9528a_board * [Telink] Minor chnages * Restyled by whitespace * Restyled by clang-format * [Telink] Spelling error remove * [Telink] Fix typo --------- Co-authored-by: UR6LAL Co-authored-by: Restyled.io --- .github/workflows/examples-telink.yaml | 12 ++ .vscode/tasks.json | 1 + .../resource-monitoring-app/telink/.gitignore | 1 + .../telink/CMakeLists.txt | 91 +++++++++ .../resource-monitoring-app/telink/README.md | 175 ++++++++++++++++++ .../telink/include/AppConfig.h | 27 +++ .../telink/include/AppTask.h | 37 ++++ .../telink/include/CHIPProjectConfig.h | 39 ++++ .../resource-monitoring-app/telink/prj.conf | 66 +++++++ .../telink/src/AppTask.cpp | 72 +++++++ .../telink/src/ZclCallbacks.cpp | 89 +++++++++ .../telink/third_party/connectedhomeip | 1 + scripts/build/build/targets.py | 1 + scripts/build/builders/telink.py | 5 + .../build/testdata/all_targets_linux_x64.txt | 2 +- 15 files changed, 618 insertions(+), 1 deletion(-) create mode 100644 examples/resource-monitoring-app/telink/.gitignore create mode 100644 examples/resource-monitoring-app/telink/CMakeLists.txt create mode 100644 examples/resource-monitoring-app/telink/README.md create mode 100644 examples/resource-monitoring-app/telink/include/AppConfig.h create mode 100644 examples/resource-monitoring-app/telink/include/AppTask.h create mode 100644 examples/resource-monitoring-app/telink/include/CHIPProjectConfig.h create mode 100644 examples/resource-monitoring-app/telink/prj.conf create mode 100644 examples/resource-monitoring-app/telink/src/AppTask.cpp create mode 100644 examples/resource-monitoring-app/telink/src/ZclCallbacks.cpp create mode 120000 examples/resource-monitoring-app/telink/third_party/connectedhomeip diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index ce56a06b25db37..144af18c4d4d89 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -196,6 +196,18 @@ jobs: - name: clean out build output run: rm -rf ./out + - name: Build example Telink (B91) Resource Monitoring App + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py --target 'telink-tlsr9518adk80d-resource-monitoring' build" + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + telink tlsr9518adk80d resource-monitoring-app \ + out/telink-tlsr9518adk80d-resource-monitoring/zephyr/zephyr.elf \ + /tmp/bloat_reports/ + + - name: clean out build output + run: rm -rf ./out + - name: Build example Telink (B91) Shell App run: | ./scripts/run_in_build_env.sh \ diff --git a/.vscode/tasks.json b/.vscode/tasks.json index e1e900f7fb57a7..c5949bde691141 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -673,6 +673,7 @@ "telink-tlsr9518adk80d-ota-requestor", "telink-tlsr9518adk80d-pump-app", "telink-tlsr9518adk80d-pump-controller-app", + "telink-tlsr9518adk80d-resource-monitoring-app", "telink-tlsr9518adk80d-shell", "telink-tlsr9518adk80d-smoke-co-alarm-app", "telink-tlsr9518adk80d-temperature-measurement", diff --git a/examples/resource-monitoring-app/telink/.gitignore b/examples/resource-monitoring-app/telink/.gitignore new file mode 100644 index 00000000000000..84c048a73cc2e5 --- /dev/null +++ b/examples/resource-monitoring-app/telink/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/examples/resource-monitoring-app/telink/CMakeLists.txt b/examples/resource-monitoring-app/telink/CMakeLists.txt new file mode 100644 index 00000000000000..3b86c7ef67af8d --- /dev/null +++ b/examples/resource-monitoring-app/telink/CMakeLists.txt @@ -0,0 +1,91 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +cmake_minimum_required(VERSION 3.13.1) + +get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/third_party/connectedhomeip REALPATH) +get_filename_component(TELINK_COMMON ${CHIP_ROOT}/examples/platform/telink REALPATH) +get_filename_component(GEN_DIR ${CHIP_ROOT}/zzz_generated/ REALPATH) + +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") + set(LOCAL_DTC_OVERLAY_FILE "${CMAKE_CURRENT_SOURCE_DIR}/boards/${BOARD}.overlay") +else() + unset(LOCAL_DTC_OVERLAY_FILE) +endif() + +if(EXISTS "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay") + set(GLOBAL_DTC_OVERLAY_FILE "${CHIP_ROOT}/src/platform/telink/${BOARD}.overlay") +else() + unset(GLOBAL_DTC_OVERLAY_FILE) +endif() + +if(DTC_OVERLAY_FILE) + set(DTC_OVERLAY_FILE + "${DTC_OVERLAY_FILE} ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}" + CACHE STRING "" FORCE + ) +else() + set(DTC_OVERLAY_FILE ${GLOBAL_DTC_OVERLAY_FILE} ${LOCAL_DTC_OVERLAY_FILE}) +endif() + +set(CONF_FILE ${CHIP_ROOT}/config/telink/app/zephyr.conf prj.conf) + +# Load NCS/Zephyr build system +list(APPEND ZEPHYR_EXTRA_MODULES ${CHIP_ROOT}/config/telink/chip-module) +find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) + +project(chip-telink-resource-monitoring-example) + +include(${CHIP_ROOT}/config/telink/app/enable-gnu-std.cmake) +include(${CHIP_ROOT}/src/app/chip_data_model.cmake) + +target_compile_options(app PRIVATE -fpermissive) + +target_include_directories(app PRIVATE + include + ${GEN_DIR}/app-common + ${GEN_DIR}/resource-monitoring-app + ${TELINK_COMMON}/common/include + ${TELINK_COMMON}/util/include + ${CMAKE_CURRENT_SOURCE_DIR}/../resource-monitoring-common/include + ${CMAKE_CURRENT_SOURCE_DIR}/../resource-monitoring-common/include/delegates + ) + +add_definitions( + "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" +) + +target_sources(app PRIVATE + src/AppTask.cpp + src/ZclCallbacks.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../resource-monitoring-common/src/ReplacementProductListManager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../resource-monitoring-common/src/delegates/ActivatedCarbonFilterMonitoring.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../resource-monitoring-common/src/delegates/HepaFilterMonitoring.cpp + ${TELINK_COMMON}/common/src/mainCommon.cpp + ${TELINK_COMMON}/common/src/AppTaskCommon.cpp + ${TELINK_COMMON}/util/src/LEDWidget.cpp + ${TELINK_COMMON}/util/src/ButtonManager.cpp + ${TELINK_COMMON}/util/src/ThreadUtil.cpp + ${TELINK_COMMON}/util/src/PWMDevice.cpp + ) + +chip_configure_data_model(app + INCLUDE_SERVER + ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../resource-monitoring-common/resource-monitoring-app.zap +) + +if(CONFIG_CHIP_OTA_REQUESTOR) + target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp) +endif() diff --git a/examples/resource-monitoring-app/telink/README.md b/examples/resource-monitoring-app/telink/README.md new file mode 100644 index 00000000000000..4512f038fb053c --- /dev/null +++ b/examples/resource-monitoring-app/telink/README.md @@ -0,0 +1,175 @@ +# Matter Telink Resource Monitoring Example Application + +You can use this example as a reference for creating your own application. + +![Telink B91 EVK](http://wiki.telink-semi.cn/wiki/assets/Hardware/B91_Generic_Starter_Kit_Hardware_Guide/connection_chart.png) + +## Build and flash + +1. Pull docker image from repository: + + ```bash + $ docker pull ghcr.io/project-chip/chip-build-telink:10 + ``` + +2. Run docker container: + + ```bash + $ docker run -it --rm -v ${CHIP_BASE}:/root/chip -v /dev/bus/usb:/dev/bus/usb --device-cgroup-rule "c 189:* rmw" ghcr.io/project-chip/chip-build-telink:10 + ``` + + here `${CHIP_BASE}` is directory which contains CHIP repo files **!!!Pay + attention that OUTPUT_DIR should contains ABSOLUTE path to output dir** + +3. Activate the build environment: + + ```bash + $ source ./scripts/activate.sh + ``` + +4. In the example dir run (replace __ with your board name, for + example, `tlsr9518adk80d` or `tlsr9528a`): + + ```bash + $ west build -b + ``` + +5. Flash binary: + + ``` + $ west flash --erase + ``` + +## Usage + +### UART + +To get output from device, connect UART to following pins: + +| Name | Pin | +| :--: | :---------------------------- | +| RX | PB3 (pin 17 of J34 connector) | +| TX | PB2 (pin 16 of J34 connector) | +| GND | GND | + +### Buttons + +The following buttons are available on **tlsr9518adk80d** board: + +| Name | Function | Description | +| :------- | :--------------------- | :----------------------------------------------------------------------------------------------------- | +| Button 1 | Factory reset | Perform factory reset to forget currently commissioned Thread network and back to uncommissioned state | +| Button 2 | NA | NA | +| Button 3 | Thread start | Commission thread with static credentials and enables the Thread on device | +| Button 4 | Open commission window | The button is opening commissioning window to perform commissioning over BLE | + +### LEDs + +#### Indicate current state of Thread network + +**Red** LED indicates current state of Thread network. It is able to be in +following states: + +| State | Description | +| :-------------------------- | :--------------------------------------------------------------------------- | +| Blinks with short pulses | Device is not commissioned to Thread, Thread is disabled | +| Blinks with frequent pulses | Device is commissioned, Thread enabled. Device trying to JOIN thread network | +| Blinks with wide pulses | Device commissioned and joined to thread network as CHILD | + +#### Indicate identify of device + +**Green** LED used to identify the device. The LED starts blinking when the +Identify command of the Identify cluster is received. The command's argument can +be used to specify the the effect. It is able to be in following effects: + +| Effect | Description | +| :------------------------------ | :--------------------------------------------------------------------------- | +| Blinks (200 ms on/200 ms off) | Blink (`Clusters::Identify::EffectIdentifierEnum::kBlink`) | +| Breathe (during 1000 ms) | Breathe (`Clusters::Identify::EffectIdentifierEnum::kBreathe`) | +| Blinks (50 ms on/950 ms off) | Okay (`Clusters::Identify::EffectIdentifierEnum::kOkay`) | +| Blinks (1000 ms on/1000 ms off) | Channel Change ( `Clusters::Identify::EffectIdentifierEnum::kChannelChange`) | +| Blinks (950 ms on/50 ms off) | Finish ( `Clusters::Identify::EffectIdentifierEnum::kFinishEffect`) | +| LED off | Stop (`Clusters::Identify::EffectIdentifierEnum::kStopEffect`) | + +### CHIP tool commands + +1. Build + [chip-tool cli](https://github.com/project-chip/connectedhomeip/blob/master/examples/chip-tool/README.md) + +2. Pair with device + + ``` + ${CHIP_TOOL_DIR}/chip-tool pairing ble-thread ${NODE_ID} hex:${DATASET} ${PIN_CODE} ${DISCRIMINATOR} + ``` + + Example: + + ``` + ./chip-tool pairing ble-thread 1234 hex:0e080000000000010000000300000f35060004001fffe0020811111111222222220708fd61f77bd3df233e051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f010212340410445f2b5ca6f2a93a55ce570a70efeecb0c0402a0fff8 20202021 3840 + ``` + +### OTA with Linux OTA Provider + +OTA feature enabled by default only for ota-requestor-app example. To enable OTA +feature for another Telink example: + +- set CONFIG_CHIP_OTA_REQUESTOR=y in corresponding "prj.conf" configuration + file. + +After build application with enabled OTA feature, use next binary files: + +- zephyr.bin - main binary to flash PCB (Use 2MB PCB). +- zephyr-ota.bin - binary for OTA Provider + +All binaries has the same SW version. To test OTA “zephyr-ota.bin” should have +higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in +corresponding “prj.conf” configuration file. + +Usage of OTA: + +- Build the [Linux OTA Provider](../../ota-provider-app/linux) + + ``` + ./scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/ota-provider-app chip_config_network_layer_ble=false + ``` + +- Run the Linux OTA Provider with OTA image. + + ``` + ./chip-ota-provider-app -f zephyr-ota.bin + ``` + +- Provision the Linux OTA Provider using chip-tool + + ``` + ./chip-tool pairing onnetwork ${OTA_PROVIDER_NODE_ID} 20202021 + ``` + + here: + + - \${OTA_PROVIDER_NODE_ID} is the node id of Linux OTA Provider + +- Configure the ACL of the ota-provider-app to allow access + + ``` + ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' ${OTA_PROVIDER_NODE_ID} 0 + ``` + + here: + + - \${OTA_PROVIDER_NODE_ID} is the node id of Linux OTA Provider + +- Use the chip-tool to announce the ota-provider-app to start the OTA process + + ``` + ./chip-tool otasoftwareupdaterequestor announce-otaprovider ${OTA_PROVIDER_NODE_ID} 0 0 0 ${DEVICE_NODE_ID} 0 + ``` + + here: + + - \${OTA_PROVIDER_NODE_ID} is the node id of Linux OTA Provider + - \${DEVICE_NODE_ID} is the node id of paired device + +Once the transfer is complete, OTA requestor sends ApplyUpdateRequest command to +OTA provider for applying the image. Device will restart on successful +application of OTA image. diff --git a/examples/resource-monitoring-app/telink/include/AppConfig.h b/examples/resource-monitoring-app/telink/include/AppConfig.h new file mode 100644 index 00000000000000..211c2fb8ef03c0 --- /dev/null +++ b/examples/resource-monitoring-app/telink/include/AppConfig.h @@ -0,0 +1,27 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +// ---- Air Quality Example App Config ---- + +#define APP_USE_EXAMPLE_START_BUTTON 0 +#define APP_USE_THREAD_START_BUTTON 0 +#define APP_SET_DEVICE_INFO_PROVIDER 1 +#define APP_SET_NETWORK_COMM_ENDPOINT_SEC 0 +#define APP_USE_IDENTIFY_PWM 1 diff --git a/examples/resource-monitoring-app/telink/include/AppTask.h b/examples/resource-monitoring-app/telink/include/AppTask.h new file mode 100644 index 00000000000000..c0e6c9080143e6 --- /dev/null +++ b/examples/resource-monitoring-app/telink/include/AppTask.h @@ -0,0 +1,37 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "AppTaskCommon.h" + +class AppTask : public AppTaskCommon +{ +private: + friend AppTask & GetAppTask(void); + friend class AppTaskCommon; + + CHIP_ERROR Init(void); + + static AppTask sAppTask; +}; + +inline AppTask & GetAppTask(void) +{ + return AppTask::sAppTask; +} diff --git a/examples/resource-monitoring-app/telink/include/CHIPProjectConfig.h b/examples/resource-monitoring-app/telink/include/CHIPProjectConfig.h new file mode 100644 index 00000000000000..412932a59c3726 --- /dev/null +++ b/examples/resource-monitoring-app/telink/include/CHIPProjectConfig.h @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * Example project configuration file for CHIP. + * + * This is a place to put application or project-specific overrides + * to the default configuration values for general CHIP features. + * + */ + +#pragma once + +// Use a default pairing code if one hasn't been provisioned in flash. +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 +#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 + +/** + * CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE + * + * Reduce packet buffer pool size to 8 (default 15) to reduce ram consumption + */ +#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8 diff --git a/examples/resource-monitoring-app/telink/prj.conf b/examples/resource-monitoring-app/telink/prj.conf new file mode 100644 index 00000000000000..25406da917cd62 --- /dev/null +++ b/examples/resource-monitoring-app/telink/prj.conf @@ -0,0 +1,66 @@ +# +# Copyright (c) 2023 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# This sample uses sample-defaults.conf to set options common for all +# samples. This file should contain only options specific for this sample +# or overrides of default values. + +# enable GPIO +CONFIG_GPIO=y + +# enable PWM +CONFIG_PWM=y + +# OpenThread configs +CONFIG_OPENTHREAD_MTD=y +CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_THREAD_SSED=n + +# Default OpenThread network settings +CONFIG_OPENTHREAD_PANID=4660 +CONFIG_OPENTHREAD_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThreadDemo" +CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22" + +# Disable Matter OTA DFU +CONFIG_CHIP_OTA_REQUESTOR=n + +# CHIP configuration +CONFIG_CHIP_PROJECT_CONFIG="include/CHIPProjectConfig.h" +CONFIG_CHIP_OPENTHREAD_CONFIG="../../platform/telink/project_include/OpenThreadConfig.h" + +CONFIG_CHIP_DEVICE_VENDOR_ID=65521 +# CHIP PID: 32769 == 0x8001 (all-clusters-app) +CONFIG_CHIP_DEVICE_PRODUCT_ID=32769 +CONFIG_CHIP_DEVICE_TYPE=65535 + +CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=1 +CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING="2022" + +# Enable CHIP pairing automatically on application start. +CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y + +# CHIP shell +CONFIG_CHIP_LIB_SHELL=n + +# Disable factory data support. +CONFIG_CHIP_FACTORY_DATA=n +CONFIG_CHIP_FACTORY_DATA_BUILD=n +CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=n +CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n + +# Enable Power Management +CONFIG_PM=y diff --git a/examples/resource-monitoring-app/telink/src/AppTask.cpp b/examples/resource-monitoring-app/telink/src/AppTask.cpp new file mode 100644 index 00000000000000..bdd9fba11fa60e --- /dev/null +++ b/examples/resource-monitoring-app/telink/src/AppTask.cpp @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AppTask.h" + +#include +#include +#include +#include +#include +#include +#include + +LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ResourceMonitoring; + +AppTask AppTask::sAppTask; + +constexpr std::bitset<4> gHepaFilterFeatureMap{ static_cast(Feature::kCondition) | + static_cast(Feature::kWarning) | + static_cast(Feature::kReplacementProductList) }; +constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast(Feature::kCondition) | + static_cast(Feature::kWarning) | + static_cast(Feature::kReplacementProductList) }; + +static HepaFilterMonitoringDelegate gHepaFilterDelegate; +static ResourceMonitoring::Instance gHepaFilterInstance(&gHepaFilterDelegate, 0x1, HepaFilterMonitoring::Id, + static_cast(gHepaFilterFeatureMap.to_ulong()), + Clusters::ResourceMonitoring::DegradationDirectionEnum::kDown, true); + +static ActivatedCarbonFilterMonitoringDelegate gActivatedCarbonFilterDelegate; +static ResourceMonitoring::Instance gActivatedCarbonFilterInstance(&gActivatedCarbonFilterDelegate, 0x1, + ActivatedCarbonFilterMonitoring::Id, + static_cast(gActivatedCarbonFeatureMap.to_ulong()), + Clusters::ResourceMonitoring::DegradationDirectionEnum::kDown, + true); + +CHIP_ERROR AppTask::Init(void) +{ + InitCommonParts(); + + gHepaFilterInstance.Init(); + gActivatedCarbonFilterInstance.Init(); + + CHIP_ERROR err = ConnectivityMgr().SetBLEDeviceName("TelinkResMonDevice"); + if (err != CHIP_NO_ERROR) + { + LOG_ERR("SetBLEDeviceName fail"); + return err; + } + + return CHIP_NO_ERROR; +} diff --git a/examples/resource-monitoring-app/telink/src/ZclCallbacks.cpp b/examples/resource-monitoring-app/telink/src/ZclCallbacks.cpp new file mode 100644 index 00000000000000..d622dcbe664407 --- /dev/null +++ b/examples/resource-monitoring-app/telink/src/ZclCallbacks.cpp @@ -0,0 +1,89 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file + * This file implements the handler for data model messages. + */ + +#include "AppConfig.h" + +#include +#include +#include +#include +#include + +using namespace ::chip; +using namespace ::chip::app::Clusters; + +LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL); + +void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t type, uint16_t size, + uint8_t * value) +{ + ClusterId clusterId = attributePath.mClusterId; + AttributeId attributeId = attributePath.mAttributeId; + ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); + + if (clusterId == HepaFilterMonitoring::Id && attributeId == HepaFilterMonitoring::Attributes::DegradationDirection::Id) + { + static_assert(sizeof(HepaFilterMonitoring::DegradationDirectionEnum) == 1, "Wrong size"); + HepaFilterMonitoring::DegradationDirectionEnum HepaFilterState = + *(reinterpret_cast(value)); + ChipLogProgress(Zcl, "Hepa Filter Monitoring cluster: " ChipLogFormatMEI " state %d", ChipLogValueMEI(clusterId), + to_underlying(HepaFilterState)); + } + else if (clusterId == ActivatedCarbonFilterMonitoring::Id && + attributeId == ActivatedCarbonFilterMonitoring::Attributes::DegradationDirection::Id) + { + static_assert(sizeof(ActivatedCarbonFilterMonitoring::DegradationDirectionEnum) == 1, "Wrong size"); + ActivatedCarbonFilterMonitoring::DegradationDirectionEnum CarbonFilterState = + *(reinterpret_cast(value)); + ChipLogProgress(Zcl, "Activated Carbon Filter cluster: " ChipLogFormatMEI " state %d", ChipLogValueMEI(clusterId), + to_underlying(CarbonFilterState)); + } +} + +/** @brief Hepa Filter Monitoring Cluster Init + * + * This function is called when a specific cluster is initialized. It gives the + * application an opportunity to take care of cluster initialization procedures. + * It is called exactly once for each endpoint where cluster is present. + * + * @param endpoint Ver.: always + * + */ +void emberAfHepaFilterMonitoringClusterInitCallback(EndpointId endpoint) +{ + // TODO: implement any additional Cluster Server init actions +} + +/** @brief Activated Carbon Filter Monitoring Cluster Init + * + * This function is called when a specific cluster is initialized. It gives the + * application an opportunity to take care of cluster initialization procedures. + * It is called exactly once for each endpoint where cluster is present. + * + * @param endpoint Ver.: always + * + */ +void emberAfActivatedCarbonFilterMonitoringClusterInitCallback(EndpointId endpoint) +{ + // TODO: implement any additional Cluster Server init actions +} diff --git a/examples/resource-monitoring-app/telink/third_party/connectedhomeip b/examples/resource-monitoring-app/telink/third_party/connectedhomeip new file mode 120000 index 00000000000000..c866b86874994d --- /dev/null +++ b/examples/resource-monitoring-app/telink/third_party/connectedhomeip @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 7b462089a8f218..10a8da19eba038 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -696,6 +696,7 @@ def BuildTelinkTarget(): TargetPart('ota-requestor', app=TelinkApp.OTA_REQUESTOR), TargetPart('pump', app=TelinkApp.PUMP), TargetPart('pump-controller', app=TelinkApp.PUMP_CONTROLLER), + TargetPart('resource-monitoring', app=TelinkApp.RESOURCE_MONITORING), TargetPart('shell', app=TelinkApp.SHELL), TargetPart('smoke-co-alarm', app=TelinkApp.SMOKE_CO_ALARM), TargetPart('temperature-measurement', diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index 754bc077f46254..5e62a5152bc205 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -31,6 +31,7 @@ class TelinkApp(Enum): OTA_REQUESTOR = auto() PUMP = auto() PUMP_CONTROLLER = auto() + RESOURCE_MONITORING = auto() SHELL = auto() SMOKE_CO_ALARM = auto() TEMPERATURE_MEASUREMENT = auto() @@ -58,6 +59,8 @@ def ExampleName(self): return 'pump-app' elif self == TelinkApp.PUMP_CONTROLLER: return 'pump-controller-app' + elif self == TelinkApp.RESOURCE_MONITORING: + return 'resource-monitoring-app' elif self == TelinkApp.SHELL: return 'shell' elif self == TelinkApp.SMOKE_CO_ALARM: @@ -92,6 +95,8 @@ def AppNamePrefix(self): return 'chip-telink-pump-example' elif self == TelinkApp.PUMP_CONTROLLER: return 'chip-telink-pump-controller-example' + elif self == TelinkApp.RESOURCE_MONITORING: + return 'chip-telink-resource-monitoring-example' elif self == TelinkApp.SHELL: return 'chip-telink-shell-example' elif self == TelinkApp.SMOKE_CO_ALARM: diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index 91bbc0a326c831..b501e2fbaff3e7 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -22,5 +22,5 @@ nrf-native-posix-64-tests qpg-qpg6105-{lock,light,shell,persistent-storage} stm32-stm32wb5mm-dk-light tizen-arm-{all-clusters,all-clusters-minimal,chip-tool,light,tests}[-no-ble][-no-thread][-no-wifi][-asan][-ubsan] -telink-{tlsr9518adk80d,tlsr9528a}-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] +telink-{tlsr9518adk80d,tlsr9528a}-{all-clusters,all-clusters-minimal,bridge,contact-sensor,light,light-switch,lock,ota-requestor,pump,pump-controller,resource-monitoring,shell,smoke-co-alarm,temperature-measurement,thermostat,window-covering}[-shell][-rpc][-factory-data] openiotsdk-{shell,lock}[-mbedtls][-psa] From c5be4db4fe7536abb192a4be5ab38d2aa4613955 Mon Sep 17 00:00:00 2001 From: Andrii Bilynskyi Date: Mon, 18 Sep 2023 16:29:54 +0300 Subject: [PATCH 125/134] [Telink] Power down mode using ICD (#29287) --- config/telink/chip-module/CMakeLists.txt | 1 + examples/platform/telink/common/src/mainCommon.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt index bfb38cb5172c69..1ebe7bb91ce844 100644 --- a/config/telink/chip-module/CMakeLists.txt +++ b/config/telink/chip-module/CMakeLists.txt @@ -97,6 +97,7 @@ matter_add_gn_arg_bool ("chip_error_logging" CONFIG_MATTER_ matter_add_gn_arg_bool ("chip_progress_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 3) matter_add_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_LOG_LEVEL GREATER_EQUAL 4) matter_add_gn_arg_bool ("chip_automation_logging" FALSE) +matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_ENABLE_ICD_SUPPORT) if (CONFIG_CHIP_FACTORY_DATA) matter_add_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false") diff --git a/examples/platform/telink/common/src/mainCommon.cpp b/examples/platform/telink/common/src/mainCommon.cpp index d88a6a981dd985..5adc0804872c72 100644 --- a/examples/platform/telink/common/src/mainCommon.cpp +++ b/examples/platform/telink/common/src/mainCommon.cpp @@ -142,7 +142,7 @@ int main(void) goto exit; } -#ifdef CONFIG_OPENTHREAD_MTD_SED +#ifdef CONFIG_CHIP_ENABLE_ICD_SUPPORT err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice); #elif CONFIG_OPENTHREAD_MTD err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); From d84c01aab89fd4f588abd0dd178bee41e4fc8e4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:31:27 +0000 Subject: [PATCH 126/134] Bump third_party/nanopb/repo from `9c11463` to `f5f65a9` (#29315) Bumps [third_party/nanopb/repo](https://github.com/nanopb/nanopb) from `9c11463` to `f5f65a9`. - [Commits](https://github.com/nanopb/nanopb/compare/9c11463770beab0c6f244999e66676f9bca866fd...f5f65a90c8057a591f3cc98de40874bd78c9880d) --- updated-dependencies: - dependency-name: third_party/nanopb/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/nanopb/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/nanopb/repo b/third_party/nanopb/repo index 9c11463770beab..f5f65a90c8057a 160000 --- a/third_party/nanopb/repo +++ b/third_party/nanopb/repo @@ -1 +1 @@ -Subproject commit 9c11463770beab0c6f244999e66676f9bca866fd +Subproject commit f5f65a90c8057a591f3cc98de40874bd78c9880d From 4ee9f487dd870136908005e8d7cec4ea38f15fbf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:31:39 +0000 Subject: [PATCH 127/134] Bump third_party/imgui/repo from `3816d47` to `6addf28` (#29317) Bumps [third_party/imgui/repo](https://github.com/ocornut/imgui) from `3816d47` to `6addf28`. - [Release notes](https://github.com/ocornut/imgui/releases) - [Commits](https://github.com/ocornut/imgui/compare/3816d478df0e7e292545fc7017b3d907c2dfd7a2...6addf28c4b5d8fd109a6db73bed6436952b230b2) --- updated-dependencies: - dependency-name: third_party/imgui/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/imgui/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/imgui/repo b/third_party/imgui/repo index 3816d478df0e7e..6addf28c4b5d8f 160000 --- a/third_party/imgui/repo +++ b/third_party/imgui/repo @@ -1 +1 @@ -Subproject commit 3816d478df0e7e292545fc7017b3d907c2dfd7a2 +Subproject commit 6addf28c4b5d8fd109a6db73bed6436952b230b2 From a3a11f5fcbc4573bf818fba7d8d5e3b0788b0eba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:33:51 -0400 Subject: [PATCH 128/134] Bump third_party/ot-br-posix/repo from `8a280e3` to `ff2f24c` (#29313) Bumps [third_party/ot-br-posix/repo](https://github.com/openthread/ot-br-posix) from `8a280e3` to `ff2f24c`. - [Release notes](https://github.com/openthread/ot-br-posix/releases) - [Commits](https://github.com/openthread/ot-br-posix/compare/8a280e3516641f707324bbc83059736d02f68955...ff2f24c5689ea45d8ab27d3da86c54b6d5d6c83f) --- updated-dependencies: - dependency-name: third_party/ot-br-posix/repo dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- third_party/ot-br-posix/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/ot-br-posix/repo b/third_party/ot-br-posix/repo index 8a280e3516641f..ff2f24c5689ea4 160000 --- a/third_party/ot-br-posix/repo +++ b/third_party/ot-br-posix/repo @@ -1 +1 @@ -Subproject commit 8a280e3516641f707324bbc83059736d02f68955 +Subproject commit ff2f24c5689ea45d8ab27d3da86c54b6d5d6c83f From 764358b6a3cb5547d186c5a8371c8e726fca9df9 Mon Sep 17 00:00:00 2001 From: weicheng Date: Mon, 18 Sep 2023 22:05:46 +0800 Subject: [PATCH 129/134] [ASR] Bump asr sdk to update factory data tlv (#29307) Co-authored-by: weicheng --- src/platform/ASR/ASRFactoryDataProvider.cpp | 2 +- third_party/asr/asr550x/asr_sdk | 2 +- third_party/asr/asr582x/asr_sdk | 2 +- third_party/asr/asr595x/asr_sdk | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 src/platform/ASR/ASRFactoryDataProvider.cpp diff --git a/src/platform/ASR/ASRFactoryDataProvider.cpp b/src/platform/ASR/ASRFactoryDataProvider.cpp old mode 100644 new mode 100755 index c99fb99936debe..f798d0133a0231 --- a/src/platform/ASR/ASRFactoryDataProvider.cpp +++ b/src/platform/ASR/ASRFactoryDataProvider.cpp @@ -50,7 +50,7 @@ CHIP_ERROR ASRFactoryDataProvider::Init() if (ret != 0) { err = CHIP_ERROR_INTERNAL; - ChipLogError(DeviceLayer, "The hash of factory bin is not correct."); + ChipLogError(DeviceLayer, "ASR factory data check failed."); } #endif return err; diff --git a/third_party/asr/asr550x/asr_sdk b/third_party/asr/asr550x/asr_sdk index ffa0fdc7ea3b97..17999312cecdf7 160000 --- a/third_party/asr/asr550x/asr_sdk +++ b/third_party/asr/asr550x/asr_sdk @@ -1 +1 @@ -Subproject commit ffa0fdc7ea3b9762af7c2bb623aaac45ececdf8f +Subproject commit 17999312cecdf786ac86ea0554d760b258c8bc00 diff --git a/third_party/asr/asr582x/asr_sdk b/third_party/asr/asr582x/asr_sdk index 3134c59ed1d7cd..667c66a2f69eb6 160000 --- a/third_party/asr/asr582x/asr_sdk +++ b/third_party/asr/asr582x/asr_sdk @@ -1 +1 @@ -Subproject commit 3134c59ed1d7cd7221d730300fd9dee39c820a35 +Subproject commit 667c66a2f69eb6f4adf2e9bede0b6b88cd4378ce diff --git a/third_party/asr/asr595x/asr_sdk b/third_party/asr/asr595x/asr_sdk index e1a75ae0769681..ff434155859d58 160000 --- a/third_party/asr/asr595x/asr_sdk +++ b/third_party/asr/asr595x/asr_sdk @@ -1 +1 @@ -Subproject commit e1a75ae076968166684f68de9b38d3a1fd3122b9 +Subproject commit ff434155859d58b1a9d8294004f3bcfccf878416 From 7423b08d785347042ba5f7aa1218f9813f818c8d Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Mon, 18 Sep 2023 15:06:27 +0100 Subject: [PATCH 130/134] PersistentStorageOpCertStore: fix a clang-tidy warning (#29286) `~PersistentStorageOpCertStore` invokes `Finish()`, which invokes `RevertPendingOpCerts()` which is a virtual method. In this case methods invoked belong to this class so as long as there are no descendants, it's ok. Make sure there are no descendants by declaring the class final. Fixes https://github.com/project-chip/connectedhomeip/issues/29239 --- src/credentials/PersistentStorageOpCertStore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/credentials/PersistentStorageOpCertStore.h b/src/credentials/PersistentStorageOpCertStore.h index 4beb93b4e3b29a..41ddc096f861e3 100644 --- a/src/credentials/PersistentStorageOpCertStore.h +++ b/src/credentials/PersistentStorageOpCertStore.h @@ -36,7 +36,7 @@ namespace Credentials { * to refactors to use `OperationalCertificateStore` and exists as a baseline example * of how to use the interface. */ -class PersistentStorageOpCertStore : public OperationalCertificateStore +class PersistentStorageOpCertStore final : public OperationalCertificateStore { public: PersistentStorageOpCertStore() {} From 782f9d80969ee4ff14549c9f8cb08b726a5a12ac Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 18 Sep 2023 11:16:05 -0400 Subject: [PATCH 131/134] Add some better comments about the queue for MTRClusters/MTRBaseClusters init. (#29237) --- .../CHIP/templates/MTRBaseClusters.zapt | 4 + .../Framework/CHIP/templates/MTRClusters.zapt | 11 + .../CHIP/zap-generated/MTRBaseClusters.h | 376 ++++++++++++++++++ .../CHIP/zap-generated/MTRClusters.h | 376 ++++++++++++++++++ 4 files changed, 767 insertions(+) diff --git a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt index 8432e20679bc3f..7cafe765538483 100644 --- a/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRBaseClusters.zapt @@ -19,6 +19,10 @@ NS_ASSUME_NONNULL_BEGIN {{availability (asUpperCamelCase name preserveAcronyms=true)}} @interface MTRBaseCluster{{asUpperCamelCase name preserveAcronyms=true}} : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER {{availability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt index 3285e3cba52cea..563ab090b7cd59 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters.zapt @@ -19,6 +19,17 @@ NS_ASSUME_NONNULL_BEGIN {{availability (asUpperCamelCase name preserveAcronyms=true)}} @interface MTRCluster{{asUpperCamelCase name preserveAcronyms=true}} : MTRCluster +/** +{{#zcl_commands}} +{{#first}} + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. +{{/first}} +{{else}} + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. +{{/zcl_commands}} + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER {{availability (asUpperCamelCase name preserveAcronyms=true) minimalRelease="First major API revamp"}}; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 8c3d082798aa46..3777a49c291399 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -30,6 +30,10 @@ NS_ASSUME_NONNULL_BEGIN API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterIdentify : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -171,6 +175,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterGroups : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -331,6 +339,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterScenes : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -615,6 +627,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterOnOff : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -850,6 +866,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterOnOffSwitchConfiguration : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -976,6 +996,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterLevelControl : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1363,6 +1387,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterBinaryInputBasic : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1609,6 +1637,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterPulseWidthModulation : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -1700,6 +1732,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterDescriptor : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1855,6 +1891,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterBinding : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1973,6 +2013,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterAccessControl : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2154,6 +2198,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterActions : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2378,6 +2426,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRBaseClusterBasicInformation : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2764,6 +2816,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRBaseClusterOTASoftwareUpdateProvider : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2886,6 +2942,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRBaseClusterOTASoftwareUpdateRequestor : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -3053,6 +3113,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterLocalizationConfiguration : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -3183,6 +3247,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterTimeFormatLocalization : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -3335,6 +3403,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterUnitLocalization : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -3450,6 +3522,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterPowerSourceConfiguration : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -3557,6 +3633,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterPowerSource : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -4075,6 +4155,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterGeneralCommissioning : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -4284,6 +4368,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterNetworkCommissioning : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -4546,6 +4634,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterDiagnosticLogs : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -4652,6 +4744,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterGeneralDiagnostics : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -4875,6 +4971,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterSoftwareDiagnostics : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5035,6 +5135,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterThreadNetworkDiagnostics : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5966,6 +6070,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterWiFiNetworkDiagnostics : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -6238,6 +6346,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterEthernetNetworkDiagnostics : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -6450,6 +6562,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterTimeSynchronization : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6741,6 +6857,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRBaseClusterBridgedDeviceBasicInformation : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7055,6 +7175,10 @@ light or a window shade. API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterSwitch : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7188,6 +7312,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterAdministratorCommissioning : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7351,6 +7479,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterOperationalCredentials : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7600,6 +7732,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterGroupKeyManagement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7793,6 +7929,10 @@ labels. API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterFixedLabel : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7900,6 +8040,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterUserLabel : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -8014,6 +8158,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterBooleanState : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -8121,6 +8269,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterICDManagement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -8310,6 +8462,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterModeSelect : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -8501,6 +8657,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterLaundryWasherMode : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -8659,6 +8819,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterRefrigeratorAndTemperatureControlledCabinetMode : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -8820,6 +8984,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterLaundryWasherControls : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -8968,6 +9136,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterRVCRunMode : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -9126,6 +9298,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterRVCCleanMode : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -9284,6 +9460,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterTemperatureControl : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -9458,6 +9638,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterRefrigeratorAlarm : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -9584,6 +9768,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterDishwasherMode : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -9742,6 +9930,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterAirQuality : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -9844,6 +10036,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterSmokeCOAlarm : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -10106,6 +10302,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterDishwasherAlarm : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -10260,6 +10460,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterOperationalState : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -10466,6 +10670,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterRVCOperationalState : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -10673,6 +10881,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterHEPAFilterMonitoring : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -10851,6 +11063,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterActivatedCarbonFilterMonitoring : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -11029,6 +11245,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterDoorLock : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -11904,6 +12124,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterWindowCovering : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -12380,6 +12604,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterBarrierControl : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -12675,6 +12903,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterPumpConfigurationAndControl : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -13088,6 +13320,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterThermostat : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -14092,6 +14328,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterFanControl : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -14387,6 +14627,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterThermostatUserInterfaceConfiguration : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -14546,6 +14790,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterColorControl : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -15542,6 +15790,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterBallastConfiguration : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -15887,6 +16139,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterIlluminanceMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -16045,6 +16301,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterTemperatureMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -16190,6 +16450,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterPressureMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -16396,6 +16660,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterFlowMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -16541,6 +16809,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterRelativeHumidityMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -16686,6 +16958,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterOccupancySensing : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -17036,6 +17312,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterCarbonMonoxideConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -17263,6 +17543,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterCarbonDioxideConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -17490,6 +17774,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterNitrogenDioxideConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -17717,6 +18005,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterOzoneConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -17944,6 +18236,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterPM25ConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -18171,6 +18467,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterFormaldehydeConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -18398,6 +18698,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterPM1ConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -18625,6 +18929,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterPM10ConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -18852,6 +19160,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterTotalVolatileOrganicCompoundsConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -19079,6 +19391,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterRadonConcentrationMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -19306,6 +19622,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRBaseClusterWakeOnLAN : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -19413,6 +19733,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterChannel : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -19578,6 +19902,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterTargetNavigator : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -19707,6 +20035,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterMediaPlayback : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -20012,6 +20344,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterMediaInput : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -20165,6 +20501,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterLowPower : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -20269,6 +20609,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterKeypadInput : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -20373,6 +20717,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterContentLauncher : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -20521,6 +20869,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterAudioOutput : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -20656,6 +21008,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterApplicationLauncher : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -20815,6 +21171,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterApplicationBasic : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -21015,6 +21375,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterAccountLogin : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -21141,6 +21505,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRBaseClusterElectricalMeasurement : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -23098,6 +23466,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRBaseClusterUnitTesting : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -25042,6 +25414,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterSampleMEI : MTRCluster +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index c3ad09b1751900..3d6810e6961d35 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -30,6 +30,10 @@ NS_ASSUME_NONNULL_BEGIN API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterIdentify : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -86,6 +90,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterGroups : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -160,6 +168,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterScenes : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -276,6 +288,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterOnOff : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -385,6 +401,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterOnOffSwitchConfiguration : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -432,6 +452,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterLevelControl : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -596,6 +620,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterBinaryInputBasic : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -699,6 +727,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterPulseWidthModulation : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -732,6 +764,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterDescriptor : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -780,6 +816,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterBinding : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -827,6 +867,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterAccessControl : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -890,6 +934,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterActions : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -989,6 +1037,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRClusterBasicInformation : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1107,6 +1159,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRClusterOTASoftwareUpdateProvider : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1159,6 +1215,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRClusterOTASoftwareUpdateRequestor : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1221,6 +1281,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterLocalizationConfiguration : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1271,6 +1335,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterTimeFormatLocalization : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1331,6 +1399,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterUnitLocalization : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1375,6 +1447,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterPowerSourceConfiguration : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1413,6 +1489,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterPowerSource : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1542,6 +1622,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterGeneralCommissioning : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1625,6 +1709,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterNetworkCommissioning : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1727,6 +1815,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterDiagnosticLogs : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1769,6 +1861,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterGeneralDiagnostics : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1836,6 +1932,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterSoftwareDiagnostics : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -1892,6 +1992,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterThreadNetworkDiagnostics : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2125,6 +2229,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterWiFiNetworkDiagnostics : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2208,6 +2316,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterEthernetNetworkDiagnostics : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2278,6 +2390,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterTimeSynchronization : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -2367,6 +2483,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRClusterBridgedDeviceBasicInformation : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2461,6 +2581,10 @@ light or a window shade. API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterSwitch : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2504,6 +2628,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterAdministratorCommissioning : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2568,6 +2696,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterOperationalCredentials : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2667,6 +2799,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterGroupKeyManagement : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2748,6 +2884,10 @@ labels. API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterFixedLabel : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2785,6 +2925,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterUserLabel : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2829,6 +2973,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterBooleanState : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -2866,6 +3014,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterICDManagement : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -2932,6 +3084,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterModeSelect : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -3003,6 +3159,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterLaundryWasherMode : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3060,6 +3220,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterRefrigeratorAndTemperatureControlledCabinetMode : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3120,6 +3284,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterLaundryWasherControls : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3173,6 +3341,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterRVCRunMode : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3230,6 +3402,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterRVCCleanMode : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3287,6 +3463,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterTemperatureControl : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3341,6 +3521,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterRefrigeratorAlarm : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3379,6 +3563,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterDishwasherMode : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3436,6 +3624,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterAirQuality : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3470,6 +3662,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterSmokeCOAlarm : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3549,6 +3745,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterDishwasherAlarm : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3599,6 +3799,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterOperationalState : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3684,6 +3888,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterRVCOperationalState : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3769,6 +3977,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterHEPAFilterMonitoring : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3831,6 +4043,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterActivatedCarbonFilterMonitoring : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -3893,6 +4109,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterDoorLock : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -4255,6 +4475,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterWindowCovering : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -4404,6 +4628,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterBarrierControl : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -4525,6 +4753,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterPumpConfigurationAndControl : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -4656,6 +4888,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterThermostat : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5051,6 +5287,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterFanControl : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5173,6 +5413,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterThermostatUserInterfaceConfiguration : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5237,6 +5481,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterColorControl : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5600,6 +5848,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterBallastConfiguration : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5746,6 +5998,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterIlluminanceMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5795,6 +6051,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterTemperatureMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5841,6 +6101,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterPressureMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5902,6 +6166,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterFlowMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5948,6 +6216,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterRelativeHumidityMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -5994,6 +6266,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterOccupancySensing : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -6127,6 +6403,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterCarbonMonoxideConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6190,6 +6470,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterCarbonDioxideConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6253,6 +6537,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterNitrogenDioxideConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6316,6 +6604,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterOzoneConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6379,6 +6671,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterPM25ConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6442,6 +6738,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterFormaldehydeConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6505,6 +6805,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterPM1ConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6568,6 +6872,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterPM10ConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6631,6 +6939,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterTotalVolatileOrganicCompoundsConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6694,6 +7006,10 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterRadonConcentrationMeasurement : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; @@ -6757,6 +7073,10 @@ MTR_PROVISIONALLY_AVAILABLE API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRClusterWakeOnLAN : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -6794,6 +7114,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterChannel : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -6853,6 +7177,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterTargetNavigator : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -6901,6 +7229,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterMediaPlayback : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7057,6 +7389,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterMediaInput : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7122,6 +7458,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterLowPower : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7164,6 +7504,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterKeypadInput : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7204,6 +7548,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterContentLauncher : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7264,6 +7612,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterAudioOutput : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7313,6 +7665,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterApplicationLauncher : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7378,6 +7734,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterApplicationBasic : MTRCluster +/** + * The queue is currently unused, but may be used in the future for calling completions + * for command invocations if commands are added to this cluster. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7438,6 +7798,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterAccountLogin : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7491,6 +7855,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) @interface MTRClusterElectricalMeasurement : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -7980,6 +8348,10 @@ API_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) @interface MTRClusterUnitTesting : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER @@ -8991,6 +9363,10 @@ API_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterSampleMEI : MTRCluster +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ - (instancetype _Nullable)initWithDevice:(MTRDevice *)device endpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER MTR_PROVISIONALLY_AVAILABLE; From 878282ed28d3b08c9b77d6fb372745d3938b116a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:16:57 +0000 Subject: [PATCH 132/134] Bump pydata-sphinx-theme from 0.13.3 to 0.14.0 (#29311) Bumps [pydata-sphinx-theme](https://github.com/pydata/pydata-sphinx-theme) from 0.13.3 to 0.14.0. - [Release notes](https://github.com/pydata/pydata-sphinx-theme/releases) - [Commits](https://github.com/pydata/pydata-sphinx-theme/compare/v0.13.3...v0.14.0) --- updated-dependencies: - dependency-name: pydata-sphinx-theme dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index cc399509e28909..62b6ad8fc5c3e8 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,4 +3,4 @@ Sphinx>=4.5 sphinx-book-theme myst-parser breathe>=4.34 -pydata-sphinx-theme==0.13.3 +pydata-sphinx-theme==0.14.0 From 627e9b3041bd63c96780e652e0343b3c7adc3cd7 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 18 Sep 2023 12:00:28 -0400 Subject: [PATCH 133/134] Fix constant name of `CONFIG_CHIP_ENABLE_ICD_SUPPORT` (#29322) * Fix sleepy constant * Undo submodule change --- examples/resource-monitoring-app/telink/prj.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/resource-monitoring-app/telink/prj.conf b/examples/resource-monitoring-app/telink/prj.conf index 25406da917cd62..eec66455ef00cc 100644 --- a/examples/resource-monitoring-app/telink/prj.conf +++ b/examples/resource-monitoring-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings From 63397c35b52a42064c16660d14664a8f607bb54e Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Mon, 18 Sep 2023 12:03:49 -0400 Subject: [PATCH 134/134] Fix silabs compile - `#elif` without a condition replaced with `#else` (#29319) * Replace elif with else in macro * Fix undefined usage of WriteQRCode as well * Restyle * Slightly better organization - a single ifdef in the header * Refuse to compile the QRCodeScreen constant if qr code is not enabled --- examples/platform/silabs/display/lcd.cpp | 4 +++- examples/platform/silabs/display/lcd.h | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/platform/silabs/display/lcd.cpp b/examples/platform/silabs/display/lcd.cpp index 7a18951dd54b06..b4baa7ea63547e 100644 --- a/examples/platform/silabs/display/lcd.cpp +++ b/examples/platform/silabs/display/lcd.cpp @@ -212,9 +212,11 @@ void SilabsLCD::SetScreen(Screen_e screen) case StatusScreen: WriteStatus(); break; +#ifdef QR_CODE_ENABLED case QRCodeScreen: WriteQRCode(); break; +#endif default: break; } @@ -224,7 +226,7 @@ void SilabsLCD::CycleScreens(void) { #ifdef QR_CODE_ENABLED if (mCurrentScreen < QRCodeScreen) -#elif +#else if (mCurrentScreen < StatusScreen) #endif { diff --git a/examples/platform/silabs/display/lcd.h b/examples/platform/silabs/display/lcd.h index 085dd7ef8d6240..9324f068b15742 100644 --- a/examples/platform/silabs/display/lcd.h +++ b/examples/platform/silabs/display/lcd.h @@ -37,7 +37,9 @@ class SilabsLCD { DemoScreen = 0, StatusScreen, +#ifdef QR_CODE_ENABLED QRCodeScreen, +#endif InvalidScreen, } Screen_e; @@ -74,13 +76,15 @@ class SilabsLCD bool protocol1 = false; /* data */ } DemoState_t; - void WriteQRCode(); void WriteDemoUI(); void WriteStatus(); + #ifdef QR_CODE_ENABLED + void WriteQRCode(); void LCDFillRect(uint8_t x, uint8_t y, uint8_t w, uint8_t h); char mQRCodeBuffer[chip::QRCodeBasicSetupPayloadGenerator::kMaxQRCodeBase38RepresentationLength + 1]; #endif + GLIB_Context_t glibContext; #ifdef SL_DEMO_NAME